42 let ss =
Cc[
"@mozilla.org/browser/sessionstore;1"].
44 let
os =
Cc[
"@mozilla.org/observer-service;1"].
46 let
wm =
Cc[
"@mozilla.org/appshell/window-mediator;1"].
50 function browserWindowsCount() {
52 let e = wm.getEnumerator(
"navigator:browser");
53 while (e.hasMoreElements()) {
54 if (!e.getNext().closed)
61 is(browserWindowsCount(), 1,
"Only one browser window should be open initially");
64 let oldState = ss.getBrowserState();
68 {
tabs: [{ entries: [{
url:
"http://example.com/" }] }], selected: 1 },
69 {
tabs: [{ entries: [{
url:
"about:robots" }] }], selected: 1 },
79 is(aTopic,
"sessionstore-browser-state-restored",
80 "The sessionstore-browser-state-restored notification was observed");
82 if (this.pass++ == 1) {
83 is(browserWindowsCount(), 2,
"Two windows should exist at this point");
86 function pollMostRecentWindow() {
87 if (wm.getMostRecentWindow(
"navigator:browser") ==
window) {
88 ss.setBrowserState(oldState);
90 info(
"waiting for the current window to become active");
95 pollMostRecentWindow();
98 is(browserWindowsCount(), 1,
"Only one window should exist after cleanup");
99 ok(!
window.closed,
"Restoring the old state should have left this window open");
100 os.removeObserver(
this,
"sessionstore-browser-state-restored");
105 os.addObserver(observer,
"sessionstore-browser-state-restored",
false);
108 ss.setBrowserState(
JSON.stringify(testState));
getService(Ci.sbIFaceplateManager)
aWindow setTimeout(function(){_this.restoreHistory(aWindow, aTabs, aTabData, aIdMap);}, 0)
_updateTextAndScrollDataForFrame aData
sbDeviceFirmwareAutoCheckForUpdate prototype observe