OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 LayoutTestController::WorkQueue::~WorkQueue() { | 96 LayoutTestController::WorkQueue::~WorkQueue() { |
97 Reset(); | 97 Reset(); |
98 } | 98 } |
99 | 99 |
100 void LayoutTestController::WorkQueue::ProcessWorkSoon() { | 100 void LayoutTestController::WorkQueue::ProcessWorkSoon() { |
101 if (shell_->delegate()->top_loading_frame()) | 101 if (shell_->delegate()->top_loading_frame()) |
102 return; | 102 return; |
103 | 103 |
104 if (!queue_.empty()) { | 104 if (!queue_.empty()) { |
105 // We delay processing queued work to avoid recursion problems. | 105 // We delay processing queued work to avoid recursion problems. |
106 timer_.Start(FROM_HERE, base::TimeDelta(), this, &WorkQueue::ProcessWork); | 106 timer_.Start(base::TimeDelta(), this, &WorkQueue::ProcessWork); |
107 } else if (!wait_until_done_) { | 107 } else if (!wait_until_done_) { |
108 shell_->TestFinished(); | 108 shell_->TestFinished(); |
109 } | 109 } |
110 } | 110 } |
111 | 111 |
112 void LayoutTestController::WorkQueue::ProcessWork() { | 112 void LayoutTestController::WorkQueue::ProcessWork() { |
113 // Quit doing work once a load is in progress. | 113 // Quit doing work once a load is in progress. |
114 while (!queue_.empty()) { | 114 while (!queue_.empty()) { |
115 bool started_load = queue_.front()->Run(shell_); | 115 bool started_load = queue_.front()->Run(shell_); |
116 delete queue_.front(); | 116 delete queue_.front(); |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 } | 269 } |
270 result->SetNull(); | 270 result->SetNull(); |
271 } | 271 } |
272 | 272 |
273 void LayoutTestController::LogErrorToConsole(const std::string& text) { | 273 void LayoutTestController::LogErrorToConsole(const std::string& text) { |
274 shell_->delegate()->didAddMessageToConsole( | 274 shell_->delegate()->didAddMessageToConsole( |
275 WebConsoleMessage(WebConsoleMessage::LevelError, | 275 WebConsoleMessage(WebConsoleMessage::LevelError, |
276 WebString::fromUTF8(text)), | 276 WebString::fromUTF8(text)), |
277 WebString(), 0); | 277 WebString(), 0); |
278 } | 278 } |
OLD | NEW |