From 4b29f468f18120a384ec67858c4a79a889246375 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Philip=20J=C3=A4genstedt?= Date: Thu, 22 Dec 2022 10:10:35 +0000 Subject: [PATCH] Bug 1806808 [wpt PR 37624] - Revert "WPT: Allow `window.onload` to contain multiple `test()`s", a=testonly MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Automatic update from web-platform-tests Revert "WPT: Allow `window.onload` to contain multiple `test()`s" This reverts commit 4a03c6c459fdbf11976a424aa02a1d094484134c. Reason for revert: This has caused tests in upstream WPT to fail, blocking unrelated PRs. It was still possible to upstream this because those tests weren't triggered on the change due to a bug: https://github.com/web-platform-tests/wpt/issues/37623 There was an attempted fix for this: https://github.com/web-platform-tests/wpt/pull/37549 But, quoting jgraham from the WPT Matrix chat: > the actual fix failed a test I wrote and now I need to spend some more time investigating Original change's description: > WPT: Allow `window.onload` to contain multiple `test()`s > > ****************************************************************** > *** SHERIFFS: please don't revert this CL if it causes web_tests > to flake/fail. If that happens, the cause is a bad > test. Please mark that test as flaky/fail in > TestExpectations, with a new crbug. Please block the > new bug against crbug.com/1395228. Thanks! > ****************************************************************** > > Prior to this CL, a test like this: > > ``` > > ``` > > would not run anything after test #1. The issue is that the testharness > immediately adds a window load handler that marks `all_loaded = true`, > and that ends the tests as soon as the first result from the first test > is processed. (The test runner waits for the first test because > `Tests.prototype.all_done()` also waits until `this.tests.length > 0`.) > There were various mitigating corner cases, such as if you started > the list of tests with a promise_test(), that would increment a > counter that kept the rest of the tests alive. Etc. > > With this CL, the testharness-added window.onload handler runs a > setTimeout(0), so that `all_loaded` is only set to true after all of > the tests are loaded by any window.onload handler. > > This exposed a few tests that should have been failing but were > masked by the lack of test coverage - bugs have been filed for > those. Also, several tests that were working around this via various > means are also cleaned up in this CL. I'm sure there are more of > those. > > Bug: 1395228,1395226,1307772 > Change-Id: I6f12b5922186af4e1e06808ad23b47ceac68559c > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4074305 > Reviewed-by: Weizhong Xia > Auto-Submit: Mason Freed > Reviewed-by: Mason Freed > Commit-Queue: Mason Freed > Reviewed-by: Xianzhu Wang > Cr-Commit-Position: refs/heads/main@{#1081558} Bug: 1395228,1395226,1307772 Change-Id: Icbddad3a8bb47473bcbc331f424661b9041addf2 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4111318 Reviewed-by: David Baron Commit-Queue: Philip Jägenstedt Cr-Commit-Position: refs/heads/main@{#1085925} -- wpt-commits: 5c571b86bc98819157b584132bca1b80ca4503cb wpt-pr: 37624 --- ...ne-style-allowed-while-cloning-objects.sub.html | 281 +++++++++++---------- .../tests/css/cssom-view/negativeMargins.html | 2 + ...otype-setting-goes-cross-origin-domain.sub.html | 4 + .../web-platform/tests/infrastructure/README.md | 2 +- .../expected-fail/window-onload-test.html | 28 -- .../web-platform/tests/resources/testharness.js | 5 - 6 files changed, 153 insertions(+), 169 deletions(-) rewrite testing/web-platform/tests/content-security-policy/style-src/inline-style-allowed-while-cloning-objects.sub.html (76%) delete mode 100644 testing/web-platform/tests/infrastructure/expected-fail/window-onload-test.html diff --git a/testing/web-platform/tests/content-security-policy/style-src/inline-style-allowed-while-cloning-objects.sub.html b/testing/web-platform/tests/content-security-policy/style-src/inline-style-allowed-while-cloning-objects.sub.html dissimilarity index 76% index f702e6eb9d65..e99699410e00 100644 --- a/testing/web-platform/tests/content-security-policy/style-src/inline-style-allowed-while-cloning-objects.sub.html +++ b/testing/web-platform/tests/content-security-policy/style-src/inline-style-allowed-while-cloning-objects.sub.html @@ -1,135 +1,146 @@ - - - - - - - inline-style-allowed-while-cloning-objects - - - - - - -

- This test ensures that styles can be set by object.cloneNode() -

-
- This is a div (nodes) -
This is a div. (node 1 or 2)
-
This is a div. (node 3 or 4)
-
-
- Yet another div. -
-
- Yet another div. -
- -
- - - + + + + + + + inline-style-allowed-while-cloning-objects + + + + + + +

+ This test ensures that styles can be set by object.cloneNode() +

+
+ This is a div (nodes) +
This is a div. (node 1 or 2)
+
This is a div. (node 3 or 4)
+
+
+ Yet another div. +
+
+ Yet another div. +
+ +
+ + + diff --git a/testing/web-platform/tests/css/cssom-view/negativeMargins.html b/testing/web-platform/tests/css/cssom-view/negativeMargins.html index 0deb7ca623e9..0616e8b4999e 100644 --- a/testing/web-platform/tests/css/cssom-view/negativeMargins.html +++ b/testing/web-platform/tests/css/cssom-view/negativeMargins.html @@ -9,6 +9,7 @@ Hello diff --git a/testing/web-platform/tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-goes-cross-origin-domain.sub.html b/testing/web-platform/tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-goes-cross-origin-domain.sub.html index c2a6def6c240..239fa6ddf2fc 100644 --- a/testing/web-platform/tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-goes-cross-origin-domain.sub.html +++ b/testing/web-platform/tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-goes-cross-origin-domain.sub.html @@ -12,6 +12,8 @@ diff --git a/testing/web-platform/tests/infrastructure/README.md b/testing/web-platform/tests/infrastructure/README.md index 35f423887832..82138a300b84 100644 --- a/testing/web-platform/tests/infrastructure/README.md +++ b/testing/web-platform/tests/infrastructure/README.md @@ -2,7 +2,7 @@ This directory contains a number of tests to ensure test running infrastructure is operating correctly: * The tests in assumptions/ are designed to test UA assumptions - documented in [assumptions.md](/docs/writing-tests/assumptions.md). + documented in [assumptions.md](/docs/_writing-tests/assumptions.md). * The tests in server/ are designed to test the WPT server configuration diff --git a/testing/web-platform/tests/infrastructure/expected-fail/window-onload-test.html b/testing/web-platform/tests/infrastructure/expected-fail/window-onload-test.html deleted file mode 100644 index b0514bce045a..000000000000 --- a/testing/web-platform/tests/infrastructure/expected-fail/window-onload-test.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - diff --git a/testing/web-platform/tests/resources/testharness.js b/testing/web-platform/tests/resources/testharness.js index b7cf79c76b97..55aaa582c53e 100644 --- a/testing/web-platform/tests/resources/testharness.js +++ b/testing/web-platform/tests/resources/testharness.js @@ -91,12 +91,7 @@ } on_event(window, 'load', function() { - setTimeout(() => { this_obj.all_loaded = true; - if (tests.all_done()) { - tests.complete(); - } - },0); }); on_event(window, 'message', function(event) { -- 2.11.4.GIT