OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/shell/renderer/test_runner/web_test_proxy.h" | 5 #include "content/shell/renderer/test_runner/web_test_proxy.h" |
6 | 6 |
7 #include <cctype> | 7 #include <cctype> |
8 | 8 |
9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 : test_interfaces_(NULL), | 312 : test_interfaces_(NULL), |
313 delegate_(NULL), | 313 delegate_(NULL), |
314 web_widget_(NULL), | 314 web_widget_(NULL), |
315 spellcheck_(new SpellCheckClient(this)), | 315 spellcheck_(new SpellCheckClient(this)), |
316 chooser_count_(0) { | 316 chooser_count_(0) { |
317 Reset(); | 317 Reset(); |
318 } | 318 } |
319 | 319 |
320 WebTestProxyBase::~WebTestProxyBase() { | 320 WebTestProxyBase::~WebTestProxyBase() { |
321 test_interfaces_->windowClosed(this); | 321 test_interfaces_->windowClosed(this); |
| 322 // Tests must wait for readback requests to finish before notifying that |
| 323 // they are done. |
| 324 CHECK_EQ(0u, composite_and_readback_callbacks_.size()); |
322 } | 325 } |
323 | 326 |
324 void WebTestProxyBase::SetInterfaces(WebTestInterfaces* interfaces) { | 327 void WebTestProxyBase::SetInterfaces(WebTestInterfaces* interfaces) { |
325 test_interfaces_ = interfaces->testInterfaces(); | 328 test_interfaces_ = interfaces->testInterfaces(); |
326 test_interfaces_->windowOpened(this); | 329 test_interfaces_->windowOpened(this); |
327 } | 330 } |
328 | 331 |
329 void WebTestProxyBase::SetDelegate(WebTestDelegate* delegate) { | 332 void WebTestProxyBase::SetDelegate(WebTestDelegate* delegate) { |
330 delegate_ = delegate; | 333 delegate_ = delegate; |
331 spellcheck_->setDelegate(delegate); | 334 spellcheck_->setDelegate(delegate); |
(...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1239 if (!push_client_.get()) | 1242 if (!push_client_.get()) |
1240 push_client_.reset(new MockWebPushClient); | 1243 push_client_.reset(new MockWebPushClient); |
1241 return push_client_.get(); | 1244 return push_client_.get(); |
1242 } | 1245 } |
1243 | 1246 |
1244 blink::WebPushClient* WebTestProxyBase::GetWebPushClient() { | 1247 blink::WebPushClient* WebTestProxyBase::GetWebPushClient() { |
1245 return GetPushClientMock(); | 1248 return GetPushClientMock(); |
1246 } | 1249 } |
1247 | 1250 |
1248 } // namespace content | 1251 } // namespace content |
OLD | NEW |