summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorojan@chromium.org <ojan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-17 22:34:15 +0000
committerojan@chromium.org <ojan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-17 22:34:15 +0000
commit087d04dadc8f8aba2e798af4fea4b33ced9213f7 (patch)
tree6df5b7d2d014d4bf211967d557b6f37aa4d04d29 /webkit
parentb8b7cfb7f79974550fa76894fa939890604970a4 (diff)
downloadchromium_src-087d04dadc8f8aba2e798af4fea4b33ced9213f7.zip
chromium_src-087d04dadc8f8aba2e798af4fea4b33ced9213f7.tar.gz
chromium_src-087d04dadc8f8aba2e798af4fea4b33ced9213f7.tar.bz2
Fix error suppressing. It turns out that both the signal handling
and the exception port bits are needed to avoid the crash reporter. There are still cases we miss. I was able to hit a TestShell that popped up the crash reporter running the tests, but I was only able to hit it once. Review URL: http://codereview.chromium.org/67270 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13972 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/tools/test_shell/test_shell_platform_delegate_mac.mm11
-rw-r--r--webkit/tools/test_shell/test_shell_switches.cc4
-rw-r--r--webkit/tools/test_shell/test_shell_switches.h1
3 files changed, 15 insertions, 1 deletions
diff --git a/webkit/tools/test_shell/test_shell_platform_delegate_mac.mm b/webkit/tools/test_shell/test_shell_platform_delegate_mac.mm
index a88bf83..fdb276d 100644
--- a/webkit/tools/test_shell/test_shell_platform_delegate_mac.mm
+++ b/webkit/tools/test_shell/test_shell_platform_delegate_mac.mm
@@ -266,8 +266,17 @@ void TestShellPlatformDelegate::SelectUnifiedTheme() {
}
void TestShellPlatformDelegate::SuppressErrorReporting() {
+ const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess();
+
// If we die during tests, we don't want to be spamming the user's crash
- // reporter.
+ // reporter. Set our exception port to null and add signal handlers.
+ // Both of these are necessary to avoid the crash reporter. Although, we do
+ // still seem to be missing some cases.
+ if (!parsed_command_line.HasSwitch(test_shell::kGDB)) {
+ task_set_exception_ports(mach_task_self(), EXC_MASK_ALL, MACH_PORT_NULL,
+ EXCEPTION_DEFAULT, THREAD_STATE_NONE);
+ }
+
// The less scary signals...
signal(SIGINT, SimpleSignalHandler);
signal(SIGHUP, SimpleSignalHandler);
diff --git a/webkit/tools/test_shell/test_shell_switches.cc b/webkit/tools/test_shell/test_shell_switches.cc
index 9bda588..ed8dd07 100644
--- a/webkit/tools/test_shell/test_shell_switches.cc
+++ b/webkit/tools/test_shell/test_shell_switches.cc
@@ -64,6 +64,10 @@ const wchar_t kAllowScriptsToCloseWindows[] = L"allow-scripts-to-close-windows";
extern const wchar_t kCheckLayoutTestSystemDeps[] =
L"check-layout-test-sys-deps";
+// If set, we are running under GDB so allow a certain class of errors
+// to happen even if in layout test mode.
+extern const wchar_t kGDB[] = L"gdb";
+
// Make functions of the Profiler class available in javascript
extern const wchar_t kProfiler[] = L"profiler";
diff --git a/webkit/tools/test_shell/test_shell_switches.h b/webkit/tools/test_shell/test_shell_switches.h
index 597615f..7743aa6 100644
--- a/webkit/tools/test_shell/test_shell_switches.h
+++ b/webkit/tools/test_shell/test_shell_switches.h
@@ -28,6 +28,7 @@ extern const wchar_t kEnableFileCookies[];
extern const wchar_t kEnableTracing[];
extern const wchar_t kAllowScriptsToCloseWindows[];
extern const wchar_t kCheckLayoutTestSystemDeps[];
+extern const wchar_t kGDB[];
extern const wchar_t kProfiler[];
} // namespace test_shell