michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: // Tests that an about:blank tab with no history will not be saved into michael@0: // session store and thus, it will not show up in Recently Closed Tabs. michael@0: michael@0: let tab; michael@0: function test() { michael@0: waitForExplicitFinish(); michael@0: michael@0: gPrefService.setIntPref("browser.sessionstore.max_tabs_undo", 0); michael@0: gPrefService.clearUserPref("browser.sessionstore.max_tabs_undo"); michael@0: michael@0: is(ss.getClosedTabCount(window), 0, "should be no closed tabs"); michael@0: michael@0: gBrowser.tabContainer.addEventListener("TabOpen", onTabOpen, true); michael@0: michael@0: tab = gBrowser.addTab(); michael@0: } michael@0: michael@0: function onTabOpen(aEvent) { michael@0: gBrowser.tabContainer.removeEventListener("TabOpen", onTabOpen, true); michael@0: michael@0: // Let other listeners react to the TabOpen event before removing the tab. michael@0: executeSoon(function() { michael@0: is(gBrowser.browsers[1].currentURI.spec, "about:blank", michael@0: "we will be removing an about:blank tab"); michael@0: michael@0: gBrowser.removeTab(tab); michael@0: michael@0: is(ss.getClosedTabCount(window), 0, "should still be no closed tabs"); michael@0: michael@0: executeSoon(finish); michael@0: }); michael@0: }