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

Side by Side Diff: content/shell/renderer/layout_test/blink_test_runner.cc

Issue 1807643002: Make test_runner::AppBannerClient an internal detail of components/test_runner. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebasing... Created 4 years, 9 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 <stddef.h> 7 #include <stddef.h>
8 #include <algorithm> 8 #include <algorithm>
9 #include <clocale> 9 #include <clocale>
10 #include <cmath> 10 #include <cmath>
(...skipping 11 matching lines...) Expand all
22 #include "base/single_thread_task_runner.h" 22 #include "base/single_thread_task_runner.h"
23 #include "base/strings/string_util.h" 23 #include "base/strings/string_util.h"
24 #include "base/strings/stringprintf.h" 24 #include "base/strings/stringprintf.h"
25 #include "base/strings/sys_string_conversions.h" 25 #include "base/strings/sys_string_conversions.h"
26 #include "base/strings/utf_string_conversions.h" 26 #include "base/strings/utf_string_conversions.h"
27 #include "base/thread_task_runner_handle.h" 27 #include "base/thread_task_runner_handle.h"
28 #include "base/time/time.h" 28 #include "base/time/time.h"
29 #include "base/values.h" 29 #include "base/values.h"
30 #include "build/build_config.h" 30 #include "build/build_config.h"
31 #include "components/plugins/renderer/plugin_placeholder.h" 31 #include "components/plugins/renderer/plugin_placeholder.h"
32 #include "components/test_runner/app_banner_client.h"
33 #include "components/test_runner/gamepad_controller.h" 32 #include "components/test_runner/gamepad_controller.h"
34 #include "components/test_runner/layout_dump.h" 33 #include "components/test_runner/layout_dump.h"
35 #include "components/test_runner/layout_dump_flags.h" 34 #include "components/test_runner/layout_dump_flags.h"
36 #include "components/test_runner/mock_screen_orientation_client.h" 35 #include "components/test_runner/mock_screen_orientation_client.h"
37 #include "components/test_runner/test_interfaces.h" 36 #include "components/test_runner/test_interfaces.h"
38 #include "components/test_runner/tracked_dictionary.h"
39 #include "components/test_runner/web_task.h" 37 #include "components/test_runner/web_task.h"
40 #include "components/test_runner/web_test_interfaces.h" 38 #include "components/test_runner/web_test_interfaces.h"
41 #include "components/test_runner/web_test_proxy.h" 39 #include "components/test_runner/web_test_proxy.h"
42 #include "components/test_runner/web_test_runner.h" 40 #include "components/test_runner/web_test_runner.h"
43 #include "content/public/common/content_switches.h" 41 #include "content/public/common/content_switches.h"
44 #include "content/public/common/url_constants.h" 42 #include "content/public/common/url_constants.h"
45 #include "content/public/common/web_preferences.h" 43 #include "content/public/common/web_preferences.h"
46 #include "content/public/renderer/media_stream_api.h" 44 #include "content/public/renderer/media_stream_api.h"
47 #include "content/public/renderer/render_frame.h" 45 #include "content/public/renderer/render_frame.h"
48 #include "content/public/renderer/render_view.h" 46 #include "content/public/renderer/render_view.h"
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after
754 blink::WebVector<blink::WebString> blink_event_platforms(blink_web_strings); 752 blink::WebVector<blink::WebString> blink_event_platforms(blink_web_strings);
755 753
756 WebLocalFrame* main_frame = 754 WebLocalFrame* main_frame =
757 render_view()->GetWebView()->mainFrame()->toWebLocalFrame(); 755 render_view()->GetWebView()->mainFrame()->toWebLocalFrame();
758 main_frame->willShowInstallBannerPrompt(request_id, blink_event_platforms, 756 main_frame->willShowInstallBannerPrompt(request_id, blink_event_platforms,
759 &reply); 757 &reply);
760 758
761 callback.Run(reply == blink::WebAppBannerPromptReply::Cancel); 759 callback.Run(reply == blink::WebAppBannerPromptReply::Cancel);
762 } 760 }
763 761
764 void BlinkTestRunner::ResolveBeforeInstallPromptPromise(
765 int request_id, const std::string& platform) {
766 test_runner::WebTestInterfaces* interfaces =
767 LayoutTestRenderProcessObserver::GetInstance()->test_interfaces();
768 if (interfaces->GetAppBannerClient())
769 interfaces->GetAppBannerClient()->ResolvePromise(request_id, platform);
770 }
771
772 blink::WebPlugin* BlinkTestRunner::CreatePluginPlaceholder( 762 blink::WebPlugin* BlinkTestRunner::CreatePluginPlaceholder(
773 blink::WebLocalFrame* frame, const blink::WebPluginParams& params) { 763 blink::WebLocalFrame* frame, const blink::WebPluginParams& params) {
774 if (params.mimeType != "application/x-plugin-placeholder-test") 764 if (params.mimeType != "application/x-plugin-placeholder-test")
775 return nullptr; 765 return nullptr;
776 766
777 plugins::PluginPlaceholder* placeholder = 767 plugins::PluginPlaceholder* placeholder =
778 new plugins::PluginPlaceholder(render_view()->GetMainRenderFrame(), frame, 768 new plugins::PluginPlaceholder(render_view()->GetMainRenderFrame(), frame,
779 params, "<div>Test content</div>"); 769 params, "<div>Test content</div>");
780 return placeholder->plugin(); 770 return placeholder->plugin();
781 } 771 }
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
1062 get_bluetooth_events_callbacks_.pop_front(); 1052 get_bluetooth_events_callbacks_.pop_front();
1063 callback.Run(events); 1053 callback.Run(events);
1064 } 1054 }
1065 1055
1066 void BlinkTestRunner::ReportLeakDetectionResult( 1056 void BlinkTestRunner::ReportLeakDetectionResult(
1067 const LeakDetectionResult& report) { 1057 const LeakDetectionResult& report) {
1068 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report)); 1058 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report));
1069 } 1059 }
1070 1060
1071 } // namespace content 1061 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698