summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorojan@google.com <ojan@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-16 01:24:22 +0000
committerojan@google.com <ojan@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-16 01:24:22 +0000
commit3e100d5abb3bcea7e823debff1d8606984baeb3b (patch)
tree8db834bb4e713b621de907b9e4a4f1f5e48b8660 /webkit
parentf1d07b705c8fc1bc2a8bee2977ac8c4dc01879f1 (diff)
downloadchromium_src-3e100d5abb3bcea7e823debff1d8606984baeb3b.zip
chromium_src-3e100d5abb3bcea7e823debff1d8606984baeb3b.tar.gz
chromium_src-3e100d5abb3bcea7e823debff1d8606984baeb3b.tar.bz2
Fix SupressErrorReporting on the mac and remove --gdb flag from test_shell. The --gdb flag isn't needed with the new way of handling crash reporting. I don't quite understand what the new code is doing, but I tried both a crashing test_shell and stepping past SuppressErrorReporting via gdb in xcode.
In addition to saving developer annoyance with ReportCrash popping up, this should considerably improve the performance of running the webkit tests. Review URL: http://codereview.chromium.org/67193 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13820 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/tools/test_shell/test_shell_main.cc3
-rw-r--r--webkit/tools/test_shell/test_shell_platform_delegate_mac.mm41
-rw-r--r--webkit/tools/test_shell/test_shell_switches.cc4
-rw-r--r--webkit/tools/test_shell/test_shell_switches.h1
4 files changed, 23 insertions, 26 deletions
diff --git a/webkit/tools/test_shell/test_shell_main.cc b/webkit/tools/test_shell/test_shell_main.cc
index d409d8e..58e202d 100644
--- a/webkit/tools/test_shell/test_shell_main.cc
+++ b/webkit/tools/test_shell/test_shell_main.cc
@@ -94,8 +94,7 @@ int main(int argc, char* argv[]) {
// Suppress abort message in v8 library in debugging mode (but not
// actually under a debugger). V8 calls abort() when it hits
// assertion errors.
- if (suppress_error_dialogs &&
- !parsed_command_line.HasSwitch(test_shell::kGDB)) {
+ if (suppress_error_dialogs) {
platform.SuppressErrorReporting();
}
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 208caf1..a88bf83 100644
--- a/webkit/tools/test_shell/test_shell_platform_delegate_mac.mm
+++ b/webkit/tools/test_shell/test_shell_platform_delegate_mac.mm
@@ -150,23 +150,12 @@ static void InstallLayoutTestColorProfile(void) {
// Save the starting profile, and hook in as best we can to make sure when
// we exit, it's restored (use atexit() so direct calls to exit() call us).
gUsersColorProfile = previousProfile;
+
+ // Currently, layout test mode implies suppressing errors in
+ // test_shell_main.cc. So we call SuppressErrorReporting() and install all the
+ // appropriate signal handlers. If that ever changes we should find a way to
+ // restore the color profile on crashes without suppressing errors.
atexit(RestoreUsersColorProfile);
- // The less scary signals...
- signal(SIGINT, SimpleSignalHandler);
- signal(SIGHUP, SimpleSignalHandler);
- signal(SIGTERM, SimpleSignalHandler);
- // And now the scary ones...
- signal(SIGABRT, CrashSignalHandler); // abort() called
- signal(SIGILL, CrashSignalHandler); // 4: illegal instruction
- signal(SIGTRAP, CrashSignalHandler); // 5: trace trap
- signal(SIGEMT, CrashSignalHandler); // 7: EMT instruction
- signal(SIGFPE, CrashSignalHandler); // 8: floating point exception
- signal(SIGBUS, CrashSignalHandler); // 10: bus error
- signal(SIGSEGV, CrashSignalHandler); // 11: segmentation violation
- signal(SIGSYS, CrashSignalHandler); // 12: bad argument to system call
- signal(SIGPIPE, CrashSignalHandler); // 13: write on a pipe with no reader
- signal(SIGXCPU, CrashSignalHandler); // 24: exceeded CPU time limit
- signal(SIGXFSZ, CrashSignalHandler); // 25: exceeded file size limit
}
#if OBJC_API_VERSION == 2
@@ -278,7 +267,21 @@ void TestShellPlatformDelegate::SelectUnifiedTheme() {
void TestShellPlatformDelegate::SuppressErrorReporting() {
// If we die during tests, we don't want to be spamming the user's crash
- // reporter. Set our exception port to null.
- task_set_exception_ports(mach_task_self(), EXC_MASK_ALL, MACH_PORT_NULL,
- EXCEPTION_DEFAULT, THREAD_STATE_NONE);
+ // reporter.
+ // The less scary signals...
+ signal(SIGINT, SimpleSignalHandler);
+ signal(SIGHUP, SimpleSignalHandler);
+ signal(SIGTERM, SimpleSignalHandler);
+ // And now the scary ones...
+ signal(SIGABRT, CrashSignalHandler); // abort() called
+ signal(SIGILL, CrashSignalHandler); // 4: illegal instruction
+ signal(SIGTRAP, CrashSignalHandler); // 5: trace trap
+ signal(SIGEMT, CrashSignalHandler); // 7: EMT instruction
+ signal(SIGFPE, CrashSignalHandler); // 8: floating point exception
+ signal(SIGBUS, CrashSignalHandler); // 10: bus error
+ signal(SIGSEGV, CrashSignalHandler); // 11: segmentation violation
+ signal(SIGSYS, CrashSignalHandler); // 12: bad argument to system call
+ signal(SIGPIPE, CrashSignalHandler); // 13: write on a pipe with no reader
+ signal(SIGXCPU, CrashSignalHandler); // 24: exceeded CPU time limit
+ signal(SIGXFSZ, CrashSignalHandler); // 25: exceeded file size limit
}
diff --git a/webkit/tools/test_shell/test_shell_switches.cc b/webkit/tools/test_shell/test_shell_switches.cc
index 0884929..9bda588 100644
--- a/webkit/tools/test_shell/test_shell_switches.cc
+++ b/webkit/tools/test_shell/test_shell_switches.cc
@@ -64,10 +64,6 @@ 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 be995d1..597615f 100644
--- a/webkit/tools/test_shell/test_shell_switches.h
+++ b/webkit/tools/test_shell/test_shell_switches.h
@@ -28,7 +28,6 @@ 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