toolkit/crashreporter/test/unit/test_crash_runtimeabort.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/crashreporter/test/unit/test_crash_runtimeabort.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,21 @@
     1.4 +function run_test()
     1.5 +{
     1.6 +  if (!("@mozilla.org/toolkit/crash-reporter;1" in Components.classes)) {
     1.7 +    dump("INFO | test_crash_runtimeabort.js | Can't test crashreporter in a non-libxul build.\n");
     1.8 +    return;
     1.9 +  }
    1.10 +
    1.11 +  // Try crashing with a runtime abort
    1.12 +  do_crash(function() {
    1.13 +             crashType = CrashTestUtils.CRASH_RUNTIMEABORT;
    1.14 +             crashReporter.annotateCrashReport("TestKey", "TestValue");
    1.15 +           },
    1.16 +           function(mdump, extra) {
    1.17 +             do_check_eq(extra.TestKey, "TestValue");
    1.18 +             do_check_true(/xpcom_runtime_abort/.test(extra.Notes));
    1.19 +             do_check_false("OOMAllocationSize" in extra);
    1.20 +             do_check_true(/Intentional crash/.test(extra.AbortMessage));
    1.21 +           },
    1.22 +          // process will exit with a zero exit status
    1.23 +          true);
    1.24 +}

mercurial