diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /toolkit/components/corroborator/test/xpcshell | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
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.toml | 5 |
7 files changed, 36 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.toml b/toolkit/components/corroborator/test/xpcshell/xpcshell.toml new file mode 100644 index 0000000000..d30b8dfb17 --- /dev/null +++ b/toolkit/components/corroborator/test/xpcshell/xpcshell.toml @@ -0,0 +1,5 @@ +[DEFAULT] +tags = "corroborator" +support-files = ["data/**"] + +["test_verify_jar.js"] |