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: 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 asset lists: these define bookmarks that are used during the test michael@0: */ michael@0: michael@0: // the initial list of bookmarks to be added 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: changes: { michael@0: title: "Google", michael@0: loadInSidebar: false, michael@0: tags: ["google", "computers", "misc"], michael@0: } michael@0: }, michael@0: { uri: "http://bugzilla.mozilla.org/show_bug.cgi?id=%s", michael@0: title: "Bugzilla", michael@0: keyword: "bz", michael@0: changes: { michael@0: keyword: "bugzilla" michael@0: } 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: changes: { michael@0: location: "menu/folderb" michael@0: } 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: changes: { michael@0: uri: "http://money.cnn.com", michael@0: description: "new description", michael@0: } 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: changes: { michael@0: livemark: "LivemarkOne" michael@0: } michael@0: }, michael@0: ], michael@0: "menu/folderb": [ michael@0: { uri: "http://www.apple.com", michael@0: tags: ["apple", "mac"], michael@0: changes: { michael@0: uri: "http://www.apple.com/iphone/", michael@0: title: "iPhone", michael@0: location: "menu", michael@0: position: "Google", michael@0: tags: [] michael@0: } 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: // the state of bookmarks after the first 'modify' action has been performed michael@0: // on them michael@0: var bookmarks_after_first_modify = { michael@0: "menu": [ michael@0: { uri: "http://www.apple.com/iphone/", michael@0: title: "iPhone", michael@0: before: "Google", michael@0: tags: [] michael@0: }, michael@0: { uri: "http://www.google.com", michael@0: title: "Google", michael@0: loadInSidebar: false, michael@0: tags: [ "google", "computers", "misc"] michael@0: }, michael@0: { uri: "http://bugzilla.mozilla.org/show_bug.cgi?id=%s", michael@0: title: "Bugzilla", michael@0: keyword: "bugzilla" michael@0: }, michael@0: { folder: "foldera" }, michael@0: { uri: "http://www.mozilla.com" }, michael@0: { separator: true }, michael@0: { folder: "folderb", michael@0: changes: { michael@0: location: "menu/foldera", michael@0: folder: "Folder B", michael@0: description: "folder description" michael@0: } michael@0: } michael@0: ], michael@0: "menu/foldera": [ michael@0: { uri: "http://money.cnn.com", michael@0: title: "http://www.cnn.com", michael@0: description: "new description" michael@0: }, michael@0: { livemark: "LivemarkOne", 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.yahoo.com", michael@0: title: "testing Yahoo" 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: title: "Google", michael@0: loadInSidebar: false, michael@0: tags: [ "google", "computers", "misc" ] michael@0: } michael@0: ] michael@0: }; michael@0: michael@0: // the state of bookmarks after the second 'modify' action has been performed michael@0: // on them michael@0: var bookmarks_after_second_modify = { michael@0: "menu": [ michael@0: { uri: "http://www.apple.com/iphone/", michael@0: title: "iPhone" michael@0: }, michael@0: { uri: "http://bugzilla.mozilla.org/show_bug.cgi?id=%s", michael@0: title: "Bugzilla", michael@0: keyword: "bugzilla" michael@0: }, michael@0: { folder: "foldera" }, michael@0: { uri: "http://www.mozilla.com" }, michael@0: { separator: true }, michael@0: ], michael@0: "menu/foldera": [ michael@0: { uri: "http://money.cnn.com", michael@0: title: "http://www.cnn.com", michael@0: description: "new description" michael@0: }, michael@0: { livemark: "LivemarkOne", 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: { folder: "Folder B", michael@0: description: "folder description" michael@0: } michael@0: ], michael@0: "menu/foldera/Folder B": [ michael@0: { uri: "http://www.yahoo.com", michael@0: title: "testing Yahoo" michael@0: } michael@0: ] michael@0: }; michael@0: michael@0: // a list of bookmarks which should not be present after the last michael@0: // 'delete' and 'modify' actions michael@0: var bookmarks_absent = { michael@0: "menu": [ michael@0: { uri: "http://www.google.com", michael@0: title: "Google" michael@0: }, michael@0: { folder: "folderb" }, michael@0: { folder: "Folder B" } michael@0: ] michael@0: }; michael@0: michael@0: /* michael@0: * History asset lists: these define history entries that are used during michael@0: * the test michael@0: */ michael@0: michael@0: // the initial list of history items to add to the browser michael@0: var history_initial = [ michael@0: { uri: "http://www.google.com/", michael@0: title: "Google", michael@0: visits: [ michael@0: { type: 1, date: 0 }, michael@0: { type: 2, date: -1 } michael@0: ] michael@0: }, michael@0: { uri: "http://www.cnn.com/", michael@0: title: "CNN", michael@0: visits: [ michael@0: { type: 1, date: -1 }, michael@0: { type: 2, date: -36 } michael@0: ] michael@0: }, michael@0: { uri: "http://www.google.com/language_tools?hl=en", michael@0: title: "Language Tools", michael@0: visits: [ michael@0: { type: 1, date: 0 }, michael@0: { type: 2, date: -40 } michael@0: ] michael@0: }, michael@0: { uri: "http://www.mozilla.com/", michael@0: title: "Mozilla", michael@0: visits: [ michael@0: { type: 1, date: 0 }, michael@0: { type: 1, date: -1 }, michael@0: { type: 1, date: -20 }, michael@0: { type: 2, date: -36 } michael@0: ] michael@0: } michael@0: ]; michael@0: michael@0: // a list of history entries to delete during a 'delete' action michael@0: var history_to_delete = [ michael@0: { uri: "http://www.cnn.com/" }, michael@0: { begin: -24, michael@0: end: -1 }, michael@0: { host: "www.google.com" } michael@0: ]; michael@0: michael@0: // the expected history entries after the first 'delete' action michael@0: var history_after_delete = [ michael@0: { uri: "http://www.mozilla.com/", michael@0: title: "Mozilla", michael@0: visits: [ michael@0: { type: 1, michael@0: date: 0 michael@0: }, michael@0: { type: 2, michael@0: date: -36 michael@0: } michael@0: ] michael@0: } michael@0: ]; michael@0: michael@0: // history entries expected to not exist after a 'delete' action michael@0: var history_absent = [ michael@0: { uri: "http://www.google.com/", michael@0: title: "Google", michael@0: visits: [ michael@0: { type: 1, michael@0: date: 0 michael@0: }, michael@0: { type: 2, michael@0: date: -1 michael@0: } michael@0: ] michael@0: }, michael@0: { uri: "http://www.cnn.com/", michael@0: title: "CNN", michael@0: visits: [ michael@0: { type: 1, michael@0: date: -1 michael@0: }, michael@0: { type: 2, michael@0: date: -36 michael@0: } michael@0: ] michael@0: }, michael@0: { uri: "http://www.google.com/language_tools?hl=en", michael@0: title: "Language Tools", michael@0: visits: [ michael@0: { type: 1, michael@0: date: 0 michael@0: }, michael@0: { type: 2, michael@0: date: -40 michael@0: } michael@0: ] michael@0: }, michael@0: { uri: "http://www.mozilla.com/", michael@0: title: "Mozilla", michael@0: visits: [ michael@0: { type: 1, michael@0: date: -1 michael@0: }, michael@0: { type: 1, michael@0: date: -20 michael@0: } michael@0: ] michael@0: } michael@0: ]; michael@0: michael@0: /* michael@0: * Password asset lists: these define password entries that are used during michael@0: * the test michael@0: */ michael@0: michael@0: // the initial list of passwords to add to the browser michael@0: var passwords_initial = [ michael@0: { hostname: "http://www.example.com", michael@0: submitURL: "http://login.example.com", michael@0: username: "joe", michael@0: password: "SeCrEt123", michael@0: usernameField: "uname", michael@0: passwordField: "pword", michael@0: changes: { michael@0: password: "zippity-do-dah" michael@0: } michael@0: }, michael@0: { hostname: "http://www.example.com", michael@0: realm: "login", michael@0: username: "joe", michael@0: password: "secretlogin" michael@0: } michael@0: ]; michael@0: michael@0: // the expected state of passwords after the first 'modify' action michael@0: var passwords_after_first_modify = [ michael@0: { hostname: "http://www.example.com", michael@0: submitURL: "http://login.example.com", michael@0: username: "joe", michael@0: password: "zippity-do-dah", michael@0: usernameField: "uname", michael@0: passwordField: "pword" michael@0: }, michael@0: { hostname: "http://www.example.com", michael@0: realm: "login", michael@0: username: "joe", michael@0: password: "secretlogin" michael@0: } michael@0: ]; michael@0: michael@0: // a list of passwords to delete during a 'delete' action michael@0: var passwords_to_delete = [ michael@0: { hostname: "http://www.example.com", michael@0: realm: "login", michael@0: username: "joe", michael@0: password: "secretlogin" michael@0: } michael@0: ]; michael@0: michael@0: // a list of passwords expected to be absent after 'delete' and 'modify' michael@0: // actions michael@0: var passwords_absent = [ michael@0: { hostname: "http://www.example.com", michael@0: realm: "login", michael@0: username: "joe", michael@0: password: "secretlogin" michael@0: } michael@0: ]; michael@0: michael@0: // the expected state of passwords after the seconds 'modify' action michael@0: var passwords_after_second_modify = [ michael@0: { hostname: "http://www.example.com", michael@0: submitURL: "http://login.example.com", michael@0: username: "joe", michael@0: password: "zippity-do-dah", michael@0: usernameField: "uname", michael@0: passwordField: "pword" michael@0: } michael@0: ]; michael@0: michael@0: /* michael@0: * Test phases michael@0: */ michael@0: michael@0: Phase('phase1', [ michael@0: [Bookmarks.add, bookmarks_initial], michael@0: [Passwords.add, passwords_initial], michael@0: [History.add, history_initial], michael@0: [Sync], michael@0: ]); michael@0: michael@0: Phase('phase2', [ michael@0: [Sync], michael@0: [Bookmarks.verify, bookmarks_initial], michael@0: [Passwords.verify, passwords_initial], michael@0: [History.verify, history_initial], michael@0: [Bookmarks.modify, bookmarks_initial], michael@0: [Passwords.modify, passwords_initial], michael@0: [History.delete, history_to_delete], michael@0: [Bookmarks.verify, bookmarks_after_first_modify], michael@0: [Passwords.verify, passwords_after_first_modify], michael@0: [History.verify, history_after_delete], michael@0: [History.verifyNot, history_absent], michael@0: [Sync], michael@0: ]); michael@0: michael@0: Phase('phase3', [ michael@0: [Sync], michael@0: [Bookmarks.verify, bookmarks_after_first_modify], michael@0: [Passwords.verify, passwords_after_first_modify], michael@0: [History.verify, history_after_delete], michael@0: [Bookmarks.modify, bookmarks_after_first_modify], michael@0: [Passwords.modify, passwords_after_first_modify], michael@0: [Bookmarks.delete, bookmarks_to_delete], michael@0: [Passwords.delete, passwords_to_delete], michael@0: [Bookmarks.verify, bookmarks_after_second_modify], michael@0: [Passwords.verify, passwords_after_second_modify], michael@0: [Bookmarks.verifyNot, bookmarks_absent], michael@0: [Passwords.verifyNot, passwords_absent], michael@0: [Sync], michael@0: ]); michael@0: michael@0: Phase('phase4', [ michael@0: [Sync], michael@0: [Bookmarks.verify, bookmarks_after_second_modify], michael@0: [Passwords.verify, passwords_after_second_modify], michael@0: [Bookmarks.verifyNot, bookmarks_absent], michael@0: [Passwords.verifyNot, passwords_absent], michael@0: [History.verifyNot, history_absent], michael@0: ]); michael@0: michael@0: