tor-browser

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

browser_backup_visibility.js (1519B)


      1 /* Any copyright is dedicated to the Public Domain.
      2 * http://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 "use strict";
      5 
      6 /**
      7 * Test that we don't show the backup section if backup is disabled
      8 */
      9 add_task(async function () {
     10  await openPreferencesViaOpenPreferencesAPI("paneSync", {
     11    leaveOpen: true,
     12  });
     13 
     14  await SpecialPowers.pushPrefEnv({
     15    set: [["browser.backup.archive.enabled", false]],
     16  });
     17 
     18  ok(
     19    gBrowser.contentDocument.getElementById("backupCategory").hidden,
     20    "backup category hidden"
     21  );
     22 
     23  ok(
     24    gBrowser.contentDocument.getElementById("dataBackupGroup").hidden,
     25    "backup section is hidden"
     26  );
     27 
     28  // Check that we don't get any results in sync when searching:
     29  await evaluateSearchResults("backup", "no-results-message");
     30 
     31  BrowserTestUtils.removeTab(gBrowser.selectedTab);
     32 });
     33 
     34 /**
     35 * Test that we don't show the backup section if backup is disabled
     36 */
     37 add_task(async function () {
     38  await SpecialPowers.pushPrefEnv({
     39    set: [["browser.backup.archive.enabled", true]],
     40  });
     41 
     42  await openPreferencesViaOpenPreferencesAPI("paneSync", {
     43    leaveOpen: true,
     44  });
     45 
     46  ok(
     47    !gBrowser.contentDocument.getElementById("backupCategory").hidden,
     48    "backup category shown"
     49  );
     50 
     51  ok(
     52    !gBrowser.contentDocument.getElementById("dataBackupGroup").hidden,
     53    "backup section is shown"
     54  );
     55 
     56  // Check that we don't get any results in sync when searching:
     57  await evaluateSearchResults("backup", "dataBackupGroup");
     58 
     59  BrowserTestUtils.removeTab(gBrowser.selectedTab);
     60 });