Skip to content
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

testharness.js: fix shadow realm detection #33668

Merged

Conversation

lucacasonato
Copy link
Member

@lucacasonato lucacasonato commented Apr 18, 2022

This commit fixes shadow realm detection to not falsely discover the
Deno main thread as a shadow realm. Because there is no reliable way to
discover shadow realms in isolation, we add a a special global to inform
testharness.js that it is running in a ShadowRealm.

cc @jjgriego @Ms2ger

This commit fixes shadow realm detection to not falsely discover the
Deno main thread as a shadow realm. Because there is no reliable way to
discover shadow realms in isolation, we add a a special global to inform
testharness.js that it is running in a ShadowRealm.
@jjgriego
Copy link
Contributor

Sorry again for the breakage--I had been hoping to avoid adding anything to the global object to signal the test environment is a ShadowRealm but it seems like it's probably the best way after all. Thanks :)

@lucacasonato
Copy link
Member Author

@jjgriego No worries @jjgriego. I can't expect every single person contributing to WPT to know that Deno runs WPT tests and implements AbortController 😅

I was also trying to think of a better way to do the feature detection, but I can't think of anything.

Copy link
Contributor

@Ms2ger Ms2ger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we'll need at least a change to resources/idlharness-shadowrealm.js as well

tools/serve/serve.py Outdated Show resolved Hide resolved
@Ms2ger Ms2ger merged commit ce3cb95 into web-platform-tests:master Apr 19, 2022
lucacasonato added a commit that referenced this pull request Apr 19, 2022
@lucacasonato lucacasonato deleted the deno_shadowrealm_detection branch April 19, 2022 18:53
DanielRyanSmith pushed a commit to DanielRyanSmith/wpt that referenced this pull request Apr 27, 2022
This commit fixes shadow realm detection to not falsely discover the
Deno main thread as a shadow realm. Because there is no reliable way to
discover shadow realms in isolation, we add a a special global to inform
testharness.js that it is running in a ShadowRealm.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants