services/sync/tests/tps/test_bug530717.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/services/sync/tests/tps/test_bug530717.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,69 @@
     1.4 +/* Any copyright is dedicated to the Public Domain.
     1.5 +   http://creativecommons.org/publicdomain/zero/1.0/ */
     1.6 +
     1.7 +/*
     1.8 + * The list of phases mapped to their corresponding profiles.  The object
     1.9 + * here must be in strict JSON format, as it will get parsed by the Python
    1.10 + * testrunner (no single quotes, extra comma's, etc).
    1.11 + */
    1.12 +EnableEngines(["prefs"]);
    1.13 +
    1.14 +var phases = { "phase1": "profile1",
    1.15 +               "phase2": "profile2",
    1.16 +               "phase3": "profile1"};
    1.17 +
    1.18 +/*
    1.19 + * Preference lists
    1.20 + */
    1.21 +
    1.22 +var prefs1 = [
    1.23 +  { name: "browser.startup.homepage",
    1.24 +    value: "http://www.getfirefox.com"
    1.25 +  },
    1.26 +  { name: "browser.urlbar.maxRichResults",
    1.27 +    value: 20
    1.28 +  },
    1.29 +  { name: "security.OCSP.require",
    1.30 +    value: true
    1.31 +  }
    1.32 +];
    1.33 +
    1.34 +var prefs2 = [
    1.35 +  { name: "browser.startup.homepage",
    1.36 +    value: "http://www.mozilla.com"
    1.37 +  },
    1.38 +  { name: "browser.urlbar.maxRichResults",
    1.39 +    value: 18
    1.40 +  },
    1.41 +  { name: "security.OCSP.require",
    1.42 +    value: false
    1.43 +  }
    1.44 +];
    1.45 +
    1.46 +/*
    1.47 + * Test phases
    1.48 + */
    1.49 +
    1.50 +// Add prefs to profile1 and sync.
    1.51 +Phase('phase1', [
    1.52 +  [Prefs.modify, prefs1],
    1.53 +  [Prefs.verify, prefs1],
    1.54 +  [Sync]
    1.55 +]);
    1.56 +
    1.57 +// Sync profile2 and verify same prefs are present.
    1.58 +Phase('phase2', [
    1.59 +  [Sync],
    1.60 +  [Prefs.verify, prefs1]
    1.61 +]);
    1.62 +
    1.63 +// Using profile1, change some prefs, then do another sync with wipe-client.
    1.64 +// Verify that the cloud's prefs are restored, and the recent local changes
    1.65 +// discarded.
    1.66 +Phase('phase3', [
    1.67 +  [Prefs.modify, prefs2],
    1.68 +  [Prefs.verify, prefs2],
    1.69 +  [Sync, SYNC_WIPE_CLIENT],
    1.70 +  [Prefs.verify, prefs1]
    1.71 +]);
    1.72 +

mercurial