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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 if (!launcher_.get()) | 118 if (!launcher_.get()) |
119 launcher_.reset(CreateProxyLauncher()); | 119 launcher_.reset(CreateProxyLauncher()); |
120 launcher_->AssertAppNotRunning("Please close any other instances " | 120 launcher_->AssertAppNotRunning("Please close any other instances " |
121 "of the app before testing."); | 121 "of the app before testing."); |
122 | 122 |
123 JavaScriptExecutionController::set_timeout( | 123 JavaScriptExecutionController::set_timeout( |
124 TestTimeouts::action_max_timeout_ms()); | 124 TestTimeouts::action_max_timeout_ms()); |
125 test_start_time_ = Time::NowFromSystemTime(); | 125 test_start_time_ = Time::NowFromSystemTime(); |
126 | 126 |
127 SetLaunchSwitches(); | 127 SetLaunchSwitches(); |
128 launcher_->InitializeConnection(DefaultLaunchState(), | 128 ASSERT_TRUE(launcher_->InitializeConnection(DefaultLaunchState(), |
129 wait_for_initial_loads_); | 129 wait_for_initial_loads_)); |
130 } | 130 } |
131 | 131 |
132 void UITestBase::TearDown() { | 132 void UITestBase::TearDown() { |
133 if (launcher_.get()) | 133 if (launcher_.get()) |
134 launcher_->TerminateConnection(); | 134 launcher_->TerminateConnection(); |
135 | 135 |
136 // Make sure that we didn't encounter any assertion failures | 136 // Make sure that we didn't encounter any assertion failures |
137 logging::AssertionList assertions; | 137 logging::AssertionList assertions; |
138 logging::GetFatalAssertions(&assertions); | 138 logging::GetFatalAssertions(&assertions); |
139 | 139 |
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
781 base::PlatformThread::Sleep(TestTimeouts::action_timeout_ms() / kCycles); | 781 base::PlatformThread::Sleep(TestTimeouts::action_timeout_ms() / kCycles); |
782 } | 782 } |
783 | 783 |
784 LOG(INFO) << "Elapsed time: " << (base::Time::Now() - start).InSecondsF() | 784 LOG(INFO) << "Elapsed time: " << (base::Time::Now() - start).InSecondsF() |
785 << " seconds" | 785 << " seconds" |
786 << " call failed " << fail_count << " times" | 786 << " call failed " << fail_count << " times" |
787 << " state was incorrect " << incorrect_state_count << " times"; | 787 << " state was incorrect " << incorrect_state_count << " times"; |
788 ADD_FAILURE() << "Timeout reached in " << __FUNCTION__; | 788 ADD_FAILURE() << "Timeout reached in " << __FUNCTION__; |
789 return false; | 789 return false; |
790 } | 790 } |
OLD | NEW |