41 let ss =
Cc[
"@mozilla.org/browser/sessionstore;1"].
43 let
os =
Cc[
"@mozilla.org/observer-service;1"].
45 let
ww =
Cc[
"@mozilla.org/embedcomp/window-watcher;1"].
50 function testWithState(
aState) {
52 let curClosedWindowCount = ss.getClosedWindowCount();
53 gPrefService.setIntPref(
"browser.sessionstore.max_windows_undo",
54 curClosedWindowCount + 1);
58 let theWin = aSubject.QueryInterface(
Ci.nsIDOMWindow);
61 case "domwindowopened":
62 theWin.addEventListener(
"load",
function () {
63 theWin.removeEventListener(
"load",
arguments.callee,
false);
64 executeSoon(
function() {
67 if (
aState.windowState.windows[0].tabs[0].entries.length) {
68 theWin.gBrowser.addEventListener(
"load",
function() {
69 theWin.gBrowser.removeEventListener(
"load",
74 executeSoon(
function() {
78 ss.setWindowState(theWin,
JSON.stringify(
aState.windowState),
84 case "domwindowclosed":
85 ww.unregisterNotification(
this);
87 executeSoon(
function() {
88 is(ss.getClosedWindowCount(),
89 curClosedWindowCount + (
aState.shouldBeAdded ? 1 : 0),
90 "That window should " + (
aState.shouldBeAdded ?
"" :
"not ") +
102 "chrome,all,dialog=no",
113 tabs: [{ entries: [{
url:
"http://example.com", title:
"example.com" }] }],
120 shouldBeAdded:
false,
123 tabs: [{ entries: [] }],
129 shouldBeAdded:
false,
132 tabs: [{ entries: [] }],
133 _closedTabs: [{ state: { entries: [{
url:
"http://example.com", index: 1 }] } }]
138 shouldBeAdded:
false,
141 tabs: [{ entries: [] }],
143 extData: { keyname:
"pi != " + Math.random() }
151 let state = states.shift();
152 testWithState(state);
155 if (
gPrefService.prefHasUserValue(
"browser.sessionstore.max_windows_undo"))
156 gPrefService.clearUserPref(
"browser.sessionstore.max_windows_undo");
getService(Ci.sbIFaceplateManager)
return!aWindow arguments!aWindow arguments[0]
_updateTextAndScrollDataForFrame aData
sbDeviceFirmwareAutoCheckForUpdate prototype observe