|
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(["bookmarks"]); |
|
10 |
|
11 var phases = { "phase1": "profile1", |
|
12 "phase2": "profile2", |
|
13 "phase3": "profile1", |
|
14 "phase4": "profile2" }; |
|
15 |
|
16 /* |
|
17 * Bookmark asset lists: these define bookmarks that are used during the test |
|
18 */ |
|
19 |
|
20 // the initial list of bookmarks to add to the browser |
|
21 var bookmarks_initial = { |
|
22 "toolbar": [ |
|
23 { uri: "http://www.google.com", |
|
24 title: "Google" |
|
25 }, |
|
26 { uri: "http://www.cnn.com", |
|
27 title: "CNN", |
|
28 changes: { |
|
29 position: "Google" |
|
30 } |
|
31 }, |
|
32 { uri: "http://www.mozilla.com", |
|
33 title: "Mozilla" |
|
34 }, |
|
35 { uri: "http://www.firefox.com", |
|
36 title: "Firefox", |
|
37 changes: { |
|
38 position: "Mozilla" |
|
39 } |
|
40 } |
|
41 ] |
|
42 }; |
|
43 |
|
44 var bookmarks_after_move = { |
|
45 "toolbar": [ |
|
46 { uri: "http://www.cnn.com", |
|
47 title: "CNN" |
|
48 }, |
|
49 { uri: "http://www.google.com", |
|
50 title: "Google" |
|
51 }, |
|
52 { uri: "http://www.firefox.com", |
|
53 title: "Firefox" |
|
54 }, |
|
55 { uri: "http://www.mozilla.com", |
|
56 title: "Mozilla" |
|
57 } |
|
58 ] |
|
59 }; |
|
60 |
|
61 /* |
|
62 * Test phases |
|
63 */ |
|
64 |
|
65 // Add four bookmarks to the toolbar and sync. |
|
66 Phase('phase1', [ |
|
67 [Bookmarks.add, bookmarks_initial], |
|
68 [Bookmarks.verify, bookmarks_initial], |
|
69 [Sync] |
|
70 ]); |
|
71 |
|
72 // Sync to profile2 and verify that all four bookmarks are present. |
|
73 Phase('phase2', [ |
|
74 [Sync], |
|
75 [Bookmarks.verify, bookmarks_initial] |
|
76 ]); |
|
77 |
|
78 // Change the order of the toolbar bookmarks, and sync. |
|
79 Phase('phase3', [ |
|
80 [Sync], |
|
81 [Bookmarks.verify, bookmarks_initial], |
|
82 [Bookmarks.modify, bookmarks_initial], |
|
83 [Bookmarks.verify, bookmarks_after_move], |
|
84 [Sync], |
|
85 ]); |
|
86 |
|
87 // Go back to profile2, sync, and verify that the bookmarks are reordered |
|
88 // as expected. |
|
89 Phase('phase4', [ |
|
90 [Sync], |
|
91 [Bookmarks.verify, bookmarks_after_move] |
|
92 ]); |
|
93 |