From 4c9e7f769a412e5a6fb71afaf97806ceef9ea55a Mon Sep 17 00:00:00 2001 From: Nikhil Marathe Date: Fri, 21 Aug 2015 17:55:50 -0700 Subject: [PATCH] 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 --HG-- extra : commitid : EnJ0U5Ns3cn extra : rebase_source : 17b002ca8e1d2e166c8b09cf01f6e8b2fd98d152 --- .../onactivate-script-error.https.html.ini | 15 --------------- .../onactivate-script-error.https.html | 6 ++++++ 2 files changed, 6 insertions(+), 15 deletions(-) diff --git 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 index 7b7485346755..c2276a3196ea 100644 --- 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 - diff --git 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 index 8bba79756eec..23a7f2c86868 100644 --- 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 @@ -37,6 +37,12 @@ function make_test(name, script) { }) .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);