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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 } | 110 } |
111 | 111 |
112 UITestBase::~UITestBase() {} | 112 UITestBase::~UITestBase() {} |
113 | 113 |
114 void UITestBase::SetUp() { | 114 void UITestBase::SetUp() { |
115 // Tests that do a session restore (e.g. SessionRestoreUITest, StartupTest) | 115 // Tests that do a session restore (e.g. SessionRestoreUITest, StartupTest) |
116 // call SetUp() multiple times because they restart the browser mid-test. | 116 // call SetUp() multiple times because they restart the browser mid-test. |
117 // We don't want to reset the ProxyLauncher's state in those cases. | 117 // We don't want to reset the ProxyLauncher's state in those cases. |
118 if (!launcher_.get()) | 118 if (!launcher_.get()) |
119 launcher_.reset(CreateProxyLauncher()); | 119 launcher_.reset(CreateProxyLauncher()); |
120 launcher_->AssertAppNotRunning(L"Please close any other instances " | 120 launcher_->AssertAppNotRunning("Please close any other instances " |
121 L"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 launcher_->InitializeConnection(DefaultLaunchState(), |
129 wait_for_initial_loads_); | 129 wait_for_initial_loads_); |
130 } | 130 } |
131 | 131 |
(...skipping 649 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 |