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/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/debug/trace_event.h" | 11 #include "base/debug/trace_event.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
14 #include "base/strings/stringprintf.h" | 14 #include "base/strings/stringprintf.h" |
15 #include "content/public/common/content_switches.h" | 15 #include "content/public/common/content_switches.h" |
16 #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" |
26 #include "content/shell/renderer/test_runner/spell_check_client.h" | 25 #include "content/shell/renderer/test_runner/spell_check_client.h" |
27 #include "content/shell/renderer/test_runner/test_interfaces.h" | 26 #include "content/shell/renderer/test_runner/test_interfaces.h" |
| 27 #include "content/shell/renderer/test_runner/test_plugin.h" |
28 #include "content/shell/renderer/test_runner/test_runner.h" | 28 #include "content/shell/renderer/test_runner/test_runner.h" |
29 #include "content/shell/renderer/test_runner/web_test_runner.h" | 29 #include "content/shell/renderer/test_runner/web_test_runner.h" |
30 // FIXME: Including platform_canvas.h here is a layering violation. | 30 // FIXME: Including platform_canvas.h here is a layering violation. |
31 #include "skia/ext/platform_canvas.h" | 31 #include "skia/ext/platform_canvas.h" |
32 #include "third_party/WebKit/public/platform/Platform.h" | 32 #include "third_party/WebKit/public/platform/Platform.h" |
33 #include "third_party/WebKit/public/platform/WebCString.h" | 33 #include "third_party/WebKit/public/platform/WebCString.h" |
34 #include "third_party/WebKit/public/platform/WebClipboard.h" | 34 #include "third_party/WebKit/public/platform/WebClipboard.h" |
35 #include "third_party/WebKit/public/platform/WebURLError.h" | 35 #include "third_party/WebKit/public/platform/WebURLError.h" |
36 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 36 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
37 #include "third_party/WebKit/public/platform/WebURLResponse.h" | 37 #include "third_party/WebKit/public/platform/WebURLResponse.h" |
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
782 return false; | 782 return false; |
783 if (test_interfaces_->GetTestRunner()->shouldDumpCreateView()) | 783 if (test_interfaces_->GetTestRunner()->shouldDumpCreateView()) |
784 delegate_->printMessage(std::string("createView(") + | 784 delegate_->printMessage(std::string("createView(") + |
785 URLDescription(request.url()) + ")\n"); | 785 URLDescription(request.url()) + ")\n"); |
786 return true; | 786 return true; |
787 } | 787 } |
788 | 788 |
789 blink::WebPlugin* WebTestProxyBase::CreatePlugin( | 789 blink::WebPlugin* WebTestProxyBase::CreatePlugin( |
790 blink::WebLocalFrame* frame, | 790 blink::WebLocalFrame* frame, |
791 const blink::WebPluginParams& params) { | 791 const blink::WebPluginParams& params) { |
792 if (TestPlugin::isSupportedMimeType(params.mimeType)) | 792 if (TestPlugin::IsSupportedMimeType(params.mimeType)) |
793 return TestPlugin::create(frame, params, delegate_); | 793 return TestPlugin::create(frame, params, delegate_); |
794 return 0; | 794 return 0; |
795 } | 795 } |
796 | 796 |
797 void WebTestProxyBase::SetStatusText(const blink::WebString& text) { | 797 void WebTestProxyBase::SetStatusText(const blink::WebString& text) { |
798 if (!test_interfaces_->GetTestRunner()->shouldDumpStatusCallbacks()) | 798 if (!test_interfaces_->GetTestRunner()->shouldDumpStatusCallbacks()) |
799 return; | 799 return; |
800 delegate_->printMessage( | 800 delegate_->printMessage( |
801 std::string("UI DELEGATE STATUS CALLBACK: setStatusText:") + | 801 std::string("UI DELEGATE STATUS CALLBACK: setStatusText:") + |
802 text.utf8().data() + "\n"); | 802 text.utf8().data() + "\n"); |
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1265 if (!push_client_.get()) | 1265 if (!push_client_.get()) |
1266 push_client_.reset(new MockWebPushClient); | 1266 push_client_.reset(new MockWebPushClient); |
1267 return push_client_.get(); | 1267 return push_client_.get(); |
1268 } | 1268 } |
1269 | 1269 |
1270 blink::WebPushClient* WebTestProxyBase::GetWebPushClient() { | 1270 blink::WebPushClient* WebTestProxyBase::GetWebPushClient() { |
1271 return GetPushClientMock(); | 1271 return GetPushClientMock(); |
1272 } | 1272 } |
1273 | 1273 |
1274 } // namespace content | 1274 } // namespace content |
OLD | NEW |