diff --git a/testing/web-platform/meta/trusted-types/DOMWindowTimers-setTimeout-setInterval.html.ini b/testing/web-platform/meta/trusted-types/DOMWindowTimers-setTimeout-setInterval.html.ini index d674529e032a5..e46ce6b8e8694 100644 --- a/testing/web-platform/meta/trusted-types/DOMWindowTimers-setTimeout-setInterval.html.ini +++ b/testing/web-platform/meta/trusted-types/DOMWindowTimers-setTimeout-setInterval.html.ini @@ -1,6 +1,7 @@ [DOMWindowTimers-setTimeout-setInterval.html] expected: if (os == "mac") and not debug: [OK, TIMEOUT] + TIMEOUT [window.setTimeout assigned via default policy (successful Script transformation).] expected: if (os == "mac") and not debug: [PASS, TIMEOUT] @@ -8,3 +9,15 @@ [window.setInterval assigned via default policy (successful Script transformation).] expected: if (os == "mac") and not debug: [PASS, TIMEOUT] + + [DedicatedWorkerGlobalScope.setTimeout assigned via default policy (successful Script transformation).] + expected: TIMEOUT + + [DedicatedWorkerGlobalScope.setInterval assigned via default policy (successful Script transformation).] + expected: TIMEOUT + + [SharedWorkerGlobalScope.setTimeout assigned via default policy (successful Script transformation).] + expected: TIMEOUT + + [SharedWorkerGlobalScope.setInterval assigned via default policy (successful Script transformation).] + expected: TIMEOUT diff --git a/testing/web-platform/tests/lint.ignore b/testing/web-platform/tests/lint.ignore index 00fb7fd020192..375cb4b18df39 100644 --- a/testing/web-platform/tests/lint.ignore +++ b/testing/web-platform/tests/lint.ignore @@ -283,7 +283,7 @@ SET TIMEOUT: shadow-dom/Document-prototype-currentScript.html SET TIMEOUT: shadow-dom/scroll-to-the-fragment-in-shadow-tree.html SET TIMEOUT: shadow-dom/slotchange-event.html SET TIMEOUT: trusted-types/block-string-assignment-to-DOMWindowTimers-setTimeout-setInterval.html -SET TIMEOUT: trusted-types/DOMWindowTimers-setTimeout-setInterval.html +SET TIMEOUT: trusted-types/support/DOMWindowTimers-setTimeout-setInterval.js SET TIMEOUT: user-timing/* SET TIMEOUT: web-animations/crashtests/reparent-animating-element-002.html SET TIMEOUT: web-animations/timing-model/animations/* diff --git a/testing/web-platform/tests/trusted-types/DOMWindowTimers-setTimeout-setInterval.html b/testing/web-platform/tests/trusted-types/DOMWindowTimers-setTimeout-setInterval.html index 40310771e4d06..3ecaa5234c62d 100644 --- a/testing/web-platform/tests/trusted-types/DOMWindowTimers-setTimeout-setInterval.html +++ b/testing/web-platform/tests/trusted-types/DOMWindowTimers-setTimeout-setInterval.html @@ -1,54 +1,29 @@ - - - - + +
+ + + + + + + - + + fetch_tests_from_worker(new SharedWorker(test_setup_policy.createScriptURL( + "support/DOMWindowTimers-setTimeout-setInterval-worker.js"))); + + + diff --git a/testing/web-platform/tests/trusted-types/support/DOMWindowTimers-setTimeout-setInterval-worker.js b/testing/web-platform/tests/trusted-types/support/DOMWindowTimers-setTimeout-setInterval-worker.js new file mode 100644 index 0000000000000..a31ababde928d --- /dev/null +++ b/testing/web-platform/tests/trusted-types/support/DOMWindowTimers-setTimeout-setInterval-worker.js @@ -0,0 +1,11 @@ +let test_setup_policy = trustedTypes.createPolicy("p", { + createScriptURL: x => x +}); + +importScripts(test_setup_policy.createScriptURL("/resources/testharness.js")); + +importScripts(test_setup_policy.createScriptURL("helper.sub.js")); +importScripts(test_setup_policy.createScriptURL( + "DOMWindowTimers-setTimeout-setInterval.js")); + +done(); diff --git a/testing/web-platform/tests/trusted-types/support/DOMWindowTimers-setTimeout-setInterval-worker.js.headers b/testing/web-platform/tests/trusted-types/support/DOMWindowTimers-setTimeout-setInterval-worker.js.headers new file mode 100644 index 0000000000000..604e765da46d8 --- /dev/null +++ b/testing/web-platform/tests/trusted-types/support/DOMWindowTimers-setTimeout-setInterval-worker.js.headers @@ -0,0 +1 @@ +Content-Security-Policy: require-trusted-types-for 'script'; diff --git a/testing/web-platform/tests/trusted-types/support/DOMWindowTimers-setTimeout-setInterval.js b/testing/web-platform/tests/trusted-types/support/DOMWindowTimers-setTimeout-setInterval.js new file mode 100644 index 0000000000000..7c72dc3e60abd --- /dev/null +++ b/testing/web-platform/tests/trusted-types/support/DOMWindowTimers-setTimeout-setInterval.js @@ -0,0 +1,53 @@ +// `globalThis.toString()` is of the form "[Object