| 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/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
| 13 #include "base/strings/stringprintf.h" | 13 #include "base/strings/stringprintf.h" |
| 14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
| 15 #include "base/trace_event/trace_event.h" | 15 #include "base/trace_event/trace_event.h" |
| 16 #include "components/plugins/renderer/test_plugin_placeholder.h" |
| 16 #include "content/shell/renderer/test_runner/accessibility_controller.h" | 17 #include "content/shell/renderer/test_runner/accessibility_controller.h" |
| 17 #include "content/shell/renderer/test_runner/event_sender.h" | 18 #include "content/shell/renderer/test_runner/event_sender.h" |
| 18 #include "content/shell/renderer/test_runner/mock_color_chooser.h" | 19 #include "content/shell/renderer/test_runner/mock_color_chooser.h" |
| 19 #include "content/shell/renderer/test_runner/mock_credential_manager_client.h" | 20 #include "content/shell/renderer/test_runner/mock_credential_manager_client.h" |
| 20 #include "content/shell/renderer/test_runner/mock_screen_orientation_client.h" | 21 #include "content/shell/renderer/test_runner/mock_screen_orientation_client.h" |
| 21 #include "content/shell/renderer/test_runner/mock_web_speech_recognizer.h" | 22 #include "content/shell/renderer/test_runner/mock_web_speech_recognizer.h" |
| 22 #include "content/shell/renderer/test_runner/mock_web_user_media_client.h" | 23 #include "content/shell/renderer/test_runner/mock_web_user_media_client.h" |
| 23 #include "content/shell/renderer/test_runner/spell_check_client.h" | 24 #include "content/shell/renderer/test_runner/spell_check_client.h" |
| 24 #include "content/shell/renderer/test_runner/test_interfaces.h" | 25 #include "content/shell/renderer/test_runner/test_interfaces.h" |
| 25 #include "content/shell/renderer/test_runner/test_plugin.h" | 26 #include "content/shell/renderer/test_runner/test_plugin.h" |
| (...skipping 882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 908 delegate_->PrintMessage(std::string("createView(") + | 909 delegate_->PrintMessage(std::string("createView(") + |
| 909 URLDescription(request.url()) + ")\n"); | 910 URLDescription(request.url()) + ")\n"); |
| 910 return true; | 911 return true; |
| 911 } | 912 } |
| 912 | 913 |
| 913 blink::WebPlugin* WebTestProxyBase::CreatePlugin( | 914 blink::WebPlugin* WebTestProxyBase::CreatePlugin( |
| 914 blink::WebLocalFrame* frame, | 915 blink::WebLocalFrame* frame, |
| 915 const blink::WebPluginParams& params) { | 916 const blink::WebPluginParams& params) { |
| 916 if (TestPlugin::IsSupportedMimeType(params.mimeType)) | 917 if (TestPlugin::IsSupportedMimeType(params.mimeType)) |
| 917 return TestPlugin::create(frame, params, delegate_); | 918 return TestPlugin::create(frame, params, delegate_); |
| 919 if (params.mimeType == "application/x-plugin-placeholder-test") |
| 920 return (new plugins::TestPluginPlaceholder(frame, params))->plugin(); |
| 921 |
| 918 return 0; | 922 return 0; |
| 919 } | 923 } |
| 920 | 924 |
| 921 void WebTestProxyBase::SetStatusText(const blink::WebString& text) { | 925 void WebTestProxyBase::SetStatusText(const blink::WebString& text) { |
| 922 if (!test_interfaces_->GetTestRunner()->shouldDumpStatusCallbacks()) | 926 if (!test_interfaces_->GetTestRunner()->shouldDumpStatusCallbacks()) |
| 923 return; | 927 return; |
| 924 delegate_->PrintMessage( | 928 delegate_->PrintMessage( |
| 925 std::string("UI DELEGATE STATUS CALLBACK: setStatusText:") + | 929 std::string("UI DELEGATE STATUS CALLBACK: setStatusText:") + |
| 926 text.utf8().data() + "\n"); | 930 text.utf8().data() + "\n"); |
| 927 } | 931 } |
| (...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1390 // to cancel the input method's ongoing composition session. | 1394 // to cancel the input method's ongoing composition session. |
| 1391 if (web_widget_) | 1395 if (web_widget_) |
| 1392 web_widget_->confirmComposition(); | 1396 web_widget_->confirmComposition(); |
| 1393 } | 1397 } |
| 1394 | 1398 |
| 1395 blink::WebString WebTestProxyBase::acceptLanguages() { | 1399 blink::WebString WebTestProxyBase::acceptLanguages() { |
| 1396 return blink::WebString::fromUTF8(accept_languages_); | 1400 return blink::WebString::fromUTF8(accept_languages_); |
| 1397 } | 1401 } |
| 1398 | 1402 |
| 1399 } // namespace content | 1403 } // namespace content |
| OLD | NEW |