summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsgjesse@chromium.org <sgjesse@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-20 07:46:08 +0000
committersgjesse@chromium.org <sgjesse@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-20 07:46:08 +0000
commitb351289447215f8f9fda9077934d42ae72668a90 (patch)
treeea6328182679fa164e7f776a27dd636864475327
parent305d8c7eab56ac69d8451b47523c9e0bbcdfd8fa (diff)
downloadchromium_src-b351289447215f8f9fda9077934d42ae72668a90.zip
chromium_src-b351289447215f8f9fda9077934d42ae72668a90.tar.gz
chromium_src-b351289447215f8f9fda9077934d42ae72668a90.tar.bz2
Add option --gp-fault-error-box to test shell and run_webkit_tests.py to enable the Windows GP fault dialog. This makes it easier to start debugging the crash in Visual Studio.
Review URL: http://codereview.chromium.org/11273 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5765 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--webkit/tools/layout_tests/run_webkit_tests.py6
-rw-r--r--webkit/tools/test_shell/test_shell.cc7
-rw-r--r--webkit/tools/test_shell/test_shell.h3
-rw-r--r--webkit/tools/test_shell/test_shell_main.cc9
-rw-r--r--webkit/tools/test_shell/test_shell_switches.cc4
-rw-r--r--webkit/tools/test_shell/test_shell_switches.h1
6 files changed, 26 insertions, 4 deletions
diff --git a/webkit/tools/layout_tests/run_webkit_tests.py b/webkit/tools/layout_tests/run_webkit_tests.py
index 83550d0..dcb6541 100644
--- a/webkit/tools/layout_tests/run_webkit_tests.py
+++ b/webkit/tools/layout_tests/run_webkit_tests.py
@@ -244,6 +244,9 @@ class TestRunner:
if self._options.startup_dialog:
shell_args.append('--testshell-startup-dialog')
+ if self._options.gp_fault_error_box:
+ shell_args.append('--gp-fault-error-box')
+
if self._options.winhttp:
shell_args.append('--winhttp')
@@ -606,6 +609,9 @@ if '__main__' == __name__:
option_parser.add_option("", "--startup-dialog", action="store_true",
default=False,
help="create a dialog on test_shell.exe startup")
+ option_parser.add_option("", "--gp-fault-error-box", action="store_true",
+ default=False,
+ help="enable Windows GP fault error box")
option_parser.add_option("", "--winhttp", action="store_true",
default=False,
help="Use WinHTTP stack")
diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc
index 559ab3f..9d236a6 100644
--- a/webkit/tools/test_shell/test_shell.cc
+++ b/webkit/tools/test_shell/test_shell.cc
@@ -182,15 +182,18 @@ std::string TestShell::DumpImage(WebFrame* web_frame,
// static
void TestShell::InitLogging(bool suppress_error_dialogs,
- bool running_layout_tests) {
+ bool running_layout_tests,
+ bool enable_gp_fault_error_box) {
if (suppress_error_dialogs)
logging::SetLogAssertHandler(UnitTestAssertHandler);
#if defined(OS_WIN)
if (!IsDebuggerPresent()) {
UINT new_flags = SEM_FAILCRITICALERRORS |
- SEM_NOGPFAULTERRORBOX |
SEM_NOOPENFILEERRORBOX;
+ if (!enable_gp_fault_error_box)
+ new_flags |= SEM_NOGPFAULTERRORBOX;
+
// Preserve existing error mode, as discussed at
// http://blogs.msdn.com/oldnewthing/archive/2004/07/27/198410.aspx
UINT existing_flags = SetErrorMode(new_flags);
diff --git a/webkit/tools/test_shell/test_shell.h b/webkit/tools/test_shell/test_shell.h
index 8e96364..7ce104f 100644
--- a/webkit/tools/test_shell/test_shell.h
+++ b/webkit/tools/test_shell/test_shell.h
@@ -71,7 +71,8 @@ public:
// Initialization and clean up of logging.
static void InitLogging(bool suppress_error_dialogs,
- bool running_layout_tests);
+ bool running_layout_tests,
+ bool enable_gp_fault_error_box);
static void CleanupLogging();
// Initialization and clean up of a static member variable.
diff --git a/webkit/tools/test_shell/test_shell_main.cc b/webkit/tools/test_shell/test_shell_main.cc
index 909cfa9..bbe90ef 100644
--- a/webkit/tools/test_shell/test_shell_main.cc
+++ b/webkit/tools/test_shell/test_shell_main.cc
@@ -107,7 +107,14 @@ int main(int argc, char* argv[]) {
bool layout_test_mode =
parsed_command_line.HasSwitch(test_shell::kLayoutTests);
- TestShell::InitLogging(suppress_error_dialogs, layout_test_mode);
+ bool enable_gp_fault_error_box = false;
+#if defined(OS_WIN)
+ enable_gp_fault_error_box =
+ parsed_command_line.HasSwitch(test_shell::kGPFaultErrorBox);
+#endif
+ TestShell::InitLogging(suppress_error_dialogs,
+ layout_test_mode,
+ enable_gp_fault_error_box);
// Set this early before we start using WebCore.
webkit_glue::SetLayoutTestMode(layout_test_mode);
diff --git a/webkit/tools/test_shell/test_shell_switches.cc b/webkit/tools/test_shell/test_shell_switches.cc
index 5b9bb5f..9ee7e89 100644
--- a/webkit/tools/test_shell/test_shell_switches.cc
+++ b/webkit/tools/test_shell/test_shell_switches.cc
@@ -23,6 +23,10 @@ const wchar_t kTestShellTimeOut[] = L"time-out-ms";
const wchar_t kStartupDialog[] = L"testshell-startup-dialog";
+// Enable the Windows dialogs for GP faults in the test shell. This allows makes
+// it possible to attach a crashed test shell to a debugger.
+const wchar_t kGPFaultErrorBox[] = L"gp-fault-error-box";
+
// JavaScript flags passed to engine.
const wchar_t kJavaScriptFlags[] = L"js-flags";
diff --git a/webkit/tools/test_shell/test_shell_switches.h b/webkit/tools/test_shell/test_shell_switches.h
index f368996..83e08dc 100644
--- a/webkit/tools/test_shell/test_shell_switches.h
+++ b/webkit/tools/test_shell/test_shell_switches.h
@@ -16,6 +16,7 @@ extern const wchar_t kNoErrorDialogs[];
extern const wchar_t kNoTree[];
extern const wchar_t kTestShellTimeOut[];
extern const wchar_t kStartupDialog[];
+extern const wchar_t kGPFaultErrorBox[];
extern const wchar_t kJavaScriptFlags[];
extern const wchar_t kRecordMode[];
extern const wchar_t kPlaybackMode[];