Wed, 31 Dec 2014 06:09:35 +0100
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 lists |
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": [ |
michael@0 | 63 | { uri: "http://www.google.com", |
michael@0 | 64 | loadInSidebar: true, |
michael@0 | 65 | tags: [ "google", "computers", "internet", "www"] |
michael@0 | 66 | } |
michael@0 | 67 | ], |
michael@0 | 68 | "menu/foldera": [ |
michael@0 | 69 | { uri: "http://www.yahoo.com", |
michael@0 | 70 | title: "testing Yahoo" |
michael@0 | 71 | } |
michael@0 | 72 | ] |
michael@0 | 73 | }; |
michael@0 | 74 | |
michael@0 | 75 | /* |
michael@0 | 76 | * Test phases |
michael@0 | 77 | */ |
michael@0 | 78 | |
michael@0 | 79 | // add bookmarks to profile1 and sync |
michael@0 | 80 | Phase('phase1', [ |
michael@0 | 81 | [Bookmarks.add, bookmarks_initial], |
michael@0 | 82 | [Bookmarks.verify, bookmarks_initial], |
michael@0 | 83 | [Sync] |
michael@0 | 84 | ]); |
michael@0 | 85 | |
michael@0 | 86 | // sync to profile2 and verify that the bookmarks are present |
michael@0 | 87 | Phase('phase2', [ |
michael@0 | 88 | [Sync], |
michael@0 | 89 | [Bookmarks.verify, bookmarks_initial] |
michael@0 | 90 | ]); |
michael@0 | 91 | |
michael@0 | 92 | // delete some bookmarks from profile1, then sync with "wipe-client" |
michael@0 | 93 | // set; finally, verify that the deleted bookmarks were restored. |
michael@0 | 94 | Phase('phase3', [ |
michael@0 | 95 | [Bookmarks.delete, bookmarks_to_delete], |
michael@0 | 96 | [Bookmarks.verifyNot, bookmarks_to_delete], |
michael@0 | 97 | [Sync, SYNC_WIPE_CLIENT], |
michael@0 | 98 | [Bookmarks.verify, bookmarks_initial] |
michael@0 | 99 | ]); |
michael@0 | 100 | |
michael@0 | 101 | // sync profile2 again, verify no bookmarks have been deleted |
michael@0 | 102 | Phase('phase4', [ |
michael@0 | 103 | [Sync], |
michael@0 | 104 | [Bookmarks.verify, bookmarks_initial] |
michael@0 | 105 | ]); |