|
1 /* Any copyright is dedicated to the Public Domain. |
|
2 http://creativecommons.org/publicdomain/zero/1.0/ */ |
|
3 |
|
4 /* |
|
5 * The list of phases mapped to their corresponding profiles. The object |
|
6 * here must be in strict JSON format, as it will get parsed by the Python |
|
7 * testrunner (no single quotes, extra comma's, etc). |
|
8 */ |
|
9 EnableEngines(["prefs"]); |
|
10 |
|
11 var phases = { "phase1": "profile1", |
|
12 "phase2": "profile2", |
|
13 "phase3": "profile1"}; |
|
14 |
|
15 /* |
|
16 * Preference lists |
|
17 */ |
|
18 |
|
19 var prefs1 = [ |
|
20 { name: "browser.startup.homepage", |
|
21 value: "http://www.getfirefox.com" |
|
22 }, |
|
23 { name: "browser.urlbar.maxRichResults", |
|
24 value: 20 |
|
25 }, |
|
26 { name: "security.OCSP.require", |
|
27 value: true |
|
28 } |
|
29 ]; |
|
30 |
|
31 var prefs2 = [ |
|
32 { name: "browser.startup.homepage", |
|
33 value: "http://www.mozilla.com" |
|
34 }, |
|
35 { name: "browser.urlbar.maxRichResults", |
|
36 value: 18 |
|
37 }, |
|
38 { name: "security.OCSP.require", |
|
39 value: false |
|
40 } |
|
41 ]; |
|
42 |
|
43 /* |
|
44 * Test phases |
|
45 */ |
|
46 |
|
47 // Add prefs to profile1 and sync. |
|
48 Phase('phase1', [ |
|
49 [Prefs.modify, prefs1], |
|
50 [Prefs.verify, prefs1], |
|
51 [Sync] |
|
52 ]); |
|
53 |
|
54 // Sync profile2 and verify same prefs are present. |
|
55 Phase('phase2', [ |
|
56 [Sync], |
|
57 [Prefs.verify, prefs1] |
|
58 ]); |
|
59 |
|
60 // Using profile1, change some prefs, then do another sync with wipe-client. |
|
61 // Verify that the cloud's prefs are restored, and the recent local changes |
|
62 // discarded. |
|
63 Phase('phase3', [ |
|
64 [Prefs.modify, prefs2], |
|
65 [Prefs.verify, prefs2], |
|
66 [Sync, SYNC_WIPE_CLIENT], |
|
67 [Prefs.verify, prefs1] |
|
68 ]); |
|
69 |