PageRenderTime 5ms CodeModel.GetById 2ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/services/sync/tests/tps/test_bug531489.js

http://github.com/zpao/v8monkey
JavaScript | 62 lines | 35 code | 9 blank | 18 comment | 0 complexity | 4d33a7446ff33a0b39cf48e3f289e2fa MD5 | raw file
 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 */
 9EnableEngines(["bookmarks"]);
10
11var phases = { "phase1": "profile1",
12               "phase2": "profile2",
13               "phase3": "profile1"};
14
15/*
16 * Bookmark asset lists: these define bookmarks that are used during the test
17 */
18
19// the initial list of bookmarks to add to the browser
20var bookmarks_initial = {
21  "menu": [
22    { folder: "foldera" },
23    { uri: "http://www.google.com",
24      title: "Google"
25    }
26  ],
27  "menu/foldera": [
28    { uri: "http://www.google.com",
29      title: "Google"
30    }
31  ],
32  "toolbar": [
33    { uri: "http://www.google.com",
34      title: "Google"
35    }
36  ]
37};
38
39/*
40 * Test phases
41 */
42
43// Add three bookmarks with the same url to different locations and sync.
44Phase('phase1', [
45  [Bookmarks.add, bookmarks_initial],
46  [Bookmarks.verify, bookmarks_initial],
47  [Sync]
48]);
49
50// Sync to profile2 and verify that all three bookmarks are present
51Phase('phase2', [
52  [Sync],
53  [Bookmarks.verify, bookmarks_initial]
54]);
55
56// Sync again to profile1 and verify that all three bookmarks are still
57// present.
58Phase('phase3', [
59  [Sync],
60  [Bookmarks.verify, bookmarks_initial]
61]);
62