From 991f8cb1f9e13f7de29ba9fa0733d8d1b377c4d5 Mon Sep 17 00:00:00 2001 From: "patrick@chromium.org" Date: Fri, 27 Feb 2009 17:54:30 +0000 Subject: Add --log-level to the list of flags accepted by UI tests. Review URL: http://codereview.chromium.org/27264 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10614 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/test/ui/ui_test.cc | 3 +++ chrome/test/ui/ui_test.h | 6 ++++++ chrome/test/ui/ui_test_suite.h | 5 +++++ 3 files changed, 14 insertions(+) (limited to 'chrome') diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc index ff30346..d7bb7ca 100644 --- a/chrome/test/ui/ui_test.cc +++ b/chrome/test/ui/ui_test.cc @@ -60,6 +60,7 @@ bool UITest::silent_dump_on_dcheck_ = false; bool UITest::disable_breakpad_ = false; int UITest::timeout_ms_ = 20 * 60 * 1000; std::wstring UITest::js_flags_ = L""; +std::wstring UITest::log_level_ = L""; // Specify the time (in milliseconds) that the ui_tests should wait before @@ -315,6 +316,8 @@ void UITest::LaunchBrowser(const CommandLine& arguments, bool clear_profile) { if (!js_flags_.empty()) command_line.AppendSwitchWithValue(switches::kJavaScriptFlags, js_flags_); + if (!log_level_.empty()) + command_line.AppendSwitchWithValue(switches::kLoggingLevel, log_level_); command_line.AppendSwitch(switches::kMetricsRecordingOnly); diff --git a/chrome/test/ui/ui_test.h b/chrome/test/ui/ui_test.h index a0436f9..1bec6cf 100644 --- a/chrome/test/ui/ui_test.h +++ b/chrome/test/ui/ui_test.h @@ -292,6 +292,11 @@ class UITest : public testing::Test { js_flags_ = value; } + static std::wstring log_level() { return log_level_; } + static void set_log_level(const std::wstring& value) { + log_level_ = value; + } + // Called by some tests that wish to have a base profile to start from. This // "user data directory" (containing one or more profiles) will be recursively // copied into the user data directory for the test and the files will be @@ -440,6 +445,7 @@ class UITest : public testing::Test { static int timeout_ms_; // Timeout in milliseconds to wait // for an test to finish. static std::wstring js_flags_; // Flags passed to the JS engine. + static std::wstring log_level_; // Logging level. #if defined(OS_WIN) // TODO(port): restore me after AutomationProxy works. scoped_ptr server_; diff --git a/chrome/test/ui/ui_test_suite.h b/chrome/test/ui/ui_test_suite.h index 07f6c76..dfe5eeb 100644 --- a/chrome/test/ui/ui_test_suite.h +++ b/chrome/test/ui/ui_test_suite.h @@ -49,6 +49,11 @@ class UITestSuite : public ChromeTestSuite { if (!js_flags.empty()) { UITest::set_js_flags(js_flags); } + std::wstring log_level = + parsed_command_line.GetSwitchValue(switches::kLoggingLevel); + if (!log_level.empty()) { + UITest::set_log_level(log_level); + } } virtual void SuppressErrorDialogs() { -- cgit v1.1