mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bug 792850 - add an xpcshell test for our SetUnhandledExceptionFilter hook. r=ehsan
--HG-- extra : rebase_source : f289d7d8214bcfdd90baeae8c47e2747de806426
This commit is contained in:
parent
ced2e35a6b
commit
2aaaf25f58
@ -42,6 +42,13 @@ CrashTestUtils.lockDir = lib.declare("LockDir",
|
||||
ctypes.voidptr_t); // nsISupports*
|
||||
|
||||
|
||||
try {
|
||||
CrashTestUtils.TryOverrideExceptionHandler = lib.declare("TryOverrideExceptionHandler",
|
||||
ctypes.default_abi,
|
||||
ctypes.void_t);
|
||||
}
|
||||
catch(ex) {}
|
||||
|
||||
CrashTestUtils.dumpHasStream = lib.declare("DumpHasStream",
|
||||
ctypes.default_abi,
|
||||
ctypes.bool,
|
||||
|
@ -104,3 +104,17 @@ uint64_t SaveAppMemory()
|
||||
|
||||
return (int64_t)testData;
|
||||
}
|
||||
|
||||
#ifdef XP_WIN32
|
||||
static LONG WINAPI HandleException(EXCEPTION_POINTERS* exinfo)
|
||||
{
|
||||
TerminateProcess(GetCurrentProcess(), 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern "C" NS_EXPORT
|
||||
void TryOverrideExceptionHandler()
|
||||
{
|
||||
SetUnhandledExceptionFilter(HandleException);
|
||||
}
|
||||
#endif
|
||||
|
@ -0,0 +1,12 @@
|
||||
function run_test()
|
||||
{
|
||||
// Ensure that attempting to override the exception handler doesn't cause
|
||||
// us to lose our exception handler.
|
||||
do_crash(
|
||||
function() {
|
||||
CrashTestUtils.TryOverrideExceptionHandler();
|
||||
},
|
||||
function(mdump, extra) {
|
||||
},
|
||||
true);
|
||||
}
|
@ -11,6 +11,8 @@ skip-if = os == 'win' && debug
|
||||
[test_crashreporter.js]
|
||||
[test_crashreporter_crash.js]
|
||||
[test_crashreporter_crash_profile_lock.js]
|
||||
[test_override_exception_handler.js]
|
||||
run-if = os == 'win'
|
||||
|
||||
[test_crashreporter_appmem.js]
|
||||
run-if = os == 'win' || os == 'linux'
|
||||
|
Loading…
Reference in New Issue
Block a user