tor-browser

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

browser_referrer_open_link_in_private.js (1178B)


      1 // Tests referrer on context menu navigation - open link in new private window.
      2 // Selects "open link in new private window" from the context menu.
      3 
      4 // The test runs from a regular browsing window.
      5 // Output: we have no referrer.
      6 
      7 getReferrerTest = getRemovedReferrerTest;
      8 
      9 function startNewPrivateWindowTestCase(aTestNumber) {
     10  info(
     11    "browser_referrer_open_link_in_private: " +
     12      getReferrerTestDescription(aTestNumber)
     13  );
     14  contextMenuOpened(gTestWindow, "testlink").then(function (aContextMenu) {
     15    newWindowOpened().then(function (aNewWindow) {
     16      BrowserTestUtils.firstBrowserLoaded(aNewWindow, false).then(function () {
     17        checkReferrerAndStartNextTest(
     18          aTestNumber,
     19          aNewWindow,
     20          null,
     21          startNewPrivateWindowTestCase
     22        );
     23      });
     24    });
     25 
     26    doContextMenuCommand(gTestWindow, aContextMenu, "context-openlinkprivate");
     27  });
     28 }
     29 
     30 function test() {
     31  waitForExplicitFinish();
     32 
     33  SpecialPowers.pushPrefEnv(
     34    { set: [["test.wait300msAfterTabSwitch", true]] },
     35    function () {
     36      requestLongerTimeout(10); // slowwww shutdown on e10s
     37      startReferrerTest(startNewPrivateWindowTestCase);
     38    }
     39  );
     40 }