summaryrefslogtreecommitdiffstats
path: root/toolkit/mozapps/webextensions/test/xpcshell/test_seen_newprofile.js
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2018-02-10 02:51:36 -0500
committerMatt A. Tobin <email@mattatobin.com>2018-02-10 02:51:36 -0500
commit37d5300335d81cecbecc99812747a657588c63eb (patch)
tree765efa3b6a56bb715d9813a8697473e120436278 /toolkit/mozapps/webextensions/test/xpcshell/test_seen_newprofile.js
parentb2bdac20c02b12f2057b9ef70b0a946113a00e00 (diff)
parent4fb11cd5966461bccc3ed1599b808237be6b0de9 (diff)
downloadUXP-37d5300335d81cecbecc99812747a657588c63eb.tar
UXP-37d5300335d81cecbecc99812747a657588c63eb.tar.gz
UXP-37d5300335d81cecbecc99812747a657588c63eb.tar.lz
UXP-37d5300335d81cecbecc99812747a657588c63eb.tar.xz
UXP-37d5300335d81cecbecc99812747a657588c63eb.zip
Merge branch 'ext-work'
Diffstat (limited to 'toolkit/mozapps/webextensions/test/xpcshell/test_seen_newprofile.js')
-rw-r--r--toolkit/mozapps/webextensions/test/xpcshell/test_seen_newprofile.js41
1 files changed, 41 insertions, 0 deletions
diff --git a/toolkit/mozapps/webextensions/test/xpcshell/test_seen_newprofile.js b/toolkit/mozapps/webextensions/test/xpcshell/test_seen_newprofile.js
new file mode 100644
index 000000000..43ee18594
--- /dev/null
+++ b/toolkit/mozapps/webextensions/test/xpcshell/test_seen_newprofile.js
@@ -0,0 +1,41 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/
+ */
+
+const ID = "bootstrap1@tests.mozilla.org";
+
+Services.prefs.setIntPref("extensions.enabledScopes",
+ AddonManager.SCOPE_PROFILE + AddonManager.SCOPE_SYSTEM);
+
+createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
+
+BootstrapMonitor.init();
+
+const globalDir = gProfD.clone();
+globalDir.append("extensions2");
+globalDir.append(gAppInfo.ID);
+registerDirectory("XRESysSExtPD", globalDir.parent);
+const profileDir = gProfD.clone();
+profileDir.append("extensions");
+
+// By default disable add-ons from the system
+Services.prefs.setIntPref("extensions.autoDisableScopes", AddonManager.SCOPE_SYSTEM);
+
+// When new add-ons already exist in a system location when starting with a new
+// profile they should be marked as already seen.
+add_task(function*() {
+ manuallyInstall(do_get_addon("test_bootstrap1_1"), globalDir, ID);
+
+ startupManager();
+
+ let addon = yield promiseAddonByID(ID);
+ do_check_true(addon.foreignInstall);
+ do_check_true(addon.seen);
+ do_check_true(addon.userDisabled);
+ do_check_false(addon.isActive);
+
+ BootstrapMonitor.checkAddonInstalled(ID);
+ BootstrapMonitor.checkAddonNotStarted(ID);
+
+ yield promiseShutdownManager();
+});