-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WPT: Allow window.onload
to contain multiple test()
s
#37299
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wpt-pr-bot
approved these changes
Dec 2, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The review process for this patch is being conducted in the Chromium project.
chromium-wpt-export-bot
changed the title
Allow
WPT: Allow Dec 2, 2022
window.onload
to contain WPT test()
testswindow.onload
to contain multiple test()
s
chromium-wpt-export-bot
force-pushed
the
chromium-export-cl-4074305
branch
3 times, most recently
from
December 7, 2022 22:52
4971833
to
f886c6a
Compare
WeizhongX
added a commit
that referenced
this pull request
Dec 7, 2022
WeizhongX
added a commit
that referenced
this pull request
Dec 8, 2022
* Add test expectation for window-onload-test.html To unblock #37299
chromium-wpt-export-bot
force-pushed
the
chromium-export-cl-4074305
branch
from
December 9, 2022 17:41
f886c6a
to
318dc9c
Compare
****************************************************************** *** 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: ``` <script> window.onload = () => { test((t) => { ... }, 'test 1'); test((t) => { ... }, 'test 2'); test((t) => { ... }, 'test 3'); }; </script> ``` 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 <weizhong@google.com> Auto-Submit: Mason Freed <masonf@chromium.org> Reviewed-by: Mason Freed <masonf@chromium.org> Commit-Queue: Mason Freed <masonf@chromium.org> Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org> Cr-Commit-Position: refs/heads/main@{#1081558}
chromium-wpt-export-bot
force-pushed
the
chromium-export-cl-4074305
branch
from
December 9, 2022 18:41
318dc9c
to
0564a75
Compare
moz-v2v-gh
pushed a commit
to mozilla/gecko-dev
that referenced
this pull request
Dec 12, 2022
…est.html, a=testonly Automatic update from web-platform-tests Add test expectation for window-onload-test.html (#37390) * Add test expectation for window-onload-test.html To unblock web-platform-tests/wpt#37299 -- wpt-commits: 466c3b35543d6c2d8382eb0fd408d58d88af550c wpt-pr: 37390
BruceDai
pushed a commit
to BruceDai/wpt
that referenced
this pull request
Dec 13, 2022
…37390) * Add test expectation for window-onload-test.html To unblock web-platform-tests#37299
jamienicol
pushed a commit
to jamienicol/gecko
that referenced
this pull request
Dec 14, 2022
…est.html, a=testonly Automatic update from web-platform-tests Add test expectation for window-onload-test.html (#37390) * Add test expectation for window-onload-test.html To unblock web-platform-tests/wpt#37299 -- wpt-commits: 466c3b35543d6c2d8382eb0fd408d58d88af550c wpt-pr: 37390
This was referenced Dec 21, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
*** 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 untilthis.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 ofthe 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 <weizhong@google.com>
Auto-Submit: Mason Freed <masonf@chromium.org>
Reviewed-by: Mason Freed <masonf@chromium.org>
Commit-Queue: Mason Freed <masonf@chromium.org>
Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1081558}