tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

browser_windowRestore_perwindowpb.js (940B)


      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/. */
      4 
      5 // This test checks that closed private windows can't be restored
      6 
      7 function test() {
      8  waitForExplicitFinish();
      9 
     10  // Purging the list of closed windows
     11  forgetClosedWindows();
     12 
     13  // Load a private window, then close it
     14  // and verify it doesn't get remembered for restoring
     15  whenNewWindowLoaded({ private: true }, function (win) {
     16    info("The private window got loaded");
     17    win.addEventListener(
     18      "SSWindowClosing",
     19      function () {
     20        executeSoon(function () {
     21          is(
     22            ss.getClosedWindowCount(),
     23            0,
     24            "The private window should not have been stored"
     25          );
     26        });
     27      },
     28      { once: true }
     29    );
     30    BrowserTestUtils.closeWindow(win).then(finish);
     31  });
     32 }