41 let ss =
Cc[
"@mozilla.org/browser/sessionstore;1"].getService(
Ci.nsISessionStore);
46 let max_tabs_undo =
gPrefService.getIntPref(
"browser.sessionstore.max_tabs_undo");
47 gPrefService.setIntPref(
"browser.sessionstore.max_tabs_undo", max_tabs_undo + 1);
48 let closedTabCount = ss.getClosedTabCount(
window);
51 let
tab = tabbrowser.addTab(
"about:");
52 tab.linkedBrowser.addEventListener(
"load",
function(aEvent) {
55 let
browser = tabbrowser.getBrowserForTab(tab);
56 let
history = browser.webNavigation.sessionHistory;
57 ok(history.count >= 1,
"the new tab does have at least one history entry");
59 ss.setTabState(tab,
"{ entries: [] }");
60 tab.linkedBrowser.addEventListener(
"load",
function(aEvent) {
61 ok(history.count == 0,
"the tab was restored without any history whatsoever");
63 tabbrowser.removeTab(tab);
64 ok(ss.getClosedTabCount(
window) == closedTabCount,
65 "The closed blank tab wasn't added to Recently Closed Tabs");
68 if (
gPrefService.prefHasUserValue(
"browser.sessionstore.max_tabs_undo"))
69 gPrefService.clearUserPref(
"browser.sessionstore.max_tabs_undo");
return!aWindow arguments!aWindow arguments[0]
this removeEventListener("load", this.__SS_restore, true)