Bug 966843 - Fix intermittent browser_615394-SSWindowState_events.js hangs. r=smacleod, a=test-only
authorTim Taubert <ttaubert@mozilla.com>
Mon, 14 Apr 2014 12:03:18 +0200
changeset 192834 12472b9de0c95284acaad677f00dba87a5574197
parent 192833 c235b719cb9e03ee2625c2fce31fa56ce6d4bc28
child 192835 6a560d42e9bf77271520fde4324368472caf91ff
push id474
push userasasaki@mozilla.com
push dateMon, 02 Jun 2014 21:01:02 +0000
treeherdermozilla-release@967f4cf1b31c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmacleod, test-only
bugs966843
milestone30.0a2
Bug 966843 - Fix intermittent browser_615394-SSWindowState_events.js hangs. r=smacleod, a=test-only
browser/components/sessionstore/test/browser_615394-SSWindowState_events.js
--- a/browser/components/sessionstore/test/browser_615394-SSWindowState_events.js
+++ b/browser/components/sessionstore/test/browser_615394-SSWindowState_events.js
@@ -1,13 +1,13 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-const stateBackup = ss.getBrowserState();
+const stateBackup = JSON.parse(ss.getBrowserState());
 const testState = {
   windows: [{
     tabs: [
       { entries: [{ url: "about:blank" }] },
       { entries: [{ url: "about:rights" }] }
     ]
   }]
 };
@@ -71,18 +71,17 @@ function runNextTest() {
     // If we closed a window, give it time to close
     executeSoon(function() {
       let currentTest = tests.shift();
       info("prepping for " + currentTest.name);
       waitForBrowserState(testState, currentTest);
     });
   }
   else {
-    ss.setBrowserState(stateBackup);
-    finish();
+    waitForBrowserState(stateBackup, finish);
   }
 }
 
 /**  ACTUAL TESTS  **/
 
 function test_setTabState() {
   let tab = gBrowser.tabs[1];
   let newTabState = JSON.stringify({ entries: [{ url: "http://example.org" }], extData: { foo: "bar" } });