services/sync/tests/tps/test_privbrw_formdata.js

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:cafe1bf7f445
1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
3
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"]);
10
11 var phases = { "phase1": "profile1",
12 "phase2": "profile2",
13 "phase3": "profile1",
14 "phase4": "profile2" };
15
16 /*
17 * Form data
18 */
19
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 ];
34
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 ];
45
46 /*
47 * Test phases
48 */
49
50 Phase('phase1', [
51 [Formdata.add, formdata1],
52 [Formdata.verify, formdata1],
53 [Sync]
54 ]);
55
56 Phase('phase2', [
57 [Sync],
58 [Formdata.verify, formdata1]
59 ]);
60
61 Phase('phase3', [
62 [Sync],
63 [Windows.add, { private: true }],
64 [Formdata.add, formdata2],
65 [Formdata.verify, formdata2],
66 [Sync],
67 ]);
68
69 Phase('phase4', [
70 [Sync],
71 [Formdata.verify, formdata1],
72 [Formdata.verifyNot, formdata2]
73 ]);

mercurial