Bug 1189661 - either of active or waiting can be valid. r=bkelly
☠☠ backed out by ac055dab935a ☠ ☠
authorNikhil Marathe <nsm.nikhil@gmail.com>
Fri, 21 Aug 2015 14:25:46 -0700
changeset 259092 a9d5366288ffde4ef60d33fc7d0d55c0a965a247
parent 259091 478dd607957309378617041c9dad3ad0f8402e99
child 259093 4d96f2d4807728039747d701d766b67108d96968
push id29268
push userryanvm@gmail.com
push dateTue, 25 Aug 2015 00:37:23 +0000
treeherdermozilla-central@08015770c9d6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbkelly
bugs1189661
milestone43.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 1189661 - either of active or waiting can be valid. r=bkelly
testing/web-platform/mozilla/tests/service-workers/service-worker/waiting.https.html
--- a/testing/web-platform/mozilla/tests/service-workers/service-worker/waiting.https.html
+++ b/testing/web-platform/mozilla/tests/service-workers/service-worker/waiting.https.html
@@ -21,21 +21,24 @@ async_test(function(t) {
       })
     .then(function(r) {
         registration = r;
         return wait_for_state(t, r.installing, 'installed');
       }, unreached_rejection(t, 'Registration should not fail'))
     .then(function() {
         var controller = frame.contentWindow.navigator.serviceWorker.controller;
         assert_equals(controller, null);
-        assert_equals(registration.active, null);
-        assert_equals(registration.waiting.scriptURL, normalizeURL(url));
+        // Nothing in the spec prohibits a worker from going to active
+        // immediately.
+        // Step 26 of the [[Install]] algorithm
+        // "If registration's waiting worker waitingWorker is not null and
+        // waitingWorker's skip waiting flag is not set, invoke Activate
+        // algorithm, or its equivalent, with registration as its argument."
+        var w = registration.waiting || registration.active;
+        assert_equals(w.scriptURL, normalizeURL(url));
         assert_equals(registration.installing, null);
-
-        // FIXME: Add a test for a frame created after installation.
-        // Should the existing frame ("frame") block activation?
       })
     .then(function() {
         frame.remove();
         return service_worker_unregister_and_done(t, scope);
       });
-}, 'waiting is set');
+}, 'waiting or active is set');
 </script>