services/sync/tests/tps/test_privbrw_passwords.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

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(["passwords"]);
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 * Password data
michael@0 18 */
michael@0 19
michael@0 20 // Initial password data
michael@0 21 var passwords_initial = [
michael@0 22 { hostname: "http://www.example.com",
michael@0 23 submitURL: "http://login.example.com",
michael@0 24 username: "joe",
michael@0 25 password: "secret",
michael@0 26 usernameField: "uname",
michael@0 27 passwordField: "pword",
michael@0 28 changes: {
michael@0 29 password: "SeCrEt$$$"
michael@0 30 }
michael@0 31 },
michael@0 32 { hostname: "http://www.example.com",
michael@0 33 realm: "login",
michael@0 34 username: "jack",
michael@0 35 password: "secretlogin"
michael@0 36 }
michael@0 37 ];
michael@0 38
michael@0 39 // Password after first modify action has been performed
michael@0 40 var passwords_after_first_change = [
michael@0 41 { hostname: "http://www.example.com",
michael@0 42 submitURL: "http://login.example.com",
michael@0 43 username: "joe",
michael@0 44 password: "SeCrEt$$$",
michael@0 45 usernameField: "uname",
michael@0 46 passwordField: "pword",
michael@0 47 changes: {
michael@0 48 username: "james"
michael@0 49 }
michael@0 50 },
michael@0 51 { hostname: "http://www.example.com",
michael@0 52 realm: "login",
michael@0 53 username: "jack",
michael@0 54 password: "secretlogin"
michael@0 55 }
michael@0 56 ];
michael@0 57
michael@0 58 // Password after second modify action has been performed
michael@0 59 var passwords_after_second_change = [
michael@0 60 { hostname: "http://www.example.com",
michael@0 61 submitURL: "http://login.example.com",
michael@0 62 username: "james",
michael@0 63 password: "SeCrEt$$$",
michael@0 64 usernameField: "uname",
michael@0 65 passwordField: "pword"
michael@0 66 },
michael@0 67 { hostname: "http://www.example.com",
michael@0 68 realm: "login",
michael@0 69 username: "jack",
michael@0 70 password: "secretlogin"
michael@0 71 }
michael@0 72 ];
michael@0 73
michael@0 74 /*
michael@0 75 * Test phases
michael@0 76 */
michael@0 77
michael@0 78 Phase('phase1', [
michael@0 79 [Passwords.add, passwords_initial],
michael@0 80 [Sync]
michael@0 81 ]);
michael@0 82
michael@0 83 Phase('phase2', [
michael@0 84 [Sync],
michael@0 85 [Passwords.verify, passwords_initial],
michael@0 86 [Passwords.modify, passwords_initial],
michael@0 87 [Passwords.verify, passwords_after_first_change],
michael@0 88 [Sync]
michael@0 89 ]);
michael@0 90
michael@0 91 Phase('phase3', [
michael@0 92 [Sync],
michael@0 93 [Windows.add, { private: true }],
michael@0 94 [Passwords.verify, passwords_after_first_change],
michael@0 95 [Passwords.modify, passwords_after_first_change],
michael@0 96 [Passwords.verify, passwords_after_second_change],
michael@0 97 [Sync]
michael@0 98 ]);
michael@0 99
michael@0 100 Phase('phase4', [
michael@0 101 [Sync],
michael@0 102 [Passwords.verify, passwords_after_second_change]
michael@0 103 ]);
michael@0 104

mercurial