|
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 |
|
10 EnableEngines(["history"]); |
|
11 |
|
12 var phases = { "phase1": "profile1", |
|
13 "phase2": "profile2"}; |
|
14 |
|
15 /* |
|
16 * History data |
|
17 */ |
|
18 |
|
19 // the history data to add to the browser |
|
20 var history1 = [ |
|
21 { uri: "http://www.google.com/", |
|
22 title: "Google", |
|
23 visits: [ |
|
24 { type: 1, |
|
25 date: 0 |
|
26 }, |
|
27 { type: 2, |
|
28 date: -1 |
|
29 } |
|
30 ] |
|
31 }, |
|
32 { uri: "http://www.cnn.com/", |
|
33 title: "CNN", |
|
34 visits: [ |
|
35 { type: 1, |
|
36 date: -1 |
|
37 }, |
|
38 { type: 2, |
|
39 date: -36 |
|
40 } |
|
41 ] |
|
42 } |
|
43 ]; |
|
44 |
|
45 // Another history data to add to the browser |
|
46 var history2 = [ |
|
47 { uri: "http://www.mozilla.com/", |
|
48 title: "Mozilla", |
|
49 visits: [ |
|
50 { type: 1, |
|
51 date: 0 |
|
52 }, |
|
53 { type: 2, |
|
54 date: -36 |
|
55 } |
|
56 ] |
|
57 }, |
|
58 { uri: "http://www.google.com/language_tools?hl=en", |
|
59 title: "Language Tools", |
|
60 visits: [ |
|
61 { type: 1, |
|
62 date: 0 |
|
63 }, |
|
64 { type: 2, |
|
65 date: -40 |
|
66 } |
|
67 ] |
|
68 } |
|
69 ]; |
|
70 |
|
71 /* |
|
72 * Test phases |
|
73 */ |
|
74 Phase('phase1', [ |
|
75 [History.add, history1], |
|
76 [Sync], |
|
77 [History.add, history2], |
|
78 [Sync] |
|
79 ]); |
|
80 |
|
81 Phase('phase2', [ |
|
82 [Sync], |
|
83 [History.verify, history2] |
|
84 ]); |
|
85 |