test_sanityRegisteredServiceWorker2.html (721B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>Test that service worker registrations not cleaned up in mochitests cause failures</title> 5 <script src="/tests/SimpleTest/SimpleTest.js"></script> 6 </head> 7 <body> 8 <script> 9 SimpleTest.waitForExplicitFinish(); 10 SpecialPowers.pushPrefEnv({"set": [ 11 ["dom.serviceWorkers.exemptFromPerDomainMax", true], 12 ["dom.serviceWorkers.enabled", true], 13 ["dom.serviceWorkers.testing.enabled", true] 14 ]}, function() { 15 navigator.serviceWorker.getRegistration("scope") 16 .then(function(registration) { 17 ok(registration, "Registration successfully obtained"); 18 return registration.unregister(); 19 }).then(function() { 20 SimpleTest.finish(); 21 }); 22 }); 23 </script> 24 </body> 25 </html>