Bug 1465670 P4 Fix test_importscript.html to expect spec behavior. r=asuth
authorBen Kelly <ben@wanderview.com>
Tue, 05 Jun 2018 10:49:12 -0700
changeset 421454 d9792e276611182498810e1f60d4c6534688f266
parent 421453 8c55a618ddef81d1de47be8ac965578250e21f85
child 421455 14c1d777809bbb05619aba08f76bb38b0f430350
push id34093
push useraiakab@mozilla.com
push dateTue, 05 Jun 2018 21:58:58 +0000
treeherdermozilla-central@da28b92efe6f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersasuth
bugs1465670
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1465670 P4 Fix test_importscript.html to expect spec behavior. r=asuth
dom/serviceworkers/test/importscript_worker.js
--- a/dom/serviceworkers/test/importscript_worker.js
+++ b/dom/serviceworkers/test/importscript_worker.js
@@ -22,16 +22,25 @@ onmessage = function(e) {
       dump("ERROR: no clients are currently controlled.\n");
     }
 
     if (!missingScriptFailed) {
       res[0].postMessage("KO");
     }
 
     try {
-      importScripts(['importscript.sjs']);
+      // new unique script should fail
+      importScripts(['importscript.sjs?unique=true']);
       res[0].postMessage("KO");
       return;
     } catch(e) {}
 
-    res[0].postMessage(counter == 2 ? "OK" : "KO");
+    try {
+      // duplicate script previously offlined should succeed
+      importScripts(['importscript.sjs']);
+    } catch(e) {
+      res[0].postMessage("KO");
+      return;
+    }
+
+    res[0].postMessage(counter == 3 ? "OK" : "KO");
   });
 };