services/sync/tests/tps/test_addon_reconciling.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

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

mercurial