Bug 1189678 - check if worker is already active. r=bkelly
☠☠ backed out by ac055dab935a ☠ ☠
authorNikhil Marathe <nsm.nikhil@gmail.com>
Fri, 21 Aug 2015 17:55:50 -0700
changeset 259096 d4fa5cfc4b8634f6b74cc687d2ec8f8b5103727c
parent 259095 a7c27770b861504e13e95d4d58998eb50c634884
child 259097 0a0a47e0545e3206ff9fb2a52b194eb1c20ba523
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
bugs1189678
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 1189678 - check if worker is already active. r=bkelly Similar to other tests, the registration process allows workers to activate right after install. Update web-platform-tests expected data
testing/web-platform/mozilla/meta/service-workers/service-worker/onactivate-script-error.https.html.ini
testing/web-platform/mozilla/tests/service-workers/service-worker/onactivate-script-error.https.html
--- a/testing/web-platform/mozilla/meta/service-workers/service-worker/onactivate-script-error.https.html.ini
+++ b/testing/web-platform/mozilla/meta/service-workers/service-worker/onactivate-script-error.https.html.ini
@@ -1,18 +1,3 @@
 [onactivate-script-error.https.html]
   type: testharness
   expected: ERROR
-  [activate handler throws an error]
-    expected: FAIL
-
-  [activate handler throws an error, error handler does not cancel]
-    expected: FAIL
-
-  [activate handler dispatches an event that throws an error]
-    expected: FAIL
-
-  [activate handler throws an error that is cancelled]
-    expected: FAIL
-
-  [activate handler throws an error and prevents default]
-    expected: FAIL
-
--- a/testing/web-platform/mozilla/tests/service-workers/service-worker/onactivate-script-error.https.html
+++ b/testing/web-platform/mozilla/tests/service-workers/service-worker/onactivate-script-error.https.html
@@ -32,16 +32,22 @@ function make_test(name, script) {
       var registration;
       return service_worker_unregister_and_register(t, script, scope)
         .then(function(r) {
             registration = r;
             return wait_for_install(registration.installing);
           })
         .then(function() {
             // Activate should succeed regardless of script errors.
+            if (registration.active && registration.active.state == 'activated') {
+              return Promise.resolve();
+            } else if (registration.active) {
+              return wait_for_activate(registration.active);
+            }
+
             return wait_for_activate(registration.waiting);
           });
     }, name);
 }
 
 [
   {
     name: 'activate handler throws an error',