browser/components/sessionstore/test/browser_581937.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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

mercurial