-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Expand file tree
/
Copy pathDedicatedWorker-eval.html
More file actions
30 lines (26 loc) · 1.05 KB
/
DedicatedWorker-eval.html
File metadata and controls
30 lines (26 loc) · 1.05 KB
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>
<html>
<head>
<meta http-equiv="Content-Security-Policy" content="require-trusted-types-for 'script';">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<div id=log></div>
<script>
// To test workers, we need to importScripts source files in the workers.
// We need to set up one policy that will blindly pass through URLs for use in the test
// setup, and then have additional policies for the actual test cases.
//
// For the same reason we cannot use the otherwise preferred 'META: workers'
// tag
// (https://web-platform-tests.org/writing-tests/testharness.html#tests-for-other-or-multiple-globals-any-js),
// since that test setup would be blocked as soon as trusted types enforcement
// is enabled.
const test_setup_policy = trustedTypes.createPolicy("hurrayanythinggoes", {
createScriptURL: x => x});
const test_url =
test_setup_policy.createScriptURL("support/WorkerGlobalScope-eval.https.js");
fetch_tests_from_worker(new Worker(test_url));
</script>
</body>