From 39af4158f0ded8c07da1464f73eccceb67db05f1 Mon Sep 17 00:00:00 2001 From: Terrence Cole Date: Tue, 2 Jun 2015 11:40:46 -0700 Subject: [PATCH] Bug 1170665 - Disable the windows segfault popup in the shell; r=jandem --- js/src/shell/js.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp index 804c3281899..07a3eed8bac 100644 --- a/js/src/shell/js.cpp +++ b/js/src/shell/js.cpp @@ -6065,9 +6065,23 @@ DummyPreserveWrapperCallback(JSContext* cx, JSObject* obj) return true; } +static void +PreInit() +{ +#ifdef XP_WIN + // Disable the segfault dialog. We want to fail the tests immediately + // instead of hanging automation. + UINT prevMode = SetErrorMode(0); + UINT newMode = SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX | SEM_NOOPENFILEERRORBOX; + SetErrorMode(prevMode | newMode); +#endif +} + int main(int argc, char** argv, char** envp) { + PreInit(); + sArgc = argc; sArgv = argv;