Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: chrome/test/ui/ui_test.cc

Issue 7185023: Support Chromium-branded builds and cleanup reference build usage. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/test/ui/ui_test.h" 5 #include "chrome/test/ui/ui_test.h"
6 6
7 #if defined(OS_POSIX) 7 #if defined(OS_POSIX)
8 #include <signal.h> 8 #include <signal.h>
9 #include <sys/types.h> 9 #include <sys/types.h>
10 #endif 10 #endif
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 : launch_arguments_(CommandLine::NO_PROGRAM), 82 : launch_arguments_(CommandLine::NO_PROGRAM),
83 expected_errors_(0), 83 expected_errors_(0),
84 expected_crashes_(0), 84 expected_crashes_(0),
85 homepage_(chrome::kAboutBlankURL), 85 homepage_(chrome::kAboutBlankURL),
86 wait_for_initial_loads_(true), 86 wait_for_initial_loads_(true),
87 dom_automation_enabled_(false), 87 dom_automation_enabled_(false),
88 show_window_(false), 88 show_window_(false),
89 clear_profile_(true), 89 clear_profile_(true),
90 include_testing_id_(true), 90 include_testing_id_(true),
91 enable_file_cookies_(true), 91 enable_file_cookies_(true),
92 enable_chrome_branding_(true),
92 profile_type_(ProxyLauncher::DEFAULT_THEME) { 93 profile_type_(ProxyLauncher::DEFAULT_THEME) {
93 PathService::Get(chrome::DIR_APP, &browser_directory_); 94 PathService::Get(chrome::DIR_APP, &browser_directory_);
94 PathService::Get(chrome::DIR_TEST_DATA, &test_data_directory_); 95 PathService::Get(chrome::DIR_TEST_DATA, &test_data_directory_);
95 } 96 }
96 97
97 UITestBase::UITestBase(MessageLoop::Type msg_loop_type) 98 UITestBase::UITestBase(MessageLoop::Type msg_loop_type)
98 : launch_arguments_(CommandLine::NO_PROGRAM), 99 : launch_arguments_(CommandLine::NO_PROGRAM),
99 expected_errors_(0), 100 expected_errors_(0),
100 expected_crashes_(0), 101 expected_crashes_(0),
101 wait_for_initial_loads_(true), 102 wait_for_initial_loads_(true),
102 dom_automation_enabled_(false), 103 dom_automation_enabled_(false),
103 show_window_(false), 104 show_window_(false),
104 clear_profile_(true), 105 clear_profile_(true),
105 include_testing_id_(true), 106 include_testing_id_(true),
106 enable_file_cookies_(true), 107 enable_file_cookies_(true),
108 enable_chrome_branding_(true),
107 profile_type_(ProxyLauncher::DEFAULT_THEME) { 109 profile_type_(ProxyLauncher::DEFAULT_THEME) {
108 PathService::Get(chrome::DIR_APP, &browser_directory_); 110 PathService::Get(chrome::DIR_APP, &browser_directory_);
109 PathService::Get(chrome::DIR_TEST_DATA, &test_data_directory_); 111 PathService::Get(chrome::DIR_TEST_DATA, &test_data_directory_);
110 } 112 }
111 113
112 UITestBase::~UITestBase() {} 114 UITestBase::~UITestBase() {}
113 115
114 void UITestBase::SetUp() { 116 void UITestBase::SetUp() {
115 // Tests that do a session restore (e.g. SessionRestoreUITest, StartupTest) 117 // Tests that do a session restore (e.g. SessionRestoreUITest, StartupTest)
116 // call SetUp() multiple times because they restart the browser mid-test. 118 // call SetUp() multiple times because they restart the browser mid-test.
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 void UITestBase::set_action_timeout_ms(int timeout) { 169 void UITestBase::set_action_timeout_ms(int timeout) {
168 automation()->set_action_timeout_ms(timeout); 170 automation()->set_action_timeout_ms(timeout);
169 VLOG(1) << "Automation action timeout set to " << timeout << " ms"; 171 VLOG(1) << "Automation action timeout set to " << timeout << " ms";
170 } 172 }
171 173
172 ProxyLauncher* UITestBase::CreateProxyLauncher() { 174 ProxyLauncher* UITestBase::CreateProxyLauncher() {
173 return new AnonymousProxyLauncher(false); 175 return new AnonymousProxyLauncher(false);
174 } 176 }
175 177
176 ProxyLauncher::LaunchState UITestBase::DefaultLaunchState() { 178 ProxyLauncher::LaunchState UITestBase::DefaultLaunchState() {
177 FilePath browser_executable = browser_directory_.Append( 179 FilePath browser_executable;
178 chrome::kBrowserProcessExecutablePath); 180 if (enable_chrome_branding_)
181 browser_executable = browser_directory_.Append(
182 chrome::kBrowserProcessExecutablePath);
183 else
184 browser_executable = browser_directory_.Append(
185 chrome::kBrowserProcessExecutablePathChromium);
cmp 2011/06/16 23:29:40 I believe there's also a use of kBrowserProcessExe
179 CommandLine command(browser_executable); 186 CommandLine command(browser_executable);
180 command.AppendArguments(launch_arguments_, false); 187 command.AppendArguments(launch_arguments_, false);
181 ProxyLauncher::LaunchState state = 188 ProxyLauncher::LaunchState state =
182 { clear_profile_, template_user_data_, profile_type_, 189 { clear_profile_, template_user_data_, profile_type_,
183 command, include_testing_id_, show_window_ }; 190 command, include_testing_id_, show_window_ };
184 return state; 191 return state;
185 } 192 }
186 193
187 bool UITestBase::ShouldFilterInet() { 194 bool UITestBase::ShouldFilterInet() {
188 return true; 195 return true;
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
759 base::PlatformThread::Sleep(TestTimeouts::action_timeout_ms() / kCycles); 766 base::PlatformThread::Sleep(TestTimeouts::action_timeout_ms() / kCycles);
760 } 767 }
761 768
762 LOG(INFO) << "Elapsed time: " << (base::Time::Now() - start).InSecondsF() 769 LOG(INFO) << "Elapsed time: " << (base::Time::Now() - start).InSecondsF()
763 << " seconds" 770 << " seconds"
764 << " call failed " << fail_count << " times" 771 << " call failed " << fail_count << " times"
765 << " state was incorrect " << incorrect_state_count << " times"; 772 << " state was incorrect " << incorrect_state_count << " times";
766 ADD_FAILURE() << "Timeout reached in " << __FUNCTION__; 773 ADD_FAILURE() << "Timeout reached in " << __FUNCTION__;
767 return false; 774 return false;
768 } 775 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698