toolkit/crashreporter/test/unit/test_crash_oom.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_oom.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,19 @@
     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_purevirtual.js | Can't test crashreporter in a non-libxul build.\n");
     1.8 +    return;
     1.9 +  }
    1.10 +
    1.11 +  do_crash(
    1.12 +    function() {
    1.13 +      crashType = CrashTestUtils.CRASH_OOM;
    1.14 +      crashReporter.annotateCrashReport("TestingOOMCrash", "Yes");
    1.15 +    },
    1.16 +    function(mdump, extra) {
    1.17 +      do_check_eq(extra.TestingOOMCrash, "Yes");
    1.18 +      do_check_true("OOMAllocationSize" in extra);
    1.19 +      do_check_true(Number(extra.OOMAllocationSize) > 0);
    1.20 +    },
    1.21 +    true);
    1.22 +}

mercurial