summaryrefslogtreecommitdiffstats
path: root/services/sync/tests/tps/test_addon_nonrestartless_xpi.js
blob: b6c85b35157258aa7e33553cb317d5e12a72a7e8 (plain)
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

/* Any copyright is dedicated to the Public Domain.
   http://creativecommons.org/publicdomain/zero/1.0/ */

// This test verifies that install of extensions that require restart
// syncs between profiles.
EnableEngines(["addons"]);

var phases = {
  "phase01": "profile1",
  "phase02": "profile1",
  "phase03": "profile2",
  "phase04": "profile2",
  "phase05": "profile1",
  "phase06": "profile1",
  "phase07": "profile2",
  "phase08": "profile2",
  "phase09": "profile1",
  "phase10": "profile1",
  "phase11": "profile2",
  "phase12": "profile2",
  "phase13": "profile1",
  "phase14": "profile1",
  "phase15": "profile2",
  "phase16": "profile2"
};

const id = "unsigned-xpi@tests.mozilla.org";

Phase("phase01", [
  [Addons.verifyNot, [id]],
  [Addons.install, [id]],
  [Sync]
]);
Phase("phase02", [
  [Addons.verify, [id], STATE_ENABLED],
  [Sync]
]);
Phase("phase03", [
  [Addons.verifyNot, [id]],
  [Sync]
]);
Phase("phase04", [
  [Addons.verify, [id], STATE_ENABLED],
  [Sync]
]);

// Now we disable the add-on
Phase("phase05", [
  [EnsureTracking],
  [Addons.setEnabled, [id], STATE_DISABLED],
  [Sync]
]);
Phase("phase06", [
  [Addons.verify, [id], STATE_DISABLED],
  [Sync]
]);
Phase("phase07", [
  [Addons.verify, [id], STATE_ENABLED],
  [Sync]
]);
Phase("phase08", [
  [Addons.verify, [id], STATE_DISABLED],
  [Sync]
]);

// Now we re-enable it again.
Phase("phase09", [
  [EnsureTracking],
  [Addons.setEnabled, [id], STATE_ENABLED],
  [Sync]
]);
Phase("phase10", [
  [Addons.verify, [id], STATE_ENABLED],
  [Sync]
]);
Phase("phase11", [
  [Addons.verify, [id], STATE_DISABLED],
  [Sync]
]);
Phase("phase12", [
  [Addons.verify, [id], STATE_ENABLED],
  [Sync]
]);

// And we uninstall it

Phase("phase13", [
  [EnsureTracking],
  [Addons.verify, [id], STATE_ENABLED],
  [Addons.uninstall, [id]],
  [Sync]
]);
Phase("phase14", [
  [Addons.verifyNot, [id]],
  [Sync]
]);
Phase("phase15", [
  [Addons.verify, [id], STATE_ENABLED],
  [Sync]
]);
Phase("phase16", [
  [Addons.verifyNot, [id]],
  [Sync]
]);