1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/services/sync/tests/tps/test_addon_nonrestartless_xpi.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,97 @@ 1.4 + 1.5 +/* Any copyright is dedicated to the Public Domain. 1.6 + http://creativecommons.org/publicdomain/zero/1.0/ */ 1.7 + 1.8 +// This test verifies that install of extensions that require restart 1.9 +// syncs between profiles. 1.10 +EnableEngines(["addons"]); 1.11 + 1.12 +let phases = { 1.13 + "phase01": "profile1", 1.14 + "phase02": "profile1", 1.15 + "phase03": "profile2", 1.16 + "phase04": "profile2", 1.17 + "phase05": "profile1", 1.18 + "phase06": "profile1", 1.19 + "phase07": "profile2", 1.20 + "phase08": "profile2", 1.21 + "phase09": "profile1", 1.22 + "phase10": "profile1", 1.23 + "phase11": "profile2", 1.24 + "phase12": "profile2", 1.25 + "phase13": "profile1", 1.26 + "phase14": "profile1", 1.27 + "phase15": "profile2", 1.28 + "phase16": "profile2" 1.29 +}; 1.30 + 1.31 +const id = "unsigned-xpi@tests.mozilla.org"; 1.32 + 1.33 +Phase("phase01", [ 1.34 + [Addons.verifyNot, [id]], 1.35 + [Addons.install, [id]], 1.36 + [Sync] 1.37 +]); 1.38 +Phase("phase02", [ 1.39 + [Addons.verify, [id], STATE_ENABLED] 1.40 +]); 1.41 +Phase("phase03", [ 1.42 + [Addons.verifyNot, [id]], 1.43 + [Sync] 1.44 +]); 1.45 +Phase("phase04", [ 1.46 + [Addons.verify, [id], STATE_ENABLED], 1.47 +]); 1.48 + 1.49 +// Now we disable the add-on 1.50 +Phase("phase05", [ 1.51 + [EnsureTracking], 1.52 + [Addons.setEnabled, [id], STATE_DISABLED], 1.53 + [Sync] 1.54 +]); 1.55 +Phase("phase06", [ 1.56 + [Addons.verify, [id], STATE_DISABLED], 1.57 +]); 1.58 +Phase("phase07", [ 1.59 + [Addons.verify, [id], STATE_ENABLED], 1.60 + [Sync] 1.61 +]); 1.62 +Phase("phase08", [ 1.63 + [Addons.verify, [id], STATE_DISABLED] 1.64 +]); 1.65 + 1.66 +// Now we re-enable it again. 1.67 +Phase("phase09", [ 1.68 + [EnsureTracking], 1.69 + [Addons.setEnabled, [id], STATE_ENABLED], 1.70 + [Sync] 1.71 +]); 1.72 +Phase("phase10", [ 1.73 + [Addons.verify, [id], STATE_ENABLED], 1.74 +]); 1.75 +Phase("phase11", [ 1.76 + [Addons.verify, [id], STATE_DISABLED], 1.77 + [Sync] 1.78 +]); 1.79 +Phase("phase12", [ 1.80 + [Addons.verify, [id], STATE_ENABLED] 1.81 +]); 1.82 + 1.83 +// And we uninstall it 1.84 + 1.85 +Phase("phase13", [ 1.86 + [EnsureTracking], 1.87 + [Addons.verify, [id], STATE_ENABLED], 1.88 + [Addons.uninstall, [id]], 1.89 + [Sync] 1.90 +]); 1.91 +Phase("phase14", [ 1.92 + [Addons.verifyNot, [id]] 1.93 +]); 1.94 +Phase("phase15", [ 1.95 + [Addons.verify, [id], STATE_ENABLED], 1.96 + [Sync] 1.97 +]); 1.98 +Phase("phase16", [ 1.99 + [Addons.verifyNot, [id]] 1.100 +]);