Bug 1189685 - Part 2: Make synced-state.https.html pass; r=bkelly
authorEhsan Akhgari <ehsan@mozilla.com>
Sun, 25 Oct 2015 19:29:25 -0400
changeset 269537 fb0887080d19cce421e023b958c832d992b3f466
parent 269536 b0e600058af69fa8548d33b619845e7340ae319d
child 269538 bc791a37462f4ac6955f4552f64e9a93e0f1a5ed
push id29584
push userkwierso@gmail.com
push dateMon, 26 Oct 2015 21:33:14 +0000
treeherdermozilla-central@6c7c983bce46 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbkelly
bugs1189685
milestone44.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 1189685 - Part 2: Make synced-state.https.html pass; r=bkelly
testing/web-platform/mozilla/meta/service-workers/service-worker/synced-state.https.html.ini
testing/web-platform/mozilla/tests/service-workers/service-worker/synced-state.https.html
deleted file mode 100644
--- a/testing/web-platform/mozilla/meta/service-workers/service-worker/synced-state.https.html.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[synced-state.https.html]
-  type: testharness
-  expected: ERROR
-  [worker objects for the same entity have the same state]
-    expected: TIMEOUT
-
--- a/testing/web-platform/mozilla/tests/service-workers/service-worker/synced-state.https.html
+++ b/testing/web-platform/mozilla/tests/service-workers/service-worker/synced-state.https.html
@@ -17,20 +17,27 @@ promise_test(function(t) {
               registration.installing.addEventListener('statechange',
                                                        function(e) {
                   step++;
                   if (step == 1) {
                     assert_equals(e.currentTarget.state, 'installed',
                                   'original SW should be installed');
                     assert_equals(registration.installing, null,
                                   'in installed, .installing should be null');
-                    assert_equals(registration.waiting.state, 'installed',
-                                  'in installed, .waiting should be installed');
-                    assert_equals(registration.active, null,
-                                  'in installed, .active should be null');
+                    // The Activate algorithm may have cleared the waiting worker
+                    // by now.
+                    if (registration.waiting) {
+                      assert_equals(registration.waiting.state, 'installed',
+                                    'in installed, .waiting should be installed');
+                      assert_equals(registration.active, null,
+                                    'in installed, .active should be null');
+                    } else {
+                      assert_equals(registration.active.state, 'activating',
+                                    'in installed, .active should be activating');
+                    }
                   } else if (step == 2) {
                     assert_equals(e.currentTarget.state, 'activating',
                                   'original SW should be activating');
                     assert_equals(registration.installing, null,
                                   'in activating, .installing should be null');
                     assert_equals(registration.waiting, null,
                                   'in activating, .waiting should be null');
                     assert_equals(