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 183762 7938ad1529f9
parent 183757 3437e5663d9e
child 183763 a27d9f49afac
push id3476
push userryanvm@gmail.com
push date2014-04-15 17:26 +0000
Treeherderresults
reviewerssmacleod, test-only
bugs966843
milestone29.0
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" } });