services/sync/tests/tps/test_addon_reconciling.js

branch
TOR_BUG_3246
changeset 4
fc2d59ddac77
equal deleted inserted replaced
-1:000000000000 0:35e16cf32209
1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
3
4 // This test verifies that record reconciling works as expected. It makes
5 // similar changes to add-ons in separate profiles and does a sync to verify
6 // the proper action is taken.
7 EnableEngines(["addons"]);
8
9 let phases = {
10 "phase01": "profile1",
11 "phase02": "profile2",
12 "phase03": "profile1",
13 "phase04": "profile2",
14 "phase05": "profile1",
15 "phase06": "profile2"
16 };
17
18 const id = "restartless-xpi@tests.mozilla.org";
19
20 // Install the add-on in 2 profiles.
21 Phase("phase01", [
22 [Addons.verifyNot, [id]],
23 [Addons.install, [id]],
24 [Addons.verify, [id], STATE_ENABLED],
25 [Sync]
26 ]);
27 Phase("phase02", [
28 [Addons.verifyNot, [id]],
29 [Sync],
30 [Addons.verify, [id], STATE_ENABLED]
31 ]);
32
33 // Now we disable in one and uninstall in the other.
34 Phase("phase03", [
35 [Sync], // Get GUID updates, potentially.
36 [Addons.setEnabled, [id], STATE_DISABLED],
37 ]);
38 Phase("phase04", [
39 [EnsureTracking],
40 [Addons.uninstall, [id]],
41 [Sync]
42 ]);
43
44 // When we sync, the uninstall should take precedence because it was newer.
45 Phase("phase05", [
46 [Sync]
47 ]);
48 Phase("phase06", [
49 [Sync],
50 [Addons.verifyNot, [id]]
51 ]);

mercurial