tor-browser

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

browser_searchFindMoreLink.js (945B)


      1 /* Any copyright is dedicated to the Public Domain.
      2 * http://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 const TEST_URL = "https://example.org/";
      5 
      6 add_setup(async () => {
      7  await SpecialPowers.pushPrefEnv({
      8    set: [["browser.search.searchEnginesURL", TEST_URL]],
      9  });
     10 });
     11 
     12 add_task(async function test_click_find_more_link() {
     13  await openPreferencesViaOpenPreferencesAPI("search", { leaveOpen: true });
     14 
     15  let promiseNewTab = BrowserTestUtils.waitForNewTab(gBrowser);
     16 
     17  gBrowser.selectedBrowser.contentDocument
     18    .getElementById("addEngines")
     19    .scrollIntoView();
     20  await BrowserTestUtils.synthesizeMouseAtCenter(
     21    "#addEngines",
     22    {},
     23    gBrowser.selectedBrowser.browsingContext
     24  );
     25 
     26  let tab = await promiseNewTab;
     27  Assert.equal(
     28    tab.linkedBrowser.documentURI.spec,
     29    TEST_URL,
     30    "Should have loaded the expected page"
     31  );
     32 
     33  // Close both tabs.
     34  gBrowser.removeCurrentTab();
     35  gBrowser.removeCurrentTab();
     36 });