tor-browser

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

test_bug530717.js (1429B)


      1 /* Any copyright is dedicated to the Public Domain.
      2   http://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 EnableEngines(["prefs"]);
      5 
      6 /*
      7 * The list of phases mapped to their corresponding profiles.  The object
      8 * here must be in JSON format as it will get parsed by the Python
      9 * testrunner. It is parsed by the YAML package, so it relatively flexible.
     10 */
     11 var phases = { phase1: "profile1", phase2: "profile2", phase3: "profile1" };
     12 
     13 /*
     14 * Preference lists
     15 */
     16 
     17 var prefs1 = [
     18  { name: "browser.startup.homepage", value: "http://www.getfirefox.com" },
     19  { name: "browser.urlbar.maxRichResults", value: 20 },
     20  { name: "privacy.clearOnShutdown.siteSettings", value: true },
     21 ];
     22 
     23 var prefs2 = [
     24  { name: "browser.startup.homepage", value: "http://www.mozilla.com" },
     25  { name: "browser.urlbar.maxRichResults", value: 18 },
     26  { name: "privacy.clearOnShutdown.siteSettings", value: false },
     27 ];
     28 
     29 /*
     30 * Test phases
     31 */
     32 
     33 // Add prefs to profile1 and sync.
     34 Phase("phase1", [[Prefs.modify, prefs1], [Prefs.verify, prefs1], [Sync]]);
     35 
     36 // Sync profile2 and verify same prefs are present.
     37 Phase("phase2", [[Sync], [Prefs.verify, prefs1]]);
     38 
     39 // Using profile1, change some prefs, then do another sync with wipe-client.
     40 // Verify that the cloud's prefs are restored, and the recent local changes
     41 // discarded.
     42 Phase("phase3", [
     43  [Prefs.modify, prefs2],
     44  [Prefs.verify, prefs2],
     45  [Sync, SYNC_WIPE_CLIENT],
     46  [Prefs.verify, prefs1],
     47 ]);