tor-browser

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

browser_updateRefresh.js (1521B)


      1 /* Any copyright is dedicated to the Public Domain.
      2 * http://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 // Checks the UPDATE_REFRESH 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_noUpdate.js
      8 
      9 "use strict";
     10 
     11 let params = { queryString: "&noUpdates=1" };
     12 
     13 let preSteps = [
     14  {
     15    panelId: "checkingForUpdates",
     16    checkActiveUpdate: null,
     17    continueFile: CONTINUE_CHECK,
     18  },
     19  {
     20    panelId: "noUpdatesFound",
     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  makeProfileResettable();
     32 
     33  // Set up the "no updates" update state.
     34  await initUpdate(params);
     35  UrlbarProviderInterventions.checkForBrowserUpdate(true);
     36  await processUpdateSteps(preSteps);
     37 
     38  // Picking the tip should open the refresh dialog.  Click its cancel
     39  // button.
     40  await doUpdateTest({
     41    searchString: SEARCH_STRINGS.UPDATE,
     42    tip: UrlbarProviderInterventions.TIP_TYPE.UPDATE_REFRESH,
     43    title:
     44      /^.+ is up to date\. Trying to fix a problem\? Restore default settings and remove old add-ons for optimal performance\.$/,
     45    button: /^Refresh .+…$/,
     46    awaitCallback() {
     47      return BrowserTestUtils.promiseAlertDialog(
     48        "cancel",
     49        "chrome://global/content/resetProfile.xhtml",
     50        { isSubDialog: true }
     51      );
     52    },
     53  });
     54 });