tor-browser

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

browser_updateWeb.js (1453B)


      1 /* Any copyright is dedicated to the Public Domain.
      2 * http://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 // Checks the UPDATE_WEB tip.
      5 //
      6 // The update parts of this test are adapted from:
      7 // https://searchfox.org/mozilla-central/source/toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_check_unsupported.js
      8 
      9 "use strict";
     10 
     11 let params = { queryString: "&unsupported=1" };
     12 
     13 let preSteps = [
     14  {
     15    panelId: "checkingForUpdates",
     16    checkActiveUpdate: null,
     17    continueFile: CONTINUE_CHECK,
     18  },
     19  {
     20    panelId: "unsupportedSystem",
     21    checkActiveUpdate: null,
     22    continueFile: null,
     23  },
     24 ];
     25 
     26 add_task(async function test() {
     27  await SpecialPowers.pushPrefEnv({
     28    set: [["browser.urlbar.suggest.quickactions", false]],
     29  });
     30 
     31  // Set up the "unsupported update" update state.
     32  await initUpdate(params);
     33  UrlbarProviderInterventions.checkForBrowserUpdate(true);
     34  await processUpdateSteps(preSteps);
     35 
     36  // Picking the tip should open the download page in a new tab.
     37  let downloadTab = await doUpdateTest({
     38    searchString: SEARCH_STRINGS.UPDATE,
     39    tip: UrlbarProviderInterventions.TIP_TYPE.UPDATE_WEB,
     40    title: /^Get the latest .+ browser\.$/,
     41    button: "Download Now",
     42    awaitCallback() {
     43      return BrowserTestUtils.waitForNewTab(
     44        gBrowser,
     45        "https://www.mozilla.org/firefox/new/"
     46      );
     47    },
     48  });
     49 
     50  Assert.equal(gBrowser.selectedTab, downloadTab);
     51  BrowserTestUtils.removeTab(downloadTab);
     52 });