Bug 1267106 - Reftest harness should check readyState and continue if the document state is 'complete'. r=jmaher, a=test-only
authorJim Mathies <jmathies@mozilla.com>
Tue, 11 Oct 2016 09:53:43 -0500
changeset 350668 9646fff5e1c7c54f9f2022c1b7afb55dbc6063b9
parent 350667 4e6e75e9e5ed1547531b3e37a91e24a30210b54e
child 350669 17cde69505a2d2053604cfbfb9380682cb0c333d
push id1230
push userjlund@mozilla.com
push dateMon, 31 Oct 2016 18:13:35 +0000
treeherdermozilla-release@5e06e3766db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher, test-only
bugs1267106
milestone50.0
Bug 1267106 - Reftest harness should check readyState and continue if the document state is 'complete'. r=jmaher, a=test-only MozReview-Commit-ID: IiiVKXaHhuY
layout/tools/reftest/reftest-content.js
--- a/layout/tools/reftest/reftest-content.js
+++ b/layout/tools/reftest/reftest-content.js
@@ -1139,10 +1139,15 @@ function SendUpdateCanvasForEvent(event,
     } else {
         SynchronizeForSnapshot(SYNC_ALLOW_DISABLE);
         sendAsyncMessage("reftest:UpdateCanvasForInvalidation", { rects: rects });
     }
 }
 #if REFTEST_B2G
 OnInitialLoad();
 #else
-addEventListener("load", OnInitialLoad, true);
+if (content.document.readyState == "complete") {
+  // load event has already fired for content, get started
+  OnInitialLoad();
+} else {
+  addEventListener("load", OnInitialLoad, true);
+}
 #endif