diff options
author | paulg@google.com <paulg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-13 17:48:33 +0000 |
---|---|---|
committer | paulg@google.com <paulg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-13 17:48:33 +0000 |
commit | 4c00833c575e68573668b7bcc9cf454d1ba70021 (patch) | |
tree | 7b4adfada5cd203fb04f9bc0842365d999b3bbce /chrome | |
parent | c78566309f95a11cd5253e1cac681038d9885f21 (diff) | |
download | chromium_src-4c00833c575e68573668b7bcc9cf454d1ba70021.zip chromium_src-4c00833c575e68573668b7bcc9cf454d1ba70021.tar.gz chromium_src-4c00833c575e68573668b7bcc9cf454d1ba70021.tar.bz2 |
Pass the test case name to the browser process in order to
simplify parsing the Purify error output from the ui_tests.
Review URL: http://codereview.chromium.org/17373
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7940 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/common/chrome_switches.cc | 3 | ||||
-rw-r--r-- | chrome/common/chrome_switches.h | 2 | ||||
-rw-r--r-- | chrome/test/ui/ui_test.cc | 16 | ||||
-rw-r--r-- | chrome/test/ui/ui_test.h | 4 |
4 files changed, 25 insertions, 0 deletions
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index cdf8e3c..cc390da 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -353,4 +353,7 @@ const wchar_t kEnableRendererAccessibility[] = L"enable-renderer-accessibility"; // Enable HTML5 Video/Audio tag support const wchar_t kEnableVideo[] = L"enable-video"; +// Pass the name of the current running automated test to Chrome. +const wchar_t kTestName[] = L"test-name"; + } // namespace switches diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index fe9478b..acd84a7 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h @@ -139,6 +139,8 @@ extern const wchar_t kEnableRendererAccessibility[]; extern const wchar_t kEnableVideo[]; +extern const wchar_t kTestName[]; + } // namespace switches #endif // CHROME_COMMON_CHROME_SWITCHES_H__ diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc index 4963a87..3aa709f 100644 --- a/chrome/test/ui/ui_test.cc +++ b/chrome/test/ui/ui_test.cc @@ -119,6 +119,17 @@ void UITest::SetUp() { L"of the app before testing."); } + // Pass the test case name to chrome.exe on the command line to help with + // parsing Purify output. + const testing::TestInfo* const test_info = + testing::UnitTest::GetInstance()->current_test_info(); + if (test_info) { + std::string test_name = test_info->test_case_name(); + test_name += "."; + test_name += test_info->name(); + ui_test_name_ = ASCIIToWide(test_name); + } + InitializeTimeouts(); LaunchBrowserAndServer(); } @@ -299,6 +310,11 @@ void UITest::LaunchBrowser(const std::wstring& arguments, bool clear_profile) { CommandLine::AppendSwitch(&command_line, switches::kDebugOnStart); #endif + if (!ui_test_name_.empty()) + CommandLine::AppendSwitchWithValue(&command_line, + switches::kTestName, + ui_test_name_); + DebugFlags::ProcessDebugFlags(&command_line, DebugFlags::UNKNOWN, false); command_line.append(L" " + arguments); diff --git a/chrome/test/ui/ui_test.h b/chrome/test/ui/ui_test.h index 1a355bf..1d36d29 100644 --- a/chrome/test/ui/ui_test.h +++ b/chrome/test/ui/ui_test.h @@ -320,6 +320,8 @@ class UITest : public testing::Test { int action_max_timeout_ms() const { return action_max_timeout_ms_; } + std::wstring ui_test_name() const { return ui_test_name_; } + // Count the number of active browser processes. This function only counts // browser processes that share the same profile directory as the current // process. The count includes browser sub-processes. @@ -451,6 +453,8 @@ class UITest : public testing::Test { int command_execution_timeout_ms_; int action_timeout_ms_; int action_max_timeout_ms_; + + std::wstring ui_test_name_; }; // These exist only to support the gTest assertion macros, and |