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" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/strings/stringprintf.h" | 12 #include "base/strings/stringprintf.h" |
13 #include "content/shell/renderer/test_runner/SpellCheckClient.h" | |
14 #include "content/shell/renderer/test_runner/TestCommon.h" | 13 #include "content/shell/renderer/test_runner/TestCommon.h" |
15 #include "content/shell/renderer/test_runner/TestInterfaces.h" | 14 #include "content/shell/renderer/test_runner/TestInterfaces.h" |
16 #include "content/shell/renderer/test_runner/TestPlugin.h" | 15 #include "content/shell/renderer/test_runner/TestPlugin.h" |
17 #include "content/shell/renderer/test_runner/WebTestDelegate.h" | 16 #include "content/shell/renderer/test_runner/WebTestDelegate.h" |
18 #include "content/shell/renderer/test_runner/WebTestInterfaces.h" | 17 #include "content/shell/renderer/test_runner/WebTestInterfaces.h" |
19 #include "content/shell/renderer/test_runner/accessibility_controller.h" | 18 #include "content/shell/renderer/test_runner/accessibility_controller.h" |
20 #include "content/shell/renderer/test_runner/event_sender.h" | 19 #include "content/shell/renderer/test_runner/event_sender.h" |
21 #include "content/shell/renderer/test_runner/mock_color_chooser.h" | 20 #include "content/shell/renderer/test_runner/mock_color_chooser.h" |
22 #include "content/shell/renderer/test_runner/mock_screen_orientation_client.h" | 21 #include "content/shell/renderer/test_runner/mock_screen_orientation_client.h" |
23 #include "content/shell/renderer/test_runner/mock_web_push_client.h" | 22 #include "content/shell/renderer/test_runner/mock_web_push_client.h" |
24 #include "content/shell/renderer/test_runner/mock_web_speech_recognizer.h" | 23 #include "content/shell/renderer/test_runner/mock_web_speech_recognizer.h" |
25 #include "content/shell/renderer/test_runner/mock_web_user_media_client.h" | 24 #include "content/shell/renderer/test_runner/mock_web_user_media_client.h" |
| 25 #include "content/shell/renderer/test_runner/spell_check_client.h" |
26 #include "content/shell/renderer/test_runner/test_runner.h" | 26 #include "content/shell/renderer/test_runner/test_runner.h" |
27 #include "content/shell/renderer/test_runner/web_test_runner.h" | 27 #include "content/shell/renderer/test_runner/web_test_runner.h" |
28 // FIXME: Including platform_canvas.h here is a layering violation. | 28 // FIXME: Including platform_canvas.h here is a layering violation. |
29 #include "skia/ext/platform_canvas.h" | 29 #include "skia/ext/platform_canvas.h" |
30 #include "third_party/WebKit/public/platform/Platform.h" | 30 #include "third_party/WebKit/public/platform/Platform.h" |
31 #include "third_party/WebKit/public/platform/WebCString.h" | 31 #include "third_party/WebKit/public/platform/WebCString.h" |
32 #include "third_party/WebKit/public/platform/WebClipboard.h" | 32 #include "third_party/WebKit/public/platform/WebClipboard.h" |
33 #include "third_party/WebKit/public/platform/WebURLError.h" | 33 #include "third_party/WebKit/public/platform/WebURLError.h" |
34 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 34 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
35 #include "third_party/WebKit/public/platform/WebURLResponse.h" | 35 #include "third_party/WebKit/public/platform/WebURLResponse.h" |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 CHECK_EQ(0u, composite_and_readback_callbacks_.size()); | 323 CHECK_EQ(0u, composite_and_readback_callbacks_.size()); |
324 } | 324 } |
325 | 325 |
326 void WebTestProxyBase::SetInterfaces(WebTestInterfaces* interfaces) { | 326 void WebTestProxyBase::SetInterfaces(WebTestInterfaces* interfaces) { |
327 test_interfaces_ = interfaces->testInterfaces(); | 327 test_interfaces_ = interfaces->testInterfaces(); |
328 test_interfaces_->windowOpened(this); | 328 test_interfaces_->windowOpened(this); |
329 } | 329 } |
330 | 330 |
331 void WebTestProxyBase::SetDelegate(WebTestDelegate* delegate) { | 331 void WebTestProxyBase::SetDelegate(WebTestDelegate* delegate) { |
332 delegate_ = delegate; | 332 delegate_ = delegate; |
333 spellcheck_->setDelegate(delegate); | 333 spellcheck_->SetDelegate(delegate); |
334 if (speech_recognizer_.get()) | 334 if (speech_recognizer_.get()) |
335 speech_recognizer_->SetDelegate(delegate); | 335 speech_recognizer_->SetDelegate(delegate); |
336 } | 336 } |
337 | 337 |
338 blink::WebView* WebTestProxyBase::GetWebView() const { | 338 blink::WebView* WebTestProxyBase::GetWebView() const { |
339 DCHECK(web_widget_); | 339 DCHECK(web_widget_); |
340 // TestRunner does not support popup widgets. So |web_widget|_ is always a | 340 // TestRunner does not support popup widgets. So |web_widget|_ is always a |
341 // WebView. | 341 // WebView. |
342 return static_cast<blink::WebView*>(web_widget_); | 342 return static_cast<blink::WebView*>(web_widget_); |
343 } | 343 } |
(...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1252 if (!push_client_.get()) | 1252 if (!push_client_.get()) |
1253 push_client_.reset(new MockWebPushClient); | 1253 push_client_.reset(new MockWebPushClient); |
1254 return push_client_.get(); | 1254 return push_client_.get(); |
1255 } | 1255 } |
1256 | 1256 |
1257 blink::WebPushClient* WebTestProxyBase::GetWebPushClient() { | 1257 blink::WebPushClient* WebTestProxyBase::GetWebPushClient() { |
1258 return GetPushClientMock(); | 1258 return GetPushClientMock(); |
1259 } | 1259 } |
1260 | 1260 |
1261 } // namespace content | 1261 } // namespace content |
OLD | NEW |