services/sync/tests/tps/test_privbrw_passwords.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/services/sync/tests/tps/test_privbrw_passwords.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,104 @@
     1.4 +/* Any copyright is dedicated to the Public Domain.
     1.5 +   http://creativecommons.org/publicdomain/zero/1.0/ */
     1.6 +
     1.7 +/*
     1.8 + * The list of phases mapped to their corresponding profiles.  The object
     1.9 + * here must be in strict JSON format, as it will get parsed by the Python
    1.10 + * testrunner (no single quotes, extra comma's, etc).
    1.11 + */
    1.12 +EnableEngines(["passwords"]);
    1.13 +
    1.14 +var phases = { "phase1": "profile1",
    1.15 +               "phase2": "profile2",
    1.16 +               "phase3": "profile1",
    1.17 +               "phase4": "profile2" };
    1.18 +
    1.19 +/*
    1.20 + * Password data
    1.21 + */
    1.22 +
    1.23 +// Initial password data
    1.24 +var passwords_initial = [
    1.25 +   { hostname: "http://www.example.com",
    1.26 +     submitURL: "http://login.example.com",
    1.27 +     username: "joe",
    1.28 +     password: "secret",
    1.29 +     usernameField: "uname",
    1.30 +     passwordField: "pword",
    1.31 +     changes: {
    1.32 +       password: "SeCrEt$$$"
    1.33 +     }
    1.34 +   },
    1.35 +   { hostname: "http://www.example.com",
    1.36 +     realm: "login",
    1.37 +     username: "jack",
    1.38 +     password: "secretlogin"
    1.39 +   }
    1.40 +];
    1.41 +
    1.42 +// Password after first modify action has been performed
    1.43 +var passwords_after_first_change = [
    1.44 +   { hostname: "http://www.example.com",
    1.45 +     submitURL: "http://login.example.com",
    1.46 +     username: "joe",
    1.47 +     password: "SeCrEt$$$",
    1.48 +     usernameField: "uname",
    1.49 +     passwordField: "pword",
    1.50 +     changes: {
    1.51 +        username: "james"
    1.52 +     }
    1.53 +   },
    1.54 +   { hostname: "http://www.example.com",
    1.55 +     realm: "login",
    1.56 +     username: "jack",
    1.57 +     password: "secretlogin"
    1.58 +   }
    1.59 +];
    1.60 +
    1.61 +// Password after second modify action has been performed
    1.62 +var passwords_after_second_change = [
    1.63 +   { hostname: "http://www.example.com",
    1.64 +     submitURL: "http://login.example.com",
    1.65 +     username: "james",
    1.66 +     password: "SeCrEt$$$",
    1.67 +     usernameField: "uname",
    1.68 +     passwordField: "pword"
    1.69 +   },
    1.70 +   { hostname: "http://www.example.com",
    1.71 +     realm: "login",
    1.72 +     username: "jack",
    1.73 +     password: "secretlogin"
    1.74 +   }
    1.75 +];
    1.76 +
    1.77 +/*
    1.78 + * Test phases
    1.79 + */
    1.80 +
    1.81 +Phase('phase1', [
    1.82 +  [Passwords.add, passwords_initial],
    1.83 +  [Sync]
    1.84 +]);
    1.85 +
    1.86 +Phase('phase2', [
    1.87 +  [Sync],
    1.88 +  [Passwords.verify, passwords_initial],
    1.89 +  [Passwords.modify, passwords_initial],
    1.90 +  [Passwords.verify, passwords_after_first_change],
    1.91 +  [Sync]
    1.92 +]);
    1.93 +
    1.94 +Phase('phase3', [
    1.95 +  [Sync],
    1.96 +  [Windows.add, { private: true }],
    1.97 +  [Passwords.verify, passwords_after_first_change],
    1.98 +  [Passwords.modify, passwords_after_first_change],
    1.99 +  [Passwords.verify, passwords_after_second_change],
   1.100 +  [Sync]
   1.101 +]);
   1.102 +
   1.103 +Phase('phase4', [
   1.104 +  [Sync],
   1.105 +  [Passwords.verify, passwords_after_second_change]
   1.106 +]);
   1.107 +

mercurial