Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(259)

Side by Side Diff: content/shell/renderer/test_runner/web_test_proxy.cc

Issue 1158063002: Add plugins::TestPluginPlaceholder class and allow its use in Blink layout tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pluginfix
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "content/shell/renderer/test_runner/accessibility_controller.h" 16 #include "content/shell/renderer/test_runner/accessibility_controller.h"
17 #include "content/shell/renderer/test_runner/event_sender.h" 17 #include "content/shell/renderer/test_runner/event_sender.h"
18 #include "content/shell/renderer/test_runner/mock_color_chooser.h" 18 #include "content/shell/renderer/test_runner/mock_color_chooser.h"
19 #include "content/shell/renderer/test_runner/mock_credential_manager_client.h" 19 #include "content/shell/renderer/test_runner/mock_credential_manager_client.h"
20 #include "content/shell/renderer/test_runner/mock_screen_orientation_client.h" 20 #include "content/shell/renderer/test_runner/mock_screen_orientation_client.h"
21 #include "content/shell/renderer/test_runner/mock_web_speech_recognizer.h" 21 #include "content/shell/renderer/test_runner/mock_web_speech_recognizer.h"
22 #include "content/shell/renderer/test_runner/mock_web_user_media_client.h" 22 #include "content/shell/renderer/test_runner/mock_web_user_media_client.h"
23 #include "content/shell/renderer/test_runner/spell_check_client.h" 23 #include "content/shell/renderer/test_runner/spell_check_client.h"
24 #include "content/shell/renderer/test_runner/test_interfaces.h" 24 #include "content/shell/renderer/test_runner/test_interfaces.h"
25 #include "content/shell/renderer/test_runner/test_plugin.h" 25 #include "content/shell/renderer/test_runner/test_plugin.h"
26 #include "content/shell/renderer/test_runner/test_plugin_placeholder.h"
26 #include "content/shell/renderer/test_runner/test_runner.h" 27 #include "content/shell/renderer/test_runner/test_runner.h"
27 #include "content/shell/renderer/test_runner/web_test_delegate.h" 28 #include "content/shell/renderer/test_runner/web_test_delegate.h"
28 #include "content/shell/renderer/test_runner/web_test_interfaces.h" 29 #include "content/shell/renderer/test_runner/web_test_interfaces.h"
29 #include "content/shell/renderer/test_runner/web_test_runner.h" 30 #include "content/shell/renderer/test_runner/web_test_runner.h"
30 // FIXME: Including platform_canvas.h here is a layering violation. 31 // FIXME: Including platform_canvas.h here is a layering violation.
31 #include "skia/ext/platform_canvas.h" 32 #include "skia/ext/platform_canvas.h"
32 #include "third_party/WebKit/public/platform/Platform.h" 33 #include "third_party/WebKit/public/platform/Platform.h"
33 #include "third_party/WebKit/public/platform/WebCString.h" 34 #include "third_party/WebKit/public/platform/WebCString.h"
34 #include "third_party/WebKit/public/platform/WebClipboard.h" 35 #include "third_party/WebKit/public/platform/WebClipboard.h"
35 #include "third_party/WebKit/public/platform/WebCompositeAndReadbackAsyncCallbac k.h" 36 #include "third_party/WebKit/public/platform/WebCompositeAndReadbackAsyncCallbac k.h"
(...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 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 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
1393 // to cancel the input method's ongoing composition session. 1397 // to cancel the input method's ongoing composition session.
1394 if (web_widget_) 1398 if (web_widget_)
1395 web_widget_->confirmComposition(); 1399 web_widget_->confirmComposition();
1396 } 1400 }
1397 1401
1398 blink::WebString WebTestProxyBase::acceptLanguages() { 1402 blink::WebString WebTestProxyBase::acceptLanguages() {
1399 return blink::WebString::fromUTF8(accept_languages_); 1403 return blink::WebString::fromUTF8(accept_languages_);
1400 } 1404 }
1401 1405
1402 } // namespace content 1406 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698