Bug 1306329 part B - Remove a few crashreporter tests which can no longer be implemented without linking to internal symbols. r=ted

MozReview-Commit-ID: ChP1nRo2alE

--HG--
extra : rebase_source : d79904ce7c33946bc61aaeb5c53195e993e55dd1
This commit is contained in:
Benjamin Smedberg 2016-11-11 12:57:09 -05:00
Родитель eebe7c8cdb
Коммит d519b47483
7 изменённых файлов: 2 добавлений и 72 удалений

Просмотреть файл

@ -6,7 +6,6 @@ this.EXPORTED_SYMBOLS = ["CrashTestUtils"];
this.CrashTestUtils = {
// These will be defined using ctypes APIs below.
crash: null,
lockDir: null,
dumpHasStream: null,
dumpHasInstructionPointerMemory: null,
@ -41,12 +40,6 @@ CrashTestUtils.saveAppMemory = lib.declare("SaveAppMemory",
ctypes.default_abi,
ctypes.uint64_t);
CrashTestUtils.lockDir = lib.declare("LockDir",
ctypes.default_abi,
ctypes.voidptr_t, // nsILocalFile*
ctypes.voidptr_t); // nsISupports*
try {
CrashTestUtils.TryOverrideExceptionHandler = lib.declare("TryOverrideExceptionHandler",
ctypes.default_abi,

Просмотреть файл

@ -3,7 +3,6 @@
#include <stdio.h>
#include "nscore.h"
#include "nsXULAppAPI.h"
#include "nsExceptionHandler.h"
#include "mozilla/Unused.h"
@ -43,7 +42,6 @@ void PureVirtualCall()
// Keep these in sync with CrashTestUtils.jsm!
const int16_t CRASH_INVALID_POINTER_DEREF = 0;
const int16_t CRASH_PURE_VIRTUAL_CALL = 1;
const int16_t CRASH_RUNTIMEABORT = 2;
const int16_t CRASH_OOM = 3;
const int16_t CRASH_MOZ_CRASH = 4;
const int16_t CRASH_ABORT = 5;
@ -63,10 +61,6 @@ void Crash(int16_t how)
// not reached
break;
}
case CRASH_RUNTIMEABORT: {
NS_RUNTIMEABORT("Intentional crash");
break;
}
case CRASH_OOM: {
mozilla::Unused << moz_xmalloc((size_t) -1);
mozilla::Unused << moz_xmalloc((size_t) -1);
@ -86,14 +80,6 @@ void Crash(int16_t how)
}
}
extern "C" NS_EXPORT
nsISupports* LockDir(nsIFile *directory)
{
nsISupports* lockfile = nullptr;
XRE_LockProfileDirectory(directory, &lockfile);
return lockfile;
}
char testData[32];
extern "C" NS_EXPORT

Просмотреть файл

@ -1,21 +0,0 @@
function run_test()
{
if (!("@mozilla.org/toolkit/crash-reporter;1" in Components.classes)) {
dump("INFO | test_crash_runtimeabort.js | Can't test crashreporter in a non-libxul build.\n");
return;
}
// Try crashing with a runtime abort
do_crash(function() {
crashType = CrashTestUtils.CRASH_RUNTIMEABORT;
crashReporter.annotateCrashReport("TestKey", "TestValue");
},
function(mdump, extra) {
do_check_eq(extra.TestKey, "TestValue");
do_check_true(/xpcom_runtime_abort/.test(extra.Notes));
do_check_false("OOMAllocationSize" in extra);
do_check_true(/Intentional crash/.test(extra.AbortMessage));
},
// process will exit with a zero exit status
true);
}

Просмотреть файл

@ -1,26 +0,0 @@
function run_test()
{
if (!("@mozilla.org/toolkit/crash-reporter;1" in Components.classes)) {
dump("INFO | test_crashreporter.js | Can't test crashreporter in a non-libxul build.\n");
return;
}
// lock a profile directory, crash, and ensure that
// the profile lock signal handler doesn't interfere with
// writing a minidump
do_crash(function() {
let env = Components.classes["@mozilla.org/process/environment;1"]
.getService(Components.interfaces.nsIEnvironment);
// the python harness sets this in the environment for us
let profd = env.get("XPCSHELL_TEST_PROFILE_DIR");
let dir = Components.classes["@mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsILocalFile);
dir.initWithPath(profd);
let lock = CrashTestUtils.lockDir(dir);
// when we crash, the lock file should be cleaned up
},
function(mdump, extra) {
// if we got here, we have a minidump, so that's all we wanted
do_check_true(true);
});
}

Просмотреть файл

@ -30,7 +30,7 @@ add_task(function* test_main_process_crash() {
let scope = {};
Components.utils.import("resource://gre/modules/TelemetryController.jsm", scope);
scope.TelemetryController.testSetup();
crashType = CrashTestUtils.CRASH_RUNTIMEABORT;
crashType = CrashTestUtils.CRASH_MOZ_CRASH;
crashReporter.annotateCrashReport("ShutdownProgress", "event-test");
},
(minidump, extra) => {

Просмотреть файл

@ -8,7 +8,6 @@ support-files =
[test_crash_moz_crash.js]
[test_crash_purevirtual.js]
[test_crash_runtimeabort.js]
[test_crash_after_js_oom_reported.js]
[test_crash_after_js_oom_recovered.js]
[test_crash_after_js_oom_reported_2.js]
@ -24,7 +23,6 @@ skip-if = os == 'win'
[test_crash_with_memory_report.js]
[test_crashreporter.js]
[test_crashreporter_crash.js]
[test_crashreporter_crash_profile_lock.js]
[test_override_exception_handler.js]
skip-if = os != 'win'

Просмотреть файл

@ -9,7 +9,7 @@ function run_test()
// Try crashing with a runtime abort
do_content_crash(function() {
crashType = CrashTestUtils.CRASH_RUNTIMEABORT;
crashType = CrashTestUtils.CRASH_MOZ_CRASH;
crashReporter.annotateCrashReport("TestKey", "TestValue");
crashReporter.appendAppNotesToCrashReport("!!!foo!!!");
},