1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/services/sync/tests/tps/test_addon_restartless_xpi.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,70 @@ 1.4 +/* Any copyright is dedicated to the Public Domain. 1.5 + http://creativecommons.org/publicdomain/zero/1.0/ */ 1.6 + 1.7 +// This test verifies that install of restartless extensions syncs to 1.8 +// other profiles. 1.9 +EnableEngines(["addons"]); 1.10 + 1.11 +let phases = { 1.12 + "phase01": "profile1", 1.13 + "phase02": "profile2", 1.14 + "phase03": "profile1", 1.15 + "phase04": "profile2", 1.16 + "phase05": "profile1", 1.17 + "phase06": "profile2", 1.18 + "phase07": "profile1", 1.19 + "phase08": "profile2" 1.20 +}; 1.21 + 1.22 +const id = "restartless-xpi@tests.mozilla.org"; 1.23 + 1.24 +// Verify install is synced 1.25 +Phase("phase01", [ 1.26 + [Addons.verifyNot, [id]], 1.27 + [Addons.install, [id]], 1.28 + [Addons.verify, [id], STATE_ENABLED], 1.29 + [Sync] 1.30 +]); 1.31 +Phase("phase02", [ 1.32 + [Addons.verifyNot, [id]], 1.33 + [Sync], 1.34 + [Addons.verify, [id], STATE_ENABLED] 1.35 +]); 1.36 + 1.37 +// Now disable and see that is is synced. 1.38 +Phase("phase03", [ 1.39 + [EnsureTracking], 1.40 + [Addons.setEnabled, [id], STATE_DISABLED], 1.41 + [Addons.verify, [id], STATE_DISABLED], 1.42 + [Sync] 1.43 +]); 1.44 +Phase("phase04", [ 1.45 + [Sync], 1.46 + [Addons.verify, [id], STATE_DISABLED] 1.47 +]); 1.48 + 1.49 +// Enable and see it is synced. 1.50 +Phase("phase05", [ 1.51 + [EnsureTracking], 1.52 + [Addons.setEnabled, [id], STATE_ENABLED], 1.53 + [Addons.verify, [id], STATE_ENABLED], 1.54 + [Sync] 1.55 +]); 1.56 +Phase("phase06", [ 1.57 + [Sync], 1.58 + [Addons.verify, [id], STATE_ENABLED] 1.59 +]); 1.60 + 1.61 +// Uninstall and see it is synced. 1.62 +Phase("phase07", [ 1.63 + [EnsureTracking], 1.64 + [Addons.verify, [id], STATE_ENABLED], 1.65 + [Addons.uninstall, [id]], 1.66 + [Addons.verifyNot, [id]], 1.67 + [Sync] 1.68 +]); 1.69 +Phase("phase08", [ 1.70 + [Addons.verify, [id], STATE_ENABLED], 1.71 + [Sync], 1.72 + [Addons.verifyNot, [id]] 1.73 +]);