Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /workers/name-property.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="utf-8">
<title>Test the name property of shared and dedicated workers via the name constructor option</title>
<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-dedicatedworkerglobalscope-name">
<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
"use strict";
setup({explicit_done: true});
(async function() {
const worker = new Worker("support/name.js", { name: "my name" });
await fetch_tests_from_worker(worker);
const worker2 = new Worker("support/name-as-accidental-global.js");
await fetch_tests_from_worker(worker2);
const sharedWorker = new SharedWorker("support/name.js", { name: "my name" });
await fetch_tests_from_worker(sharedWorker);
const sharedWorker2 = new SharedWorker("support/name-as-accidental-global.js");
await fetch_tests_from_worker(sharedWorker2);
done();
})();
</script>