summaryrefslogtreecommitdiffstats
path: root/toolkit/mozapps/extensions/test/xpcshell/test_addonStartup.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:44:51 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:44:51 +0000
commit9e3c08db40b8916968b9f30096c7be3f00ce9647 (patch)
treea68f146d7fa01f0134297619fbe7e33db084e0aa /toolkit/mozapps/extensions/test/xpcshell/test_addonStartup.js
parentInitial commit. (diff)
downloadthunderbird-9e3c08db40b8916968b9f30096c7be3f00ce9647.tar.xz
thunderbird-9e3c08db40b8916968b9f30096c7be3f00ce9647.zip
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/mozapps/extensions/test/xpcshell/test_addonStartup.js')
-rw-r--r--toolkit/mozapps/extensions/test/xpcshell/test_addonStartup.js93
1 files changed, 93 insertions, 0 deletions
diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_addonStartup.js b/toolkit/mozapps/extensions/test/xpcshell/test_addonStartup.js
new file mode 100644
index 0000000000..715b74a068
--- /dev/null
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_addonStartup.js
@@ -0,0 +1,93 @@
+"use strict";
+
+add_task(async function test_XPIStates_invalid_paths() {
+ let { path } = gAddonStartup;
+
+ let startupDatasets = [
+ {
+ "app-profile": {
+ addons: {
+ "xpcshell-something-or-other@mozilla.org": {
+ bootstrapped: true,
+ dependencies: [],
+ enabled: true,
+ hasEmbeddedWebExtension: false,
+ lastModifiedTime: 1,
+ path: "xpcshell-something-or-other@mozilla.org",
+ version: "0.0.0",
+ },
+ },
+ checkStartupModifications: true,
+ path: "/home/xpcshell/.mozilla/firefox/default/extensions",
+ },
+ },
+ {
+ "app-profile": {
+ addons: {
+ "xpcshell-something-or-other@mozilla.org": {
+ bootstrapped: true,
+ dependencies: [],
+ enabled: true,
+ hasEmbeddedWebExtension: false,
+ lastModifiedTime: 1,
+ path: "xpcshell-something-or-other@mozilla.org",
+ version: "0.0.0",
+ },
+ },
+ checkStartupModifications: true,
+ path: "c:\\Users\\XpcShell\\Application Data\\Mozilla Firefox\\Profiles\\meh",
+ },
+ },
+ {
+ "app-profile": {
+ addons: {
+ "xpcshell-something-or-other@mozilla.org": {
+ bootstrapped: true,
+ dependencies: [],
+ enabled: true,
+ hasEmbeddedWebExtension: false,
+ lastModifiedTime: 1,
+ path: "/home/xpcshell/my-extensions/something-or-other",
+ version: "0.0.0",
+ },
+ },
+ checkStartupModifications: true,
+ path: "/home/xpcshell/.mozilla/firefox/default/extensions",
+ },
+ },
+ {
+ "app-profile": {
+ addons: {
+ "xpcshell-something-or-other@mozilla.org": {
+ bootstrapped: true,
+ dependencies: [],
+ enabled: true,
+ hasEmbeddedWebExtension: false,
+ lastModifiedTime: 1,
+ path: "c:\\Users\\XpcShell\\my-extensions\\something-or-other",
+ version: "0.0.0",
+ },
+ },
+ checkStartupModifications: true,
+ path: "c:\\Users\\XpcShell\\Application Data\\Mozilla Firefox\\Profiles\\meh",
+ },
+ },
+ ];
+
+ for (let startupData of startupDatasets) {
+ await IOUtils.writeJSON(path, startupData, { compress: true });
+
+ try {
+ let result = aomStartup.readStartupData();
+ info(`readStartupData() returned ${JSON.stringify(result)}`);
+ } catch (e) {
+ // We don't care if this throws, only that it doesn't crash.
+ info(`readStartupData() threw: ${e}`);
+ equal(
+ e.result,
+ Cr.NS_ERROR_FILE_UNRECOGNIZED_PATH,
+ "Got expected error code"
+ );
+ }
+ }
+});