diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /toolkit/components/corroborator/test/xpcshell | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/components/corroborator/test/xpcshell')
-rw-r--r-- | toolkit/components/corroborator/test/xpcshell/data/privileged.xpi | bin | 0 -> 4659 bytes | |||
-rw-r--r-- | toolkit/components/corroborator/test/xpcshell/data/signed-amo.xpi | bin | 0 -> 4702 bytes | |||
-rw-r--r-- | toolkit/components/corroborator/test/xpcshell/data/signed-components.xpi | bin | 0 -> 6995 bytes | |||
-rw-r--r-- | toolkit/components/corroborator/test/xpcshell/data/signed-privileged.xpi | bin | 0 -> 4659 bytes | |||
-rw-r--r-- | toolkit/components/corroborator/test/xpcshell/data/unsigned.xpi | bin | 0 -> 528 bytes | |||
-rw-r--r-- | toolkit/components/corroborator/test/xpcshell/test_verify_jar.js | 31 | ||||
-rw-r--r-- | toolkit/components/corroborator/test/xpcshell/xpcshell.ini | 6 |
7 files changed, 37 insertions, 0 deletions
diff --git a/toolkit/components/corroborator/test/xpcshell/data/privileged.xpi b/toolkit/components/corroborator/test/xpcshell/data/privileged.xpi Binary files differnew file mode 100644 index 0000000000..c22acaacd2 --- /dev/null +++ b/toolkit/components/corroborator/test/xpcshell/data/privileged.xpi diff --git a/toolkit/components/corroborator/test/xpcshell/data/signed-amo.xpi b/toolkit/components/corroborator/test/xpcshell/data/signed-amo.xpi Binary files differnew file mode 100644 index 0000000000..e2ba7d6fd8 --- /dev/null +++ b/toolkit/components/corroborator/test/xpcshell/data/signed-amo.xpi diff --git a/toolkit/components/corroborator/test/xpcshell/data/signed-components.xpi b/toolkit/components/corroborator/test/xpcshell/data/signed-components.xpi Binary files differnew file mode 100644 index 0000000000..f27ac1fb73 --- /dev/null +++ b/toolkit/components/corroborator/test/xpcshell/data/signed-components.xpi diff --git a/toolkit/components/corroborator/test/xpcshell/data/signed-privileged.xpi b/toolkit/components/corroborator/test/xpcshell/data/signed-privileged.xpi Binary files differnew file mode 100644 index 0000000000..c22acaacd2 --- /dev/null +++ b/toolkit/components/corroborator/test/xpcshell/data/signed-privileged.xpi diff --git a/toolkit/components/corroborator/test/xpcshell/data/unsigned.xpi b/toolkit/components/corroborator/test/xpcshell/data/unsigned.xpi Binary files differnew file mode 100644 index 0000000000..9e10be5db3 --- /dev/null +++ b/toolkit/components/corroborator/test/xpcshell/data/unsigned.xpi diff --git a/toolkit/components/corroborator/test/xpcshell/test_verify_jar.js b/toolkit/components/corroborator/test/xpcshell/test_verify_jar.js new file mode 100644 index 0000000000..c1c98f4485 --- /dev/null +++ b/toolkit/components/corroborator/test/xpcshell/test_verify_jar.js @@ -0,0 +1,31 @@ +/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* vim: set sts=2 sw=2 et tw=80: */ +"use strict"; + +const { Corroborate } = ChromeUtils.importESModule( + "resource://gre/modules/Corroborate.sys.mjs" +); + +add_task(async function test_various_jars() { + let result = await Corroborate.verifyJar(do_get_file("data/unsigned.xpi")); + equal(result, false, "unsigned files do not verify"); + + result = await Corroborate.verifyJar(do_get_file("data/signed-amo.xpi")); + equal(result, false, "AMO signed files do not verify"); + + result = await Corroborate.verifyJar( + do_get_file("data/signed-privileged.xpi") + ); + equal(result, false, "Privileged signed files do not verify"); + + let missingFile = do_get_file("data"); + missingFile.append("missing.xpi"); + + result = await Corroborate.verifyJar(missingFile); + equal(result, false, "Missing (but expected) files do not verify"); + + result = await Corroborate.verifyJar( + do_get_file("data/signed-components.xpi") + ); + equal(result, true, "Components signed files do verify"); +}); diff --git a/toolkit/components/corroborator/test/xpcshell/xpcshell.ini b/toolkit/components/corroborator/test/xpcshell/xpcshell.ini new file mode 100644 index 0000000000..17d0b031b5 --- /dev/null +++ b/toolkit/components/corroborator/test/xpcshell/xpcshell.ini @@ -0,0 +1,6 @@ +[DEFAULT] +tags = corroborator +support-files = + data/** + +[test_verify_jar.js] |