-
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
Run ShadowRealm tests in multiple scopes #49108
base: master
Are you sure you want to change the base?
Run ShadowRealm tests in multiple scopes #49108
Commits on Nov 15, 2024
-
Change 'shadowrealm' global into a shorthand for all possible ShadowR…
…ealm scopes In order to automatically run tests not only in a ShadowRealm created in a window scope, but also in ShadowRealms created in other realms, change the 'shadowrealm' global type to a collection, and rename the existing ShadowRealm handler to 'shadowrealm-in-window'.
Configuration menu - View commit details
-
Copy full SHA for 4af0823 - Browse repository at this point
Copy the full SHA 4af0823View commit details -
Remove monkeypatch of globalThis.self in ShadowRealm
As per whatwg/html#9893, ShadowRealmGlobalScope should have a `self` attribute already. There is no need to monkeypatch it for the test harness.
Configuration menu - View commit details
-
Copy full SHA for fed4c3d - Browse repository at this point
Copy the full SHA fed4c3dView commit details
Commits on Nov 16, 2024
-
Factor out JS code that will be common to multiple ShadowRealm handlers
We will add multiple ShadowRealm handlers, and they will all need to set up certain global properties. Avoid repeating this code in each handler as well as in idlharness-shadowrealm.js. This should also increase readability, which is good since the ShadowRealm setup code can be confusing.
Configuration menu - View commit details
-
Copy full SHA for ccc1f37 - Browse repository at this point
Copy the full SHA ccc1f37View commit details -
Add 'shadowrealm-in-shadowrealm' global
This will add to any test with global=shadowrealm in its metadata, an .any.shadowrealm-in-shadowrealm.html variant. The test wrapper creates an outer ShadowRealm, which creates an inner ShadowRealm and runs the tests inside that, relaying the results through the outer ShadowRealm.
Configuration menu - View commit details
-
Copy full SHA for 6e1b73f - Browse repository at this point
Copy the full SHA 6e1b73fView commit details -
Add 'shadowrealm-in-dedicatedworker' global
This will add to any test with global=shadowrealm in its metadata, an .any.shadowrealm-in-dedicatedworker.html variant. The test loads an intermediate .any.worker-shadowrealm.js wrapper into a Worker, and forwards the message port to the Worker's message port so that fetch_tests_from_worker can receive the results.
Configuration menu - View commit details
-
Copy full SHA for e1d2e58 - Browse repository at this point
Copy the full SHA e1d2e58View commit details -
Add 'shadowrealm-in-sharedworker' global
This will add to any test with global=shadowrealm in its metadata, an .any.shadowrealm-in-sharedworker.html variant. The test loads the same intermediate .any.worker-shadowrealm.js wrapper as .any.shadowrealm-in-dedicatedworker.html, but populates a 'port' variable with the port received from the connect event, instead of calling the global postMessage since that won't work in a SharedWorker.
Configuration menu - View commit details
-
Copy full SHA for af7049f - Browse repository at this point
Copy the full SHA af7049fView commit details -
Add 'shadowrealm-in-serviceworker' global
This will add to any test with global=shadowrealm in its metadata, an .any.shadowrealm-in-serviceworker.html variant. We have to use a slightly different .any.serviceworker-shadowrealm.js wrapper from the wrapper used for the other types of workers, because dynamic import() is forbidden in ServiceWorker scopes. Instead, add a utility function to set up a fakeDynamicImport() function inside the ShadowRealm which uses the fetch adaptor to get the module's source text and evaluate it in the shadowRealm. Also add a case for ServiceWorkers to getPostMessageFunc(), which returns a postMessage() drop-in replacement that broadcasts the message to all clients, since test result messages from the ShadowRealm are not in response to any particular message received by the ServiceWorker. Note '.https.' needs to be added to the test path.
Configuration menu - View commit details
-
Copy full SHA for 61e85fe - Browse repository at this point
Copy the full SHA 61e85feView commit details -
Add 'shadowrealm-in-audioworklet' global
This will add to any test with global=shadowrealm in its metadata, an .any.shadowrealm-in-audioworklet.html variant. The wrapper here is similar to the one for ServiceWorkers, since dynamic import() is also forbidden in worklet scopes. But additionally fetch() is not exposed, so we add a utility function to set up the ability to call the window realm's fetch() through the AudioWorklet's message port. We also add /resources/testharness-shadowrealm-audioworkletprocessor.js to contain most of the AudioWorklet setup boilerplate, so that it isn't written inline in serve.py. Note '.https.' needs to be added to the test path.
Configuration menu - View commit details
-
Copy full SHA for 75d32cb - Browse repository at this point
Copy the full SHA 75d32cbView commit details