summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/content-security-policy/support/service-worker-helper.js
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/content-security-policy/support/service-worker-helper.js')
-rw-r--r--testing/web-platform/tests/content-security-policy/support/service-worker-helper.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/testing/web-platform/tests/content-security-policy/support/service-worker-helper.js b/testing/web-platform/tests/content-security-policy/support/service-worker-helper.js
new file mode 100644
index 0000000000..b5f65c96a0
--- /dev/null
+++ b/testing/web-platform/tests/content-security-policy/support/service-worker-helper.js
@@ -0,0 +1,5 @@
+var url = new URL("../support/ping.js", document.baseURI).toString();
+if (document.getElementById("foo").hasAttribute("blocked-worker"))
+ assert_service_worker_is_blocked(url, document.getElementById("foo").getAttribute("data-desc-fallback"));
+else
+ assert_service_worker_is_loaded(url, document.getElementById("foo").getAttribute("data-desc-fallback")); \ No newline at end of file