services/sync/tests/tps/test_formdata.js

Wed, 31 Dec 2014 07:22:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:22:50 +0100
branch
TOR_BUG_3246
changeset 4
fc2d59ddac77
permissions
-rw-r--r--

Correct previous dual key logic pending first delivery installment.

michael@0 1 /* Any copyright is dedicated to the Public Domain.
michael@0 2 http://creativecommons.org/publicdomain/zero/1.0/ */
michael@0 3
michael@0 4 /*
michael@0 5 * The list of phases mapped to their corresponding profiles. The object
michael@0 6 * here must be in strict JSON format, as it will get parsed by the Python
michael@0 7 * testrunner (no single quotes, extra comma's, etc).
michael@0 8 */
michael@0 9 EnableEngines(["forms"]);
michael@0 10
michael@0 11 var phases = { "phase1": "profile1",
michael@0 12 "phase2": "profile2",
michael@0 13 "phase3": "profile1",
michael@0 14 "phase4": "profile2" };
michael@0 15
michael@0 16 /*
michael@0 17 * Form data asset lists: these define form values that are used in the tests.
michael@0 18 */
michael@0 19
michael@0 20 var formdata1 = [
michael@0 21 { fieldname: "testing",
michael@0 22 value: "success",
michael@0 23 date: -1
michael@0 24 },
michael@0 25 { fieldname: "testing",
michael@0 26 value: "failure",
michael@0 27 date: -2
michael@0 28 },
michael@0 29 { fieldname: "username",
michael@0 30 value: "joe"
michael@0 31 }
michael@0 32 ];
michael@0 33
michael@0 34 var formdata2 = [
michael@0 35 { fieldname: "testing",
michael@0 36 value: "success",
michael@0 37 date: -1
michael@0 38 },
michael@0 39 { fieldname: "username",
michael@0 40 value: "joe"
michael@0 41 }
michael@0 42 ];
michael@0 43
michael@0 44 var formdata_delete = [
michael@0 45 { fieldname: "testing",
michael@0 46 value: "failure"
michael@0 47 }
michael@0 48 ];
michael@0 49
michael@0 50 /*
michael@0 51 * Test phases
michael@0 52 */
michael@0 53
michael@0 54 Phase('phase1', [
michael@0 55 [Formdata.add, formdata1],
michael@0 56 [Formdata.verify, formdata1],
michael@0 57 [Sync]
michael@0 58 ]);
michael@0 59
michael@0 60 Phase('phase2', [
michael@0 61 [Sync],
michael@0 62 [Formdata.verify, formdata1],
michael@0 63 ]);
michael@0 64
michael@0 65 /*
michael@0 66 * Note: Weave does not support syncing deleted form data, so those
michael@0 67 * tests are disabled below. See bug 568363.
michael@0 68 */
michael@0 69
michael@0 70 Phase('phase3', [
michael@0 71 [Sync],
michael@0 72 [Formdata.delete, formdata_delete],
michael@0 73 //[Formdata.verifyNot, formdata_delete],
michael@0 74 [Formdata.verify, formdata2],
michael@0 75 [Sync],
michael@0 76 ]);
michael@0 77
michael@0 78 Phase('phase4', [
michael@0 79 [Sync],
michael@0 80 [Formdata.verify, formdata2],
michael@0 81 //[Formdata.verifyNot, formdata_delete]
michael@0 82 ]);
michael@0 83
michael@0 84

mercurial