1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
|
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
EnableEngines(["addons"]);
/*
* The list of phases mapped to their corresponding profiles. The object
* here must be in JSON format as it will get parsed by the Python
* testrunner. It is parsed by the YAML package, so it relatively flexible.
*/
var phases = {
phase1: "profile1",
phase2: "profile2",
phase3: "profile1",
phase4: "profile2",
phase5: "profile1",
};
/*
* Test phases
*/
Phase("phase1", [
[
ExtStorage.set,
"ext-1",
{
"key-1": {
sub_key_1: "value 1",
sub_key_2: "value 2",
},
"key-2": {
sk_1: "v1",
sk_2: "v2",
},
},
],
[
ExtStorage.verify,
"ext-1",
null,
{
"key-1": {
sub_key_1: "value 1",
sub_key_2: "value 2",
},
"key-2": {
sk_1: "v1",
sk_2: "v2",
},
},
],
[Sync],
]);
Phase("phase2", [
[Sync],
[
ExtStorage.set,
"ext-1",
{
"key-2": "value from profile 2",
},
],
[
ExtStorage.verify,
"ext-1",
null,
{
"key-1": {
sub_key_1: "value 1",
sub_key_2: "value 2",
},
"key-2": "value from profile 2",
},
],
[Sync],
]);
Phase("phase3", [
[Sync],
[
ExtStorage.verify,
"ext-1",
null,
{
"key-1": {
sub_key_1: "value 1",
sub_key_2: "value 2",
},
"key-2": "value from profile 2",
},
],
[
ExtStorage.set,
"ext-1",
{
"key-2": "value from profile 1",
},
],
// exit without syncing.
]);
Phase("phase4", [
[Sync],
[
ExtStorage.verify,
"ext-1",
null,
{
"key-1": {
sub_key_1: "value 1",
sub_key_2: "value 2",
},
"key-2": "value from profile 2",
},
],
[
ExtStorage.set,
"ext-1",
{
"key-2": "second value from profile 2",
},
],
[Sync],
]);
Phase("phase5", [
[
ExtStorage.verify,
"ext-1",
null,
{
"key-1": {
sub_key_1: "value 1",
sub_key_2: "value 2",
},
"key-2": "value from profile 1",
},
],
[Sync],
[
ExtStorage.verify,
"ext-1",
null,
{
"key-1": {
sub_key_1: "value 1",
sub_key_2: "value 2",
},
"key-2": "second value from profile 2",
},
],
]);
|