Bug 1514115 [wpt PR 14514] - [wptrunner] Correct support for eager page loading, a=testonly
authorMike Pennisi <mike@mikepennisi.com>
Wed, 19 Dec 2018 11:39:01 +0000
changeset 515021 99367c132437d215b047e387ea7706b8b8adf055
parent 515020 b045963550e9f625040b09269ab61985cd1564af
child 515022 4c026d2d70bb05c4678e8ca1e0b6dfc4eae614ae
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1514115, 14514
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1514115 [wpt PR 14514] - [wptrunner] Correct support for eager page loading, a=testonly Automatic update from web-platform-tests [wptrunner] Correct support for eager page loading Many reftests schedule behavior to occur when the document reaches the "complete" readyState by setting the `onload` property of the document element. Previously, the automation scripts were written to conditionally defer execution for that event by setting the `onload` property of the global object. The two strategies are mutually exclusive. The sequence of script execution is not controlled, so either consumer of the "load" event could be blocked by the other. Update the automation scripts to register for the event using `addEventListener` in order to avoid unintended interaction with test code. -- wpt-commits: 6c14d36f4ec7979c459a9636a9c086cc486d43da wpt-pr: 14514
testing/web-platform/tests/tools/wptrunner/wptrunner/executors/reftest-wait_marionette.js
testing/web-platform/tests/tools/wptrunner/wptrunner/executors/reftest-wait_webdriver.js
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/executors/reftest-wait_marionette.js
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/executors/reftest-wait_marionette.js
@@ -8,12 +8,12 @@ function test(x) {
 }
 
 var root = document.documentElement;
 var observer = new MutationObserver(test);
 
 observer.observe(root, {attributes: true});
 
 if (document.readyState != "complete") {
-  onload = test
+  addEventListener('load', test);
 } else {
   test();
 }
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/executors/reftest-wait_webdriver.js
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/executors/reftest-wait_webdriver.js
@@ -33,12 +33,12 @@ function ready_for_screenshot() {
 }
 
 var root = document.documentElement;
 var observer = new MutationObserver(root_wait);
 
 observer.observe(root, {attributes: true});
 
 if (document.readyState != "complete") {
-    onload = root_wait;
+    addEventListener('load', root_wait);
 } else {
     root_wait();
 }