toolkit/crashreporter/test/unit_ipc/test_content_annotation.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/crashreporter/test/unit_ipc/test_content_annotation.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,22 @@
     1.4 +load("../unit/head_crashreporter.js");
     1.5 +
     1.6 +function run_test()
     1.7 +{
     1.8 +  if (!("@mozilla.org/toolkit/crash-reporter;1" in Components.classes)) {
     1.9 +    dump("INFO | test_content_annotation.js | Can't test crashreporter in a non-libxul build.\n");
    1.10 +    return;
    1.11 +  }
    1.12 +
    1.13 +  // Try crashing with a pure virtual call
    1.14 +  do_content_crash(function() {
    1.15 +                     crashType = CrashTestUtils.CRASH_RUNTIMEABORT;
    1.16 +                     crashReporter.annotateCrashReport("TestKey", "TestValue");
    1.17 +                     crashReporter.appendAppNotesToCrashReport("!!!foo!!!");
    1.18 +		   },
    1.19 +                   function(mdump, extra) {
    1.20 +                     do_check_eq(extra.TestKey, "TestValue");
    1.21 +                     do_check_true('StartupTime' in extra);
    1.22 +                     do_check_true('ProcessType' in extra);
    1.23 +                     do_check_neq(extra.Notes.indexOf("!!!foo!!!"), -1);
    1.24 +                   });
    1.25 +}
    1.26 \ No newline at end of file

mercurial