michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: /* michael@0: * The list of phases mapped to their corresponding profiles. The object michael@0: * here must be in strict JSON format, as it will get parsed by the Python michael@0: * testrunner (no single quotes, extra comma's, etc). michael@0: */ michael@0: EnableEngines(["bookmarks"]); michael@0: michael@0: var phases = { "phase1": "profile1", michael@0: "phase2": "profile2", michael@0: "phase3": "profile1", michael@0: "phase4": "profile2" }; michael@0: michael@0: /* michael@0: * Bookmark lists michael@0: */ michael@0: michael@0: // the initial list of bookmarks to add to the browser michael@0: var bookmarks_initial = { michael@0: "menu": [ michael@0: { uri: "http://www.google.com", michael@0: loadInSidebar: true, michael@0: tags: [ "google", "computers", "internet", "www"] michael@0: }, michael@0: { uri: "http://bugzilla.mozilla.org/show_bug.cgi?id=%s", michael@0: title: "Bugzilla", michael@0: keyword: "bz" michael@0: }, michael@0: { folder: "foldera" }, michael@0: { uri: "http://www.mozilla.com" }, michael@0: { separator: true }, michael@0: { folder: "folderb" } michael@0: ], michael@0: "menu/foldera": [ michael@0: { uri: "http://www.yahoo.com", michael@0: title: "testing Yahoo" michael@0: }, michael@0: { uri: "http://www.cnn.com", michael@0: description: "This is a description of the site a at www.cnn.com" michael@0: }, michael@0: { livemark: "Livemark1", michael@0: feedUri: "http://rss.wunderground.com/blog/JeffMasters/rss.xml", michael@0: siteUri: "http://www.wunderground.com/blog/JeffMasters/show.html" michael@0: } michael@0: ], michael@0: "menu/folderb": [ michael@0: { uri: "http://www.apple.com", michael@0: tags: [ "apple", "mac" ] michael@0: } michael@0: ], michael@0: "toolbar": [ michael@0: { uri: "place:queryType=0&sort=8&maxResults=10&beginTimeRef=1&beginTime=0", michael@0: title: "Visited Today" michael@0: } michael@0: ] michael@0: }; michael@0: michael@0: // a list of bookmarks to delete during a 'delete' action michael@0: var bookmarks_to_delete = { michael@0: "menu": [ michael@0: { uri: "http://www.google.com", michael@0: loadInSidebar: true, michael@0: tags: [ "google", "computers", "internet", "www"] michael@0: } michael@0: ], michael@0: "menu/foldera": [ michael@0: { uri: "http://www.yahoo.com", michael@0: title: "testing Yahoo" michael@0: } michael@0: ] michael@0: }; michael@0: michael@0: /* michael@0: * Test phases michael@0: */ michael@0: michael@0: // add bookmarks to profile1 and sync michael@0: Phase('phase1', [ michael@0: [Bookmarks.add, bookmarks_initial], michael@0: [Bookmarks.verify, bookmarks_initial], michael@0: [Sync] michael@0: ]); michael@0: michael@0: // sync to profile2 and verify that the bookmarks are present michael@0: Phase('phase2', [ michael@0: [Sync], michael@0: [Bookmarks.verify, bookmarks_initial] michael@0: ]); michael@0: michael@0: // delete some bookmarks from profile1, then sync with "wipe-client" michael@0: // set; finally, verify that the deleted bookmarks were restored. michael@0: Phase('phase3', [ michael@0: [Bookmarks.delete, bookmarks_to_delete], michael@0: [Bookmarks.verifyNot, bookmarks_to_delete], michael@0: [Sync, SYNC_WIPE_CLIENT], michael@0: [Bookmarks.verify, bookmarks_initial] michael@0: ]); michael@0: michael@0: // sync profile2 again, verify no bookmarks have been deleted michael@0: Phase('phase4', [ michael@0: [Sync], michael@0: [Bookmarks.verify, bookmarks_initial] michael@0: ]);