Bug 1254741 P3 Fix push test_serviceworker_lifetime.html test to expect new behavior. r=kitcambridge
authorBen Kelly <ben@wanderview.com>
Mon, 23 May 2016 02:46:27 -0700
changeset 323021 14e6d851e527c191e7bd03bf4417f86634dc4558
parent 323020 941545c27b85cb589db62500c1352ffd9b79b5d1
child 323022 77c60a79313d1f2733e4b71a223e085f3086476f
push id9671
push userraliiev@mozilla.com
push dateMon, 06 Jun 2016 20:27:52 +0000
treeherdermozilla-aurora@cea65ca3d0bd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskitcambridge
bugs1254741
milestone49.0a1
Bug 1254741 P3 Fix push test_serviceworker_lifetime.html test to expect new behavior. r=kitcambridge
dom/push/test/test_serviceworker_lifetime.html
--- a/dom/push/test/test_serviceworker_lifetime.html
+++ b/dom/push/test/test_serviceworker_lifetime.html
@@ -264,24 +264,29 @@
   }
 
   var test2 = {
     prefs: [
       ["dom.serviceWorkers.idle_timeout", 0],
       ["dom.serviceWorkers.idle_extended_timeout", 2999999]
     ],
     steps: function(ctx) {
-      // Non push workers are terminated when they stop controlling documents.
+      // Older versions used to terminate workers when the last controlled
+      // window was closed.  This should no longer happen, though.  Verify
+      // the new behavior.
       return createIframe(ctx)
         .then(setShutdownObserver(true))
         .then(checkStateAndUpdate(fetchEvent, "from_scope", "wait"))
         .then(closeIframe)
+        .then(setShutdownObserver(true))
+        .then(checkStateAndUpdate(messageEvent, "wait", "release"))
         .then(waitOnShutdownObserver)
 
-      // Push workers are exempt from this rule.
+      // Push workers were exempt from the old rule and should continue to
+      // survive past the closing of the last controlled window.
         .then(createIframe)
         .then(setShutdownObserver(false))
         .then(checkStateAndUpdate(pushEvent, "from_scope", "wait"))
         .then(closeIframe)
         .then(setShutdownObserver(true))
         .then(checkStateAndUpdate(messageEvent, "wait", "release"))
         .then(waitOnShutdownObserver)
     }