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: 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: toolbar: [ michael@0: { uri: "http://www.google.com", michael@0: title: "Google" michael@0: }, michael@0: { uri: "http://www.cnn.com", michael@0: title: "CNN", michael@0: changes: { michael@0: position: "Google" michael@0: } michael@0: }, michael@0: { uri: "http://www.mozilla.com", michael@0: title: "Mozilla" michael@0: }, michael@0: { uri: "http://www.firefox.com", michael@0: title: "Firefox", michael@0: changes: { michael@0: position: "Mozilla" michael@0: } michael@0: } michael@0: ] michael@0: }; michael@0: michael@0: var bookmarks_after_move = { michael@0: toolbar: [ michael@0: { uri: "http://www.cnn.com", michael@0: title: "CNN" michael@0: }, michael@0: { uri: "http://www.google.com", michael@0: title: "Google" michael@0: }, michael@0: { uri: "http://www.firefox.com", michael@0: title: "Firefox" michael@0: }, michael@0: { uri: "http://www.mozilla.com", michael@0: title: "Mozilla" michael@0: } michael@0: ] michael@0: }; michael@0: michael@0: /* michael@0: * Password data michael@0: */ michael@0: michael@0: // Initial password data 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: "secret", michael@0: usernameField: "uname", michael@0: passwordField: "pword", michael@0: changes: { michael@0: password: "SeCrEt$$$" michael@0: } michael@0: }, michael@0: { hostname: "http://www.example.com", michael@0: realm: "login", michael@0: username: "jack", michael@0: password: "secretlogin" michael@0: } michael@0: ]; michael@0: michael@0: // Password after first modify action has been performed michael@0: var passwords_after_change = [ michael@0: { hostname: "http://www.example.com", michael@0: submitURL: "http://login.example.com", michael@0: username: "joe", michael@0: password: "SeCrEt$$$", michael@0: usernameField: "uname", michael@0: passwordField: "pword", michael@0: changes: { michael@0: username: "james" michael@0: } michael@0: }, michael@0: { hostname: "http://www.example.com", michael@0: realm: "login", michael@0: username: "jack", michael@0: password: "secretlogin" michael@0: } michael@0: ]; michael@0: michael@0: /* michael@0: * Prefs to use in the test michael@0: */ michael@0: var prefs1 = [ michael@0: { name: "browser.startup.homepage", michael@0: value: "http://www.getfirefox.com" michael@0: }, michael@0: { name: "browser.urlbar.maxRichResults", michael@0: value: 20 michael@0: }, michael@0: { name: "security.OCSP.require", michael@0: value: true michael@0: } michael@0: ]; michael@0: michael@0: var prefs2 = [ michael@0: { name: "browser.startup.homepage", michael@0: value: "http://www.mozilla.com" michael@0: }, michael@0: { name: "browser.urlbar.maxRichResults", michael@0: value: 18 michael@0: }, michael@0: { name: "security.OCSP.require", michael@0: value: false michael@0: } michael@0: ]; michael@0: michael@0: /* michael@0: * Test phases michael@0: */ michael@0: michael@0: // Add prefs,passwords and bookmarks to profile1 and sync. michael@0: Phase('phase1', [ michael@0: [Passwords.add, passwords_initial], michael@0: [Bookmarks.add, bookmarks_initial], michael@0: [Prefs.modify, prefs1], michael@0: [Prefs.verify, prefs1], michael@0: [Sync] michael@0: ]); michael@0: michael@0: // Sync profile2 and verify same prefs,passwords and bookmarks are present. michael@0: Phase('phase2', [ michael@0: [Sync], michael@0: [Prefs.verify, prefs1], michael@0: [Passwords.verify, passwords_initial], michael@0: [Bookmarks.verify, bookmarks_initial] michael@0: ]); michael@0: michael@0: // Using profile1, change some prefs,bookmarks and pwds, then do another sync with wipe-client. michael@0: // Verify that the cloud's settings are restored, and the recent local changes michael@0: // discarded. michael@0: Phase('phase3', [ michael@0: [Prefs.modify, prefs2], michael@0: [Passwords.modify, passwords_initial], michael@0: [Bookmarks.modify, bookmarks_initial], michael@0: [Prefs.verify, prefs2], michael@0: [Passwords.verify, passwords_after_change], michael@0: [Bookmarks.verify, bookmarks_after_move], michael@0: [Sync, SYNC_WIPE_CLIENT], michael@0: [Prefs.verify, prefs1], michael@0: [Passwords.verify, passwords_initial], michael@0: [Bookmarks.verify, bookmarks_initial] michael@0: ]); michael@0: