Bug 919060 - Make browser_625016.js wait for another saveState() call if the window is untracked r=smacleod

From 76e6452a6b370fdce5147e9d467e28e8e8350b50 Mon Sep 17 00:00:00 2001
This commit is contained in:
Tim Taubert 2013-11-21 17:16:13 +01:00
parent a23ca26511
commit 370cc94987

View File

@ -40,17 +40,21 @@ function setup() {
} }
function onSaveState() { function onSaveState() {
try {
ss.getWindowValue(newWin, "foobar");
} catch (e) {
// The window is untracked which means that the saveState() call isn't the
// one we're waiting for. It's most likely been triggered by an async
// collection running in the background.
waitForSaveState(onSaveState);
return;
}
// Double check that we have no closed windows // Double check that we have no closed windows
is(ss.getClosedWindowCount(), 0, "no closed windows on first save"); is(ss.getClosedWindowCount(), 0, "no closed windows on first save");
Services.obs.addObserver(observe1, "sessionstore-state-write", false); Services.obs.addObserver(observe1, "sessionstore-state-write", false);
try {
ss.getWindowValue(newWin, "foobar");
} catch (e) {
ok(false, "window is untracked!");
}
// Now close the new window, which should trigger another save event // Now close the new window, which should trigger another save event
newWin.close(); newWin.close();
} }