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(["passwords"]); 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: * Password asset lists: these define password entries that are used during michael@0: * the test michael@0: */ michael@0: michael@0: // initial password list to be loaded into 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: // expected state of passwords after the changes in the above list are applied michael@0: var passwords_after_first_update = [ 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: 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: 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: // expected state of passwords after the delete operation michael@0: var passwords_after_second_update = [ 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: [Passwords.add, passwords_initial], michael@0: [Sync] michael@0: ]); michael@0: michael@0: Phase('phase2', [ michael@0: [Sync], michael@0: [Passwords.verify, passwords_initial], michael@0: [Passwords.modify, passwords_initial], michael@0: [Passwords.verify, passwords_after_first_update], michael@0: [Sync] michael@0: ]); michael@0: michael@0: Phase('phase3', [ michael@0: [Sync], michael@0: [Passwords.verify, passwords_after_first_update], michael@0: [Passwords.delete, passwords_to_delete], michael@0: [Passwords.verify, passwords_after_second_update], michael@0: [Passwords.verifyNot, passwords_absent], michael@0: [Sync] michael@0: ]); michael@0: michael@0: Phase('phase4', [ michael@0: [Sync], michael@0: [Passwords.verify, passwords_after_second_update], michael@0: [Passwords.verifyNot, passwords_absent] michael@0: ]);