From 292170bc90dc4a80156990a5cf18c2acec4ae547 Mon Sep 17 00:00:00 2001 From: "sky@google.com" Date: Fri, 23 Jan 2009 21:51:48 +0000 Subject: Adds switch to ui tests that enable dialogs in slave process. I'm adding this to make it easier to attach to a failing ui test. BUG=none TEST=none Review URL: http://codereview.chromium.org/18725 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8580 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/test/ui/ui_test.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc index 597b0af..5d88ba9 100644 --- a/chrome/test/ui/ui_test.cc +++ b/chrome/test/ui/ui_test.cc @@ -72,6 +72,10 @@ const wchar_t kUiTestSleepTimeout[] = L"ui-test-sleep-timeout"; const wchar_t kExtraChromeFlagsSwitch[] = L"extra-chrome-flags"; +// By default error dialogs are hidden, which makes debugging failures in the +// slave process frustrating. By passing this in error dialogs are enabled. +const wchar_t kEnableErrorDialogs[] = L"enable-errdialogs"; + // Uncomment this line to have the spawned process wait for the debugger to // attach. // #define WAIT_FOR_DEBUGGER_ON_OPEN 1 @@ -281,8 +285,10 @@ void UITest::LaunchBrowser(const CommandLine& arguments, bool clear_profile) { NOTIMPLEMENTED(); #endif - if (!show_error_dialogs_) + if (!show_error_dialogs_ && + !CommandLine::ForCurrentProcess()->HasSwitch(kEnableErrorDialogs)) { command_line.AppendSwitch(switches::kNoErrorDialogs); + } if (in_process_renderer_) command_line.AppendSwitch(switches::kSingleProcess); if (in_process_plugins_) @@ -312,8 +318,8 @@ void UITest::LaunchBrowser(const CommandLine& arguments, bool clear_profile) { command_line.AppendSwitch(switches::kMetricsRecordingOnly); - // We always want to enable chrome logging - command_line.AppendSwitch(switches::kEnableLogging); + if (!CommandLine::ForCurrentProcess()->HasSwitch(kEnableErrorDialogs)) + command_line.AppendSwitch(switches::kEnableLogging); if (dump_histograms_on_exit_) command_line.AppendSwitch(switches::kDumpHistogramsOnExit); -- cgit v1.1