services/sync/tests/tps/test_addon_nonrestartless_xpi.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1
michael@0 2 /* Any copyright is dedicated to the Public Domain.
michael@0 3 http://creativecommons.org/publicdomain/zero/1.0/ */
michael@0 4
michael@0 5 // This test verifies that install of extensions that require restart
michael@0 6 // syncs between profiles.
michael@0 7 EnableEngines(["addons"]);
michael@0 8
michael@0 9 let phases = {
michael@0 10 "phase01": "profile1",
michael@0 11 "phase02": "profile1",
michael@0 12 "phase03": "profile2",
michael@0 13 "phase04": "profile2",
michael@0 14 "phase05": "profile1",
michael@0 15 "phase06": "profile1",
michael@0 16 "phase07": "profile2",
michael@0 17 "phase08": "profile2",
michael@0 18 "phase09": "profile1",
michael@0 19 "phase10": "profile1",
michael@0 20 "phase11": "profile2",
michael@0 21 "phase12": "profile2",
michael@0 22 "phase13": "profile1",
michael@0 23 "phase14": "profile1",
michael@0 24 "phase15": "profile2",
michael@0 25 "phase16": "profile2"
michael@0 26 };
michael@0 27
michael@0 28 const id = "unsigned-xpi@tests.mozilla.org";
michael@0 29
michael@0 30 Phase("phase01", [
michael@0 31 [Addons.verifyNot, [id]],
michael@0 32 [Addons.install, [id]],
michael@0 33 [Sync]
michael@0 34 ]);
michael@0 35 Phase("phase02", [
michael@0 36 [Addons.verify, [id], STATE_ENABLED]
michael@0 37 ]);
michael@0 38 Phase("phase03", [
michael@0 39 [Addons.verifyNot, [id]],
michael@0 40 [Sync]
michael@0 41 ]);
michael@0 42 Phase("phase04", [
michael@0 43 [Addons.verify, [id], STATE_ENABLED],
michael@0 44 ]);
michael@0 45
michael@0 46 // Now we disable the add-on
michael@0 47 Phase("phase05", [
michael@0 48 [EnsureTracking],
michael@0 49 [Addons.setEnabled, [id], STATE_DISABLED],
michael@0 50 [Sync]
michael@0 51 ]);
michael@0 52 Phase("phase06", [
michael@0 53 [Addons.verify, [id], STATE_DISABLED],
michael@0 54 ]);
michael@0 55 Phase("phase07", [
michael@0 56 [Addons.verify, [id], STATE_ENABLED],
michael@0 57 [Sync]
michael@0 58 ]);
michael@0 59 Phase("phase08", [
michael@0 60 [Addons.verify, [id], STATE_DISABLED]
michael@0 61 ]);
michael@0 62
michael@0 63 // Now we re-enable it again.
michael@0 64 Phase("phase09", [
michael@0 65 [EnsureTracking],
michael@0 66 [Addons.setEnabled, [id], STATE_ENABLED],
michael@0 67 [Sync]
michael@0 68 ]);
michael@0 69 Phase("phase10", [
michael@0 70 [Addons.verify, [id], STATE_ENABLED],
michael@0 71 ]);
michael@0 72 Phase("phase11", [
michael@0 73 [Addons.verify, [id], STATE_DISABLED],
michael@0 74 [Sync]
michael@0 75 ]);
michael@0 76 Phase("phase12", [
michael@0 77 [Addons.verify, [id], STATE_ENABLED]
michael@0 78 ]);
michael@0 79
michael@0 80 // And we uninstall it
michael@0 81
michael@0 82 Phase("phase13", [
michael@0 83 [EnsureTracking],
michael@0 84 [Addons.verify, [id], STATE_ENABLED],
michael@0 85 [Addons.uninstall, [id]],
michael@0 86 [Sync]
michael@0 87 ]);
michael@0 88 Phase("phase14", [
michael@0 89 [Addons.verifyNot, [id]]
michael@0 90 ]);
michael@0 91 Phase("phase15", [
michael@0 92 [Addons.verify, [id], STATE_ENABLED],
michael@0 93 [Sync]
michael@0 94 ]);
michael@0 95 Phase("phase16", [
michael@0 96 [Addons.verifyNot, [id]]
michael@0 97 ]);

mercurial