test_addon_reconciling.js (1363B)
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 var 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 // We've changed the state, but don't want this profile to sync until phase5, 38 // so if we ran a validation now we'd be expecting to find errors. 39 [Addons.skipValidation], 40 ]); 41 Phase("phase04", [[EnsureTracking], [Addons.uninstall, [id]], [Sync]]); 42 43 // When we sync, the uninstall should take precedence because it was newer. 44 Phase("phase05", [[Sync]]); 45 Phase("phase06", [[Sync], [Addons.verifyNot, [id]]]);