close_script_defer.html: callback = t.step(...) runs assert_unreached at once, so the test fails in every browser
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 88/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- html, javascript
Research direction
Read html/browsers/the-window-object/open-close/close_script_defer.html and check how it assigns the callback used by callback.js. The issue identifies the failing call and gives the suggested fix; inspect the test setup, then run this test in a browser. Done when it passes and fails only if the deferred callback runs after the window closes.
Written by the indexing model from the issue text.
Description
html/browsers/the-window-object/open-close/close_script_defer.html ends with
callback = t.step(function() {assert_unreached()})
t.step(f) calls f at once; it is not t.step_func. So assert_unreached() runs while the test is being set up and fails the test before w.close() is reached, and callback is left undefined. The callback is meant for callback.js (opener.callback()), the deferred script the test writes into the opened window. That script should never run, because the window is closed first.
Every engine fails the same way, with assert_unreached: Reached unreachable code, 0/1. That holds in all six wpt.fyi runs aligned at 71b58bb191. Stable: Chrome 158.0.8127.36 (run 5091530419994624), Firefox 160.0.1 (5102456061820928), Safari 27.2 (5121161130934272). Experimental: Chrome 160.0.8168.0 (5165587534446592), Firefox 162.0a1 (5188734707040256), Safari Technology Preview 256 (5096019650674688).
The file's last change was the folder rename 54f157400e (2022-04-12).
Suggested fix
callback = t.step_func(function() { assert_unreached(); });
With this change the test fails only if callback.js runs after window.close().
- Dominant language
- HTML
- Stars
- 6.3k
- Forks
- 4.1k
- Avg merge
- 17h 20m
- Merged PRs (30d)
- 841
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from web-platform-tests/wpt
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
web-platform-tests/wpt#65844 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
web-platform-tests/wpt#65836 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
web-platform-tests/wpt#65831 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
web-platform-tests/wpt#65826 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
web-platform-tests/wpt#65823 ·
Maintainers usually reply within 1 day
All issues in web-platform-tests/wpt
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
enhancement good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
agent/scanner bug stage/010-actionable
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
torch-spyre/spyre-inference#1849 ·
Maintainers usually reply within 2 days
-
tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day