tor-browser

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

browser_initial_entry_without_interaction.js (936B)


      1 "use strict";
      2 
      3 const TEST_URI = "https://example.com/";
      4 
      5 add_setup(async function () {
      6  await SpecialPowers.pushPrefEnv({
      7    set: [["browser.navigation.requireUserInteraction", true]],
      8  });
      9 });
     10 
     11 add_task(async () => {
     12  await BrowserTestUtils.withNewTab(TEST_URI, async () => {
     13    // Navigate away, without causing a user interaction.
     14    let loaded = BrowserTestUtils.waitForLocationChange(
     15      gBrowser,
     16      TEST_URI + "2.html"
     17    );
     18    await followLink(TEST_URI + "2.html");
     19    await loaded;
     20 
     21    // Wait for the session data to be flushed before continuing the test
     22    await new Promise(resolve =>
     23      SessionStore.getSessionHistory(gBrowser.selectedTab, resolve)
     24    );
     25 
     26    // The entry with no interaction shouldn't appear.
     27    await assertMenulist([TEST_URI + "2.html"]);
     28 
     29    const backButton = document.getElementById("back-button");
     30    ok(backButton.disabled, "The back button should be disabled.");
     31  });
     32 });