diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /toolkit/crashreporter/test/unit/test_crash_modules_linux.js | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-adbda400be353e676059e335c3c0aaf99e719475.tar.xz firefox-adbda400be353e676059e335c3c0aaf99e719475.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/crashreporter/test/unit/test_crash_modules_linux.js')
-rw-r--r-- | toolkit/crashreporter/test/unit/test_crash_modules_linux.js | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/toolkit/crashreporter/test/unit/test_crash_modules_linux.js b/toolkit/crashreporter/test/unit/test_crash_modules_linux.js new file mode 100644 index 0000000000..9fcf587308 --- /dev/null +++ b/toolkit/crashreporter/test/unit/test_crash_modules_linux.js @@ -0,0 +1,33 @@ +add_task(async function run_test() { + if (!("@mozilla.org/toolkit/crash-reporter;1" in Cc)) { + dump( + "INFO | test_crash_modules.js | Can't test crashreporter in a non-libxul build.\n" + ); + return; + } + + await do_crash( + function () { + crashType = CrashTestUtils.CRASH_ABORT; + }, + async function (mdump, extra, extraFile) { + runMinidumpAnalyzer(mdump); + + // Refresh updated extra data + extra = await IOUtils.readJSON(extraFile.path); + + // Check modules' versions + const modules = extra.StackTraces.modules; + const version_regexp = /^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$/; + + for (let module of modules) { + console.debug("module", module); + console.debug("version => ", module.version); + console.debug("version regex => ", version_regexp.exec(module.version)); + Assert.notEqual(version_regexp.exec(module.version), null); + } + }, + // process will exit with a zero exit status + true + ); +}); |