summaryrefslogtreecommitdiffstats
path: root/testing/mochitest/tests/Harness_sanity/test_sanityRegisteredServiceWorker.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/mochitest/tests/Harness_sanity/test_sanityRegisteredServiceWorker.html')
-rw-r--r--testing/mochitest/tests/Harness_sanity/test_sanityRegisteredServiceWorker.html24
1 files changed, 24 insertions, 0 deletions
diff --git a/testing/mochitest/tests/Harness_sanity/test_sanityRegisteredServiceWorker.html b/testing/mochitest/tests/Harness_sanity/test_sanityRegisteredServiceWorker.html
new file mode 100644
index 0000000000..f3c6d422d9
--- /dev/null
+++ b/testing/mochitest/tests/Harness_sanity/test_sanityRegisteredServiceWorker.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Test that service worker registrations not cleaned up in mochitests cause failures</title>
+ <script src="/tests/SimpleTest/SimpleTest.js"></script>
+</head>
+<body>
+<script>
+SimpleTest.waitForExplicitFinish();
+SimpleTest.expectRegisteredServiceWorker();
+SpecialPowers.pushPrefEnv({"set": [
+ ["dom.serviceWorkers.exemptFromPerDomainMax", true],
+ ["dom.serviceWorkers.enabled", true],
+ ["dom.serviceWorkers.testing.enabled", true]
+]}, function() {
+ navigator.serviceWorker.register("empty.js", {scope: "scope"})
+ .then(function(registration) {
+ ok(registration, "Registration succeeded");
+ SimpleTest.finish();
+ });
+});
+</script>
+</body>
+</html>