summaryrefslogtreecommitdiffstats
path: root/toolkit/mozapps/webextensions/test/xpcshell/test_dependencies.js
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2018-06-26 16:09:08 -0400
committerMatt A. Tobin <email@mattatobin.com>2018-06-26 16:09:08 -0400
commiteda567b364a06e9e63efb865a6b1c73f1cb5232e (patch)
tree912ab15d877f733318e2c0394713bca33b830547 /toolkit/mozapps/webextensions/test/xpcshell/test_dependencies.js
parent80eb356d57fc310cdf812cae63de30d6e56c1788 (diff)
downloadUXP-eda567b364a06e9e63efb865a6b1c73f1cb5232e.tar
UXP-eda567b364a06e9e63efb865a6b1c73f1cb5232e.tar.gz
UXP-eda567b364a06e9e63efb865a6b1c73f1cb5232e.tar.lz
UXP-eda567b364a06e9e63efb865a6b1c73f1cb5232e.tar.xz
UXP-eda567b364a06e9e63efb865a6b1c73f1cb5232e.zip
[AllAM] Remove Mozilla Tests
Diffstat (limited to 'toolkit/mozapps/webextensions/test/xpcshell/test_dependencies.js')
-rw-r--r--toolkit/mozapps/webextensions/test/xpcshell/test_dependencies.js144
1 files changed, 0 insertions, 144 deletions
diff --git a/toolkit/mozapps/webextensions/test/xpcshell/test_dependencies.js b/toolkit/mozapps/webextensions/test/xpcshell/test_dependencies.js
deleted file mode 100644
index 3afc03f84..000000000
--- a/toolkit/mozapps/webextensions/test/xpcshell/test_dependencies.js
+++ /dev/null
@@ -1,144 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-const profileDir = gProfD.clone();
-profileDir.append("extensions");
-
-createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1");
-startupManager();
-
-const BOOTSTRAP = String.raw`
- Components.utils.import("resource://gre/modules/Services.jsm");
-
- function startup(data) {
- Services.obs.notifyObservers(null, "test-addon-bootstrap-startup", data.id);
- }
- function shutdown(data) {
- Services.obs.notifyObservers(null, "test-addon-bootstrap-shutdown", data.id);
- }
- function install() {}
- function uninstall() {}
-`;
-
-const ADDONS = [
- {
- id: "addon1@dependency-test.mozilla.org",
- dependencies: ["addon2@dependency-test.mozilla.org"],
- },
- {
- id: "addon2@dependency-test.mozilla.org",
- dependencies: ["addon3@dependency-test.mozilla.org"],
- },
- {
- id: "addon3@dependency-test.mozilla.org",
- },
- {
- id: "addon4@dependency-test.mozilla.org",
- },
- {
- id: "addon5@dependency-test.mozilla.org",
- dependencies: ["addon2@dependency-test.mozilla.org"],
- },
-];
-
-let addonFiles = [];
-
-let events = [];
-add_task(function* setup() {
- let startupObserver = (subject, topic, data) => {
- events.push(["startup", data]);
- };
- let shutdownObserver = (subject, topic, data) => {
- events.push(["shutdown", data]);
- };
-
- Services.obs.addObserver(startupObserver, "test-addon-bootstrap-startup", false);
- Services.obs.addObserver(shutdownObserver, "test-addon-bootstrap-shutdown", false);
- do_register_cleanup(() => {
- Services.obs.removeObserver(startupObserver, "test-addon-bootstrap-startup");
- Services.obs.removeObserver(shutdownObserver, "test-addon-bootstrap-shutdown");
- });
-
- for (let addon of ADDONS) {
- Object.assign(addon, {
- targetApplications: [{
- id: "xpcshell@tests.mozilla.org",
- minVersion: "1",
- maxVersion: "1",
- }],
- version: "1.0",
- name: addon.id,
- bootstrap: true,
- });
-
- addonFiles.push(createTempXPIFile(addon, {"bootstrap.js": BOOTSTRAP}));
- }
-});
-
-add_task(function*() {
- deepEqual(events, [], "Should have no events");
-
- yield promiseInstallAllFiles([addonFiles[3]]);
-
- deepEqual(events, [
- ["startup", ADDONS[3].id],
- ]);
-
- events.length = 0;
-
- yield promiseInstallAllFiles([addonFiles[0]]);
- deepEqual(events, [], "Should have no events");
-
- yield promiseInstallAllFiles([addonFiles[1]]);
- deepEqual(events, [], "Should have no events");
-
- yield promiseInstallAllFiles([addonFiles[2]]);
-
- deepEqual(events, [
- ["startup", ADDONS[2].id],
- ["startup", ADDONS[1].id],
- ["startup", ADDONS[0].id],
- ]);
-
- events.length = 0;
-
- yield promiseInstallAllFiles([addonFiles[2]]);
-
- deepEqual(events, [
- ["shutdown", ADDONS[0].id],
- ["shutdown", ADDONS[1].id],
- ["shutdown", ADDONS[2].id],
-
- ["startup", ADDONS[2].id],
- ["startup", ADDONS[1].id],
- ["startup", ADDONS[0].id],
- ]);
-
- events.length = 0;
-
- yield promiseInstallAllFiles([addonFiles[4]]);
-
- deepEqual(events, [
- ["startup", ADDONS[4].id],
- ]);
-
- events.length = 0;
-
- yield promiseRestartManager();
-
- deepEqual(events, [
- ["shutdown", ADDONS[4].id],
- ["shutdown", ADDONS[3].id],
- ["shutdown", ADDONS[0].id],
- ["shutdown", ADDONS[1].id],
- ["shutdown", ADDONS[2].id],
-
- ["startup", ADDONS[2].id],
- ["startup", ADDONS[1].id],
- ["startup", ADDONS[0].id],
- ["startup", ADDONS[3].id],
- ["startup", ADDONS[4].id],
- ]);
-});
-