OLD | NEW |
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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 void UITestBase::LaunchBrowserAndServer() { | 189 void UITestBase::LaunchBrowserAndServer() { |
190 launcher_->LaunchBrowserAndServer(DefaultLaunchState(), | 190 launcher_->LaunchBrowserAndServer(DefaultLaunchState(), |
191 wait_for_initial_loads_); | 191 wait_for_initial_loads_); |
192 } | 192 } |
193 | 193 |
194 void UITestBase::ConnectToRunningBrowser() { | 194 void UITestBase::ConnectToRunningBrowser() { |
195 launcher_->ConnectToRunningBrowser(wait_for_initial_loads_); | 195 launcher_->ConnectToRunningBrowser(wait_for_initial_loads_); |
196 } | 196 } |
197 | 197 |
198 void UITestBase::CloseBrowserAndServer() { | 198 void UITestBase::CloseBrowserAndServer() { |
199 launcher_->CloseBrowserAndServer(shutdown_type_); | 199 if (launcher_.get()) |
| 200 launcher_->CloseBrowserAndServer(shutdown_type_); |
200 } | 201 } |
201 | 202 |
202 void UITestBase::LaunchBrowser(const CommandLine& arguments, | 203 void UITestBase::LaunchBrowser(const CommandLine& arguments, |
203 bool clear_profile) { | 204 bool clear_profile) { |
204 ProxyLauncher::LaunchState state = DefaultLaunchState(); | 205 ProxyLauncher::LaunchState state = DefaultLaunchState(); |
205 state.clear_profile = clear_profile; | 206 state.clear_profile = clear_profile; |
206 launcher_->LaunchBrowser(state); | 207 launcher_->LaunchBrowser(state); |
207 } | 208 } |
208 | 209 |
209 #if !defined(OS_MACOSX) | 210 #if !defined(OS_MACOSX) |
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
847 incorrect_state_count++; | 848 incorrect_state_count++; |
848 } | 849 } |
849 | 850 |
850 LOG(INFO) << "Elapsed time: " << (base::Time::Now() - start).InSecondsF() | 851 LOG(INFO) << "Elapsed time: " << (base::Time::Now() - start).InSecondsF() |
851 << " seconds" | 852 << " seconds" |
852 << " call failed " << fail_count << " times" | 853 << " call failed " << fail_count << " times" |
853 << " state was incorrect " << incorrect_state_count << " times"; | 854 << " state was incorrect " << incorrect_state_count << " times"; |
854 ADD_FAILURE() << "Timeout reached in " << __FUNCTION__; | 855 ADD_FAILURE() << "Timeout reached in " << __FUNCTION__; |
855 return false; | 856 return false; |
856 } | 857 } |
OLD | NEW |