summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/workers/name-property.html
blob: ccc2a9de3a9c59acc19eefb247b1c92b78a52941 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<!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/#concept-workerglobalscope-name">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-sharedworkerglobalscope-name">
<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>