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

Side by Side Diff: content/shell/renderer/layout_test/blink_test_runner.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/layout_test/blink_test_runner.h" 5 #include "content/shell/renderer/layout_test/blink_test_runner.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <clocale> 8 #include <clocale>
9 #include <cmath> 9 #include <cmath>
10 10
(...skipping 18 matching lines...) Expand all
29 #include "content/public/renderer/render_view_visitor.h" 29 #include "content/public/renderer/render_view_visitor.h"
30 #include "content/public/renderer/renderer_gamepad_provider.h" 30 #include "content/public/renderer/renderer_gamepad_provider.h"
31 #include "content/public/test/layouttest_support.h" 31 #include "content/public/test/layouttest_support.h"
32 #include "content/shell/common/layout_test/layout_test_messages.h" 32 #include "content/shell/common/layout_test/layout_test_messages.h"
33 #include "content/shell/common/shell_messages.h" 33 #include "content/shell/common/shell_messages.h"
34 #include "content/shell/common/shell_switches.h" 34 #include "content/shell/common/shell_switches.h"
35 #include "content/shell/renderer/layout_test/blink_test_helpers.h" 35 #include "content/shell/renderer/layout_test/blink_test_helpers.h"
36 #include "content/shell/renderer/layout_test/gc_controller.h" 36 #include "content/shell/renderer/layout_test/gc_controller.h"
37 #include "content/shell/renderer/layout_test/layout_test_render_process_observer .h" 37 #include "content/shell/renderer/layout_test/layout_test_render_process_observer .h"
38 #include "content/shell/renderer/layout_test/leak_detector.h" 38 #include "content/shell/renderer/layout_test/leak_detector.h"
39 #include "content/shell/renderer/layout_test/test_plugin_placeholder.h"
39 #include "content/shell/renderer/test_runner/app_banner_client.h" 40 #include "content/shell/renderer/test_runner/app_banner_client.h"
40 #include "content/shell/renderer/test_runner/gamepad_controller.h" 41 #include "content/shell/renderer/test_runner/gamepad_controller.h"
41 #include "content/shell/renderer/test_runner/mock_screen_orientation_client.h" 42 #include "content/shell/renderer/test_runner/mock_screen_orientation_client.h"
42 #include "content/shell/renderer/test_runner/test_interfaces.h" 43 #include "content/shell/renderer/test_runner/test_interfaces.h"
43 #include "content/shell/renderer/test_runner/web_task.h" 44 #include "content/shell/renderer/test_runner/web_task.h"
44 #include "content/shell/renderer/test_runner/web_test_interfaces.h" 45 #include "content/shell/renderer/test_runner/web_test_interfaces.h"
45 #include "content/shell/renderer/test_runner/web_test_proxy.h" 46 #include "content/shell/renderer/test_runner/web_test_proxy.h"
46 #include "content/shell/renderer/test_runner/web_test_runner.h" 47 #include "content/shell/renderer/test_runner/web_test_runner.h"
47 #include "net/base/filename_util.h" 48 #include "net/base/filename_util.h"
48 #include "net/base/net_errors.h" 49 #include "net/base/net_errors.h"
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
665 blink::WebVector<blink::WebString> blink_event_platforms(blink_web_strings); 666 blink::WebVector<blink::WebString> blink_event_platforms(blink_web_strings);
666 667
667 WebLocalFrame* main_frame = 668 WebLocalFrame* main_frame =
668 render_view()->GetWebView()->mainFrame()->toWebLocalFrame(); 669 render_view()->GetWebView()->mainFrame()->toWebLocalFrame();
669 main_frame->willShowInstallBannerPrompt(request_id, blink_event_platforms, 670 main_frame->willShowInstallBannerPrompt(request_id, blink_event_platforms,
670 &reply); 671 &reply);
671 672
672 callback.Run(reply == blink::WebAppBannerPromptReply::Cancel); 673 callback.Run(reply == blink::WebAppBannerPromptReply::Cancel);
673 } 674 }
674 675
675 void BlinkTestRunner::ResolveBeforeInstallPromptPromise( 676 void BlinkTestRunner::ResolveBeforeInstallPromptPromise(
676 int request_id, const std::string& platform) { 677 int request_id, const std::string& platform) {
677 WebTestInterfaces* interfaces = 678 WebTestInterfaces* interfaces =
678 LayoutTestRenderProcessObserver::GetInstance()->test_interfaces(); 679 LayoutTestRenderProcessObserver::GetInstance()->test_interfaces();
679 interfaces->GetTestInterfaces()->GetAppBannerClient()->ResolvePromise( 680 interfaces->GetTestInterfaces()->GetAppBannerClient()->ResolvePromise(
680 request_id, platform); 681 request_id, platform);
681 } 682 }
682 683
684 blink::WebPlugin* BlinkTestRunner::CreatePluginPlaceholder(
685 blink::WebLocalFrame* frame, const blink::WebPluginParams& params) {
686 if (params.mimeType == "application/x-plugin-placeholder-test")
687 return (new TestPluginPlaceholder(frame, params))->plugin();
688 return 0;
689 }
690
683 // RenderViewObserver -------------------------------------------------------- 691 // RenderViewObserver --------------------------------------------------------
684 692
685 void BlinkTestRunner::DidClearWindowObject(WebLocalFrame* frame) { 693 void BlinkTestRunner::DidClearWindowObject(WebLocalFrame* frame) {
686 WebTestingSupport::injectInternalsObject(frame); 694 WebTestingSupport::injectInternalsObject(frame);
687 LayoutTestRenderProcessObserver::GetInstance()->test_interfaces()->BindTo( 695 LayoutTestRenderProcessObserver::GetInstance()->test_interfaces()->BindTo(
688 frame); 696 frame);
689 GCController::Install(frame); 697 GCController::Install(frame);
690 } 698 }
691 699
692 bool BlinkTestRunner::OnMessageReceived(const IPC::Message& message) { 700 bool BlinkTestRunner::OnMessageReceived(const IPC::Message& message) {
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
875 883
876 leak_detector_->TryLeakDetection(main_frame); 884 leak_detector_->TryLeakDetection(main_frame);
877 } 885 }
878 886
879 void BlinkTestRunner::ReportLeakDetectionResult( 887 void BlinkTestRunner::ReportLeakDetectionResult(
880 const LeakDetectionResult& report) { 888 const LeakDetectionResult& report) {
881 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report)); 889 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report));
882 } 890 }
883 891
884 } // namespace content 892 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/renderer/layout_test/blink_test_runner.h ('k') | content/shell/renderer/layout_test/test_plugin_placeholder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698