Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /service-workers/service-worker/shadowrealm-promise-rejection.https.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="resources/test-helpers.sub.js"></script>
<body>
<script>
const worker = 'resources/shadowrealm-promise-rejection-test-worker.js';
promise_test(async (t) => {
assert_not_equals(
self.ShadowRealm, undefined,
'ShadowRealm should be defined.');
const scope = 'resources/';
const reg = await service_worker_unregister_and_register(t, worker, scope);
await wait_for_state(t, reg.installing, 'activated');
await reg.unregister();
}, 'Promise rejections within worker thread ShadowRealms are handled');
</script>
</body>
</html>