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
Consider adding a way to pass a global to assert_throws_dom #21809
Comments
One issue with adding the trailing argument is that callers who are not passing a description right now would have to start passing one (e.g. undefined to keep the current behavior). That said, I suspect most users of assert_throws_dom do not need to pass a non-default global, so this may still be the right tradeoff. |
OK, looks like options 2 and 3 do not work, because at least some tests test that an exception is thrown in a navigated-away-from window. And in that case passing in a global is no good, because the WindowProxy will now point to the new Window. So it seems like we really do need to pass in the relevant DOMException constructor somehow. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Then we can verify that the DOMExceptions come from the right global. Fixes web-platform-tests#21809
Then we can verify that the DOMExceptions come from the right global. Fixes web-platform-tests#21809
Then we can verify that the DOMExceptions come from the right global. Fixes web-platform-tests#21809
Then we can verify that the DOMExceptions come from the right global. Fixes web-platform-tests#21809
Then we can verify that the DOMExceptions come from the right global. Fixes web-platform-tests#21809
Then we can verify that the DOMExceptions come from the right global. Fixes #21809
…and promise_rejects_dom., a=testonly Automatic update from web-platform-tests Pass a constructor to assert_throws_dom and promise_rejects_dom. Then we can verify that the DOMExceptions come from the right global. Fixes web-platform-tests/wpt#21809 -- wpt-commits: 4ba5bc3847bc88a7a2598841933b89ae4b611bcf wpt-pr: 21876
…and promise_rejects_dom., a=testonly Automatic update from web-platform-tests Pass a constructor to assert_throws_dom and promise_rejects_dom. Then we can verify that the DOMExceptions come from the right global. Fixes web-platform-tests/wpt#21809 -- wpt-commits: 4ba5bc3847bc88a7a2598841933b89ae4b611bcf wpt-pr: 21876 UltraBlame original commit: b592d6685296f964170caec2f0758e23439df005
…and promise_rejects_dom., a=testonly Automatic update from web-platform-tests Pass a constructor to assert_throws_dom and promise_rejects_dom. Then we can verify that the DOMExceptions come from the right global. Fixes web-platform-tests/wpt#21809 -- wpt-commits: 4ba5bc3847bc88a7a2598841933b89ae4b611bcf wpt-pr: 21876
Now that we have the JS and DOM cases clearly separated, it's worth thinking about ways to test that exceptions come from the right global in the DOM case. Possible options:
new DOMException("", name)
instead of just the name string. The code could then compare the.constructor
on the two things. The drawback is that silly message arg, and the general length.self
. The compare.constructor
toglobal.DOMException
.Other options? Preferences?
The text was updated successfully, but these errors were encountered: