services/sync/tests/tps/test_privbrw_passwords.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 /* Any copyright is dedicated to the Public Domain.
     2    http://creativecommons.org/publicdomain/zero/1.0/ */
     4 /*
     5  * The list of phases mapped to their corresponding profiles.  The object
     6  * here must be in strict JSON format, as it will get parsed by the Python
     7  * testrunner (no single quotes, extra comma's, etc).
     8  */
     9 EnableEngines(["passwords"]);
    11 var phases = { "phase1": "profile1",
    12                "phase2": "profile2",
    13                "phase3": "profile1",
    14                "phase4": "profile2" };
    16 /*
    17  * Password data
    18  */
    20 // Initial password data
    21 var passwords_initial = [
    22    { hostname: "http://www.example.com",
    23      submitURL: "http://login.example.com",
    24      username: "joe",
    25      password: "secret",
    26      usernameField: "uname",
    27      passwordField: "pword",
    28      changes: {
    29        password: "SeCrEt$$$"
    30      }
    31    },
    32    { hostname: "http://www.example.com",
    33      realm: "login",
    34      username: "jack",
    35      password: "secretlogin"
    36    }
    37 ];
    39 // Password after first modify action has been performed
    40 var passwords_after_first_change = [
    41    { hostname: "http://www.example.com",
    42      submitURL: "http://login.example.com",
    43      username: "joe",
    44      password: "SeCrEt$$$",
    45      usernameField: "uname",
    46      passwordField: "pword",
    47      changes: {
    48         username: "james"
    49      }
    50    },
    51    { hostname: "http://www.example.com",
    52      realm: "login",
    53      username: "jack",
    54      password: "secretlogin"
    55    }
    56 ];
    58 // Password after second modify action has been performed
    59 var passwords_after_second_change = [
    60    { hostname: "http://www.example.com",
    61      submitURL: "http://login.example.com",
    62      username: "james",
    63      password: "SeCrEt$$$",
    64      usernameField: "uname",
    65      passwordField: "pword"
    66    },
    67    { hostname: "http://www.example.com",
    68      realm: "login",
    69      username: "jack",
    70      password: "secretlogin"
    71    }
    72 ];
    74 /*
    75  * Test phases
    76  */
    78 Phase('phase1', [
    79   [Passwords.add, passwords_initial],
    80   [Sync]
    81 ]);
    83 Phase('phase2', [
    84   [Sync],
    85   [Passwords.verify, passwords_initial],
    86   [Passwords.modify, passwords_initial],
    87   [Passwords.verify, passwords_after_first_change],
    88   [Sync]
    89 ]);
    91 Phase('phase3', [
    92   [Sync],
    93   [Windows.add, { private: true }],
    94   [Passwords.verify, passwords_after_first_change],
    95   [Passwords.modify, passwords_after_first_change],
    96   [Passwords.verify, passwords_after_second_change],
    97   [Sync]
    98 ]);
   100 Phase('phase4', [
   101   [Sync],
   102   [Passwords.verify, passwords_after_second_change]
   103 ]);

mercurial