services/sync/tests/tps/test_bug538298.js

Wed, 31 Dec 2014 07:22:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:22:50 +0100
branch
TOR_BUG_3246
changeset 4
fc2d59ddac77
permissions
-rw-r--r--

Correct previous dual key logic pending first delivery installment.

michael@0 1 /* Any copyright is dedicated to the Public Domain.
michael@0 2 http://creativecommons.org/publicdomain/zero/1.0/ */
michael@0 3
michael@0 4 /*
michael@0 5 * The list of phases mapped to their corresponding profiles. The object
michael@0 6 * here must be in strict JSON format, as it will get parsed by the Python
michael@0 7 * testrunner (no single quotes, extra comma's, etc).
michael@0 8 */
michael@0 9 EnableEngines(["bookmarks"]);
michael@0 10
michael@0 11 var phases = { "phase1": "profile1",
michael@0 12 "phase2": "profile2",
michael@0 13 "phase3": "profile1",
michael@0 14 "phase4": "profile2" };
michael@0 15
michael@0 16 /*
michael@0 17 * Bookmark asset lists: these define bookmarks that are used during the test
michael@0 18 */
michael@0 19
michael@0 20 // the initial list of bookmarks to add to the browser
michael@0 21 var bookmarks_initial = {
michael@0 22 "toolbar": [
michael@0 23 { uri: "http://www.google.com",
michael@0 24 title: "Google"
michael@0 25 },
michael@0 26 { uri: "http://www.cnn.com",
michael@0 27 title: "CNN",
michael@0 28 changes: {
michael@0 29 position: "Google"
michael@0 30 }
michael@0 31 },
michael@0 32 { uri: "http://www.mozilla.com",
michael@0 33 title: "Mozilla"
michael@0 34 },
michael@0 35 { uri: "http://www.firefox.com",
michael@0 36 title: "Firefox",
michael@0 37 changes: {
michael@0 38 position: "Mozilla"
michael@0 39 }
michael@0 40 }
michael@0 41 ]
michael@0 42 };
michael@0 43
michael@0 44 var bookmarks_after_move = {
michael@0 45 "toolbar": [
michael@0 46 { uri: "http://www.cnn.com",
michael@0 47 title: "CNN"
michael@0 48 },
michael@0 49 { uri: "http://www.google.com",
michael@0 50 title: "Google"
michael@0 51 },
michael@0 52 { uri: "http://www.firefox.com",
michael@0 53 title: "Firefox"
michael@0 54 },
michael@0 55 { uri: "http://www.mozilla.com",
michael@0 56 title: "Mozilla"
michael@0 57 }
michael@0 58 ]
michael@0 59 };
michael@0 60
michael@0 61 /*
michael@0 62 * Test phases
michael@0 63 */
michael@0 64
michael@0 65 // Add four bookmarks to the toolbar and sync.
michael@0 66 Phase('phase1', [
michael@0 67 [Bookmarks.add, bookmarks_initial],
michael@0 68 [Bookmarks.verify, bookmarks_initial],
michael@0 69 [Sync]
michael@0 70 ]);
michael@0 71
michael@0 72 // Sync to profile2 and verify that all four bookmarks are present.
michael@0 73 Phase('phase2', [
michael@0 74 [Sync],
michael@0 75 [Bookmarks.verify, bookmarks_initial]
michael@0 76 ]);
michael@0 77
michael@0 78 // Change the order of the toolbar bookmarks, and sync.
michael@0 79 Phase('phase3', [
michael@0 80 [Sync],
michael@0 81 [Bookmarks.verify, bookmarks_initial],
michael@0 82 [Bookmarks.modify, bookmarks_initial],
michael@0 83 [Bookmarks.verify, bookmarks_after_move],
michael@0 84 [Sync],
michael@0 85 ]);
michael@0 86
michael@0 87 // Go back to profile2, sync, and verify that the bookmarks are reordered
michael@0 88 // as expected.
michael@0 89 Phase('phase4', [
michael@0 90 [Sync],
michael@0 91 [Bookmarks.verify, bookmarks_after_move]
michael@0 92 ]);
michael@0 93

mercurial