Bug 1186833 - register-same-scope-different-script-url.https.html fixes. r=bkelly
authorNikhil Marathe <nsm.nikhil@gmail.com>
Tue, 08 Sep 2015 12:56:40 -0700
changeset 295314 5b5a5360cc2924cbdf0e16c610d61efc764361f1
parent 295313 91103a26f5e462959d5135022676c2dba976b7ba
child 295315 3da17eef27503f8a48a0ff14fe591ae99f4849ae
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbkelly
bugs1186833
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 1186833 - register-same-scope-different-script-url.https.html fixes. r=bkelly Update web-platform-tests expected data
testing/web-platform/mozilla/meta/service-workers/service-worker/register-same-scope-different-script-url.https.html.ini
testing/web-platform/mozilla/tests/service-workers/service-worker/register-same-scope-different-script-url.https.html
deleted file mode 100644
--- a/testing/web-platform/mozilla/meta/service-workers/service-worker/register-same-scope-different-script-url.https.html.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[register-same-scope-different-script-url.https.html]
-  type: testharness
-  expected: TIMEOUT
-  [Register then register new script URL]
-    expected: TIMEOUT
-
--- a/testing/web-platform/mozilla/tests/service-workers/service-worker/register-same-scope-different-script-url.https.html
+++ b/testing/web-platform/mozilla/tests/service-workers/service-worker/register-same-scope-different-script-url.https.html
@@ -79,20 +79,27 @@ async_test(function(t) {
           assert_equals(registration.active.scriptURL, script1,
                         'on second register, the first script should be ' +
                         'active');
           return wait_for_state(t, registration.installing, 'installed');
         })
       .then(function() {
           assert_equals(registration.installing, null,
                         'on installed, installing should be null');
-          assert_equals(registration.waiting.scriptURL, script2,
-                        'on installed, the second script should be waiting');
-          assert_equals(registration.active.scriptURL, script1,
-                        'on installed, the first script should be active');
+          // Since the registration is not controlling any document, the new
+          // worker can immediately transition to active.
+          if (registration.waiting) {
+            assert_equals(registration.waiting.scriptURL, script2,
+                          'on installed, the second script may still be waiting');
+            assert_equals(registration.active.scriptURL, script1,
+                          'on installed, the first script may be active');
+          } else {
+            assert_equals(registration.active.scriptURL, script2,
+                          'on installed, the second script may be active');
+          }
           return registration.unregister();
         })
       .then(function() {
           t.done();
         })
       .catch(unreached_rejection(t));
   }, 'Register then register new script URL');