1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/services/sync/tests/tps/test_privbrw_formdata.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,73 @@ 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(["forms"]); 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 + * Form data 1.21 + */ 1.22 + 1.23 +// the form data to add to the browser 1.24 +var formdata1 = [ 1.25 + { fieldname: "name", 1.26 + value: "xyz", 1.27 + date: -1 1.28 + }, 1.29 + { fieldname: "email", 1.30 + value: "abc@gmail.com", 1.31 + date: -2 1.32 + }, 1.33 + { fieldname: "username", 1.34 + value: "joe" 1.35 + } 1.36 +]; 1.37 + 1.38 +// the form data to add in private browsing mode 1.39 +var formdata2 = [ 1.40 + { fieldname: "password", 1.41 + value: "secret", 1.42 + date: -1 1.43 + }, 1.44 + { fieldname: "city", 1.45 + value: "mtview" 1.46 + } 1.47 +]; 1.48 + 1.49 +/* 1.50 + * Test phases 1.51 + */ 1.52 + 1.53 +Phase('phase1', [ 1.54 + [Formdata.add, formdata1], 1.55 + [Formdata.verify, formdata1], 1.56 + [Sync] 1.57 +]); 1.58 + 1.59 +Phase('phase2', [ 1.60 + [Sync], 1.61 + [Formdata.verify, formdata1] 1.62 +]); 1.63 + 1.64 +Phase('phase3', [ 1.65 + [Sync], 1.66 + [Windows.add, { private: true }], 1.67 + [Formdata.add, formdata2], 1.68 + [Formdata.verify, formdata2], 1.69 + [Sync], 1.70 +]); 1.71 + 1.72 +Phase('phase4', [ 1.73 + [Sync], 1.74 + [Formdata.verify, formdata1], 1.75 + [Formdata.verifyNot, formdata2] 1.76 +]);