OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // This file contains the definition for LayoutTestController. | 5 // This file contains the definition for LayoutTestController. |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "webkit/tools/test_shell/layout_test_controller.h" | 9 #include "webkit/tools/test_shell/layout_test_controller.h" |
10 | 10 |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 is_debugger_present = ::IsDebuggerPresent(); | 153 is_debugger_present = ::IsDebuggerPresent(); |
154 #endif | 154 #endif |
155 | 155 |
156 if (!is_debugger_present) { | 156 if (!is_debugger_present) { |
157 // TODO(ojan): Use base::OneShotTimer. For some reason, using OneShotTimer | 157 // TODO(ojan): Use base::OneShotTimer. For some reason, using OneShotTimer |
158 // seems to cause layout test failures on the try bots. | 158 // seems to cause layout test failures on the try bots. |
159 MessageLoop::current()->PostDelayedTask( | 159 MessageLoop::current()->PostDelayedTask( |
160 FROM_HERE, | 160 FROM_HERE, |
161 base::Bind(&LayoutTestController::notifyDoneTimedOut, | 161 base::Bind(&LayoutTestController::notifyDoneTimedOut, |
162 weak_factory_.GetWeakPtr()), | 162 weak_factory_.GetWeakPtr()), |
163 shell_->GetLayoutTestTimeout()); | 163 base::TimeDelta::FromMilliseconds(shell_->GetLayoutTestTimeout())); |
164 } | 164 } |
165 | 165 |
166 wait_until_done_ = true; | 166 wait_until_done_ = true; |
167 result->SetNull(); | 167 result->SetNull(); |
168 } | 168 } |
169 | 169 |
170 void LayoutTestController::notifyDone( | 170 void LayoutTestController::notifyDone( |
171 const CppArgumentList& args, CppVariant* result) { | 171 const CppArgumentList& args, CppVariant* result) { |
172 // Test didn't timeout. Kill the timeout timer. | 172 // Test didn't timeout. Kill the timeout timer. |
173 weak_factory_.InvalidateWeakPtrs(); | 173 weak_factory_.InvalidateWeakPtrs(); |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 } | 276 } |
277 result->SetNull(); | 277 result->SetNull(); |
278 } | 278 } |
279 | 279 |
280 void LayoutTestController::LogErrorToConsole(const std::string& text) { | 280 void LayoutTestController::LogErrorToConsole(const std::string& text) { |
281 shell_->delegate()->didAddMessageToConsole( | 281 shell_->delegate()->didAddMessageToConsole( |
282 WebConsoleMessage(WebConsoleMessage::LevelError, | 282 WebConsoleMessage(WebConsoleMessage::LevelError, |
283 WebString::fromUTF8(text)), | 283 WebString::fromUTF8(text)), |
284 WebString(), 0); | 284 WebString(), 0); |
285 } | 285 } |
OLD | NEW |