services/sync/tests/tps/test_privbrw_formdata.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.

     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(["forms"]);
    11 var phases = { "phase1": "profile1",
    12                "phase2": "profile2",
    13                "phase3": "profile1",
    14                "phase4": "profile2" };
    16 /*
    17  * Form data
    18  */
    20 // the form data to add to the browser
    21 var formdata1 = [
    22    { fieldname: "name",
    23      value: "xyz",
    24      date: -1
    25    },
    26    { fieldname: "email",
    27      value: "abc@gmail.com",
    28      date: -2
    29    },
    30    { fieldname: "username",
    31      value: "joe"
    32    }
    33 ];
    35 // the form data to add in private browsing mode
    36 var formdata2 = [
    37    { fieldname: "password",
    38      value: "secret",
    39      date: -1
    40    },
    41    { fieldname: "city",
    42      value: "mtview"
    43    }
    44 ];
    46 /*
    47  * Test phases
    48  */
    50 Phase('phase1', [
    51   [Formdata.add, formdata1],
    52   [Formdata.verify, formdata1],
    53   [Sync]
    54 ]);
    56 Phase('phase2', [
    57   [Sync],
    58   [Formdata.verify, formdata1]
    59 ]);
    61 Phase('phase3', [
    62   [Sync],
    63   [Windows.add, { private: true }],
    64   [Formdata.add, formdata2],
    65   [Formdata.verify, formdata2],
    66   [Sync],
    67 ]);
    69 Phase('phase4', [
    70   [Sync],
    71   [Formdata.verify, formdata1],
    72   [Formdata.verifyNot, formdata2]
    73 ]);

mercurial