services/sync/tests/tps/test_bug563989.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(["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 "menu": [
michael@0 23 { uri: "http://www.google.com",
michael@0 24 loadInSidebar: true,
michael@0 25 tags: [ "google", "computers", "internet", "www" ]
michael@0 26 },
michael@0 27 { uri: "http://bugzilla.mozilla.org/show_bug.cgi?id=%s",
michael@0 28 title: "Bugzilla",
michael@0 29 keyword: "bz"
michael@0 30 },
michael@0 31 { folder: "foldera" },
michael@0 32 { uri: "http://www.mozilla.com" },
michael@0 33 { separator: true },
michael@0 34 { folder: "folderb" }
michael@0 35 ],
michael@0 36 "menu/foldera": [
michael@0 37 { uri: "http://www.yahoo.com",
michael@0 38 title: "testing Yahoo"
michael@0 39 },
michael@0 40 { uri: "http://www.cnn.com",
michael@0 41 description: "This is a description of the site a at www.cnn.com"
michael@0 42 },
michael@0 43 { livemark: "Livemark1",
michael@0 44 feedUri: "http://rss.wunderground.com/blog/JeffMasters/rss.xml",
michael@0 45 siteUri: "http://www.wunderground.com/blog/JeffMasters/show.html"
michael@0 46 }
michael@0 47 ],
michael@0 48 "menu/folderb": [
michael@0 49 { uri: "http://www.apple.com",
michael@0 50 tags: [ "apple", "mac" ]
michael@0 51 }
michael@0 52 ],
michael@0 53 "toolbar": [
michael@0 54 { uri: "place:queryType=0&sort=8&maxResults=10&beginTimeRef=1&beginTime=0",
michael@0 55 title: "Visited Today"
michael@0 56 }
michael@0 57 ]
michael@0 58 };
michael@0 59
michael@0 60 // a list of bookmarks to delete during a 'delete' action
michael@0 61 var bookmarks_to_delete = {
michael@0 62 "menu/folderb": [
michael@0 63 { uri: "http://www.apple.com",
michael@0 64 tags: [ "apple", "mac" ]
michael@0 65 }
michael@0 66 ],
michael@0 67 "toolbar": [
michael@0 68 { uri: "place:queryType=0&sort=8&maxResults=10&beginTimeRef=1&beginTime=0",
michael@0 69 title: "Visited Today"
michael@0 70 }
michael@0 71 ]
michael@0 72 };
michael@0 73
michael@0 74 /*
michael@0 75 * Test phases
michael@0 76 */
michael@0 77
michael@0 78 // Add bookmarks to profile1 and sync.
michael@0 79 Phase('phase1', [
michael@0 80 [Bookmarks.add, bookmarks_initial],
michael@0 81 [Bookmarks.verify, bookmarks_initial],
michael@0 82 [Sync],
michael@0 83 ]);
michael@0 84
michael@0 85 // Sync to profile2 and verify that the bookmarks are present. Delete
michael@0 86 // some bookmarks, and verify that they're not present, but don't sync again.
michael@0 87 Phase('phase2', [
michael@0 88 [Sync],
michael@0 89 [Bookmarks.verify, bookmarks_initial],
michael@0 90 [Bookmarks.delete, bookmarks_to_delete],
michael@0 91 [Bookmarks.verifyNot, bookmarks_to_delete]
michael@0 92 ]);
michael@0 93
michael@0 94 // Using profile1, sync again with wipe-server set to true. Verify our
michael@0 95 // initial bookmarks are still all present.
michael@0 96 Phase('phase3', [
michael@0 97 [Sync, SYNC_WIPE_REMOTE],
michael@0 98 [Bookmarks.verify, bookmarks_initial]
michael@0 99 ]);
michael@0 100
michael@0 101 // Back in profile2, do a sync and verify that the bookmarks we had
michael@0 102 // deleted earlier are now restored.
michael@0 103 Phase('phase4', [
michael@0 104 [Sync],
michael@0 105 [Bookmarks.verify, bookmarks_initial]
michael@0 106 ]);

mercurial