services/sync/tests/tps/test_history_collision.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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(["history"]);
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 * History lists
michael@0 18 */
michael@0 19
michael@0 20 // the initial list of history to add to the browser
michael@0 21 var history1 = [
michael@0 22 { uri: "http://www.google.com/",
michael@0 23 title: "Google",
michael@0 24 visits: [
michael@0 25 { type: 1,
michael@0 26 date: 0
michael@0 27 }
michael@0 28 ]
michael@0 29 },
michael@0 30 { uri: "http://www.cnn.com/",
michael@0 31 title: "CNN",
michael@0 32 visits: [
michael@0 33 { type: 1,
michael@0 34 date: -1
michael@0 35 },
michael@0 36 { type: 2,
michael@0 37 date: -36
michael@0 38 }
michael@0 39 ]
michael@0 40 },
michael@0 41 { uri: "http://www.mozilla.com/",
michael@0 42 title: "Mozilla",
michael@0 43 visits: [
michael@0 44 { type: 1,
michael@0 45 date: 0
michael@0 46 },
michael@0 47 { type: 2,
michael@0 48 date: -36
michael@0 49 }
michael@0 50 ]
michael@0 51 }
michael@0 52 ];
michael@0 53
michael@0 54 // the history to delete
michael@0 55 var history_to_delete = [
michael@0 56 { uri: "http://www.cnn.com/",
michael@0 57 title: "CNN"
michael@0 58 },
michael@0 59 { begin: -36,
michael@0 60 end: -1
michael@0 61 }
michael@0 62 ];
michael@0 63
michael@0 64 var history_not = [
michael@0 65 { uri: "http://www.cnn.com/",
michael@0 66 title: "CNN",
michael@0 67 visits: [
michael@0 68 { type: 1,
michael@0 69 date: -1
michael@0 70 },
michael@0 71 { type: 2,
michael@0 72 date: -36
michael@0 73 }
michael@0 74 ]
michael@0 75 }
michael@0 76 ];
michael@0 77
michael@0 78 var history_after_delete = [
michael@0 79 { uri: "http://www.google.com/",
michael@0 80 title: "Google",
michael@0 81 visits: [
michael@0 82 { type: 1,
michael@0 83 date: 0
michael@0 84 }
michael@0 85 ]
michael@0 86 },
michael@0 87 { uri: "http://www.mozilla.com/",
michael@0 88 title: "Mozilla",
michael@0 89 visits: [
michael@0 90 { type: 1,
michael@0 91 date: 0
michael@0 92 }
michael@0 93 ]
michael@0 94 }
michael@0 95 ];
michael@0 96
michael@0 97 /*
michael@0 98 * Test phases
michael@0 99 */
michael@0 100
michael@0 101 Phase('phase1', [
michael@0 102 [History.add, history1],
michael@0 103 [Sync]
michael@0 104 ]);
michael@0 105
michael@0 106 Phase('phase2', [
michael@0 107 [History.add, history1],
michael@0 108 [Sync, SYNC_WIPE_REMOTE]
michael@0 109 ]);
michael@0 110
michael@0 111 Phase('phase3', [
michael@0 112 [Sync],
michael@0 113 [History.verify, history1],
michael@0 114 [History.delete, history_to_delete],
michael@0 115 [History.verify, history_after_delete],
michael@0 116 [History.verifyNot, history_not],
michael@0 117 [Sync]
michael@0 118 ]);
michael@0 119
michael@0 120 Phase('phase4', [
michael@0 121 [Sync],
michael@0 122 [History.verify, history_after_delete],
michael@0 123 [History.verifyNot, history_not]
michael@0 124 ]);
michael@0 125

mercurial