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

Side by Side Diff: components/test_runner/web_test_interfaces.cc

Issue 1897363003: Use correct WebView from EventSender. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed initial state of EventSender. Created 4 years, 8 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "components/test_runner/web_test_interfaces.h" 5 #include "components/test_runner/web_test_interfaces.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "components/test_runner/app_banner_client.h" 9 #include "components/test_runner/app_banner_client.h"
10 #include "components/test_runner/event_sender.h"
11 #include "components/test_runner/mock_web_audio_device.h" 10 #include "components/test_runner/mock_web_audio_device.h"
12 #include "components/test_runner/mock_web_media_stream_center.h" 11 #include "components/test_runner/mock_web_media_stream_center.h"
13 #include "components/test_runner/mock_web_midi_accessor.h" 12 #include "components/test_runner/mock_web_midi_accessor.h"
14 #include "components/test_runner/mock_webrtc_peer_connection_handler.h" 13 #include "components/test_runner/mock_webrtc_peer_connection_handler.h"
15 #include "components/test_runner/test_interfaces.h" 14 #include "components/test_runner/test_interfaces.h"
16 #include "components/test_runner/test_runner.h" 15 #include "components/test_runner/test_runner.h"
17 #include "components/test_runner/web_frame_test_client.h" 16 #include "components/test_runner/web_frame_test_client.h"
18 #include "components/test_runner/web_test_proxy.h" 17 #include "components/test_runner/web_test_proxy.h"
19 #include "components/test_runner/web_view_test_client.h" 18 #include "components/test_runner/web_view_test_client.h"
20 19
21 using namespace blink; 20 using namespace blink;
22 21
23 namespace test_runner { 22 namespace test_runner {
24 23
25 WebTestInterfaces::WebTestInterfaces() : interfaces_(new TestInterfaces()) { 24 WebTestInterfaces::WebTestInterfaces() : interfaces_(new TestInterfaces()) {
26 } 25 }
27 26
28 WebTestInterfaces::~WebTestInterfaces() { 27 WebTestInterfaces::~WebTestInterfaces() {
29 } 28 }
30 29
31 void WebTestInterfaces::SetWebView(WebView* web_view, WebTestProxyBase* proxy) { 30 void WebTestInterfaces::SetWebView(WebView* web_view, WebTestProxyBase* proxy) {
32 interfaces_->SetWebView(web_view, proxy); 31 interfaces_->SetWebView(web_view, proxy);
33 } 32 }
34 33
35 void WebTestInterfaces::SetDelegate(WebTestDelegate* delegate) { 34 void WebTestInterfaces::SetDelegate(WebTestDelegate* delegate) {
36 interfaces_->SetDelegate(delegate); 35 interfaces_->SetDelegate(delegate);
37 } 36 }
38 37
39 void WebTestInterfaces::BindTo(WebFrame* frame) {
40 interfaces_->BindTo(frame);
41 }
42
43 void WebTestInterfaces::ResetAll() { 38 void WebTestInterfaces::ResetAll() {
44 interfaces_->ResetAll(); 39 interfaces_->ResetAll();
45 } 40 }
46 41
47 void WebTestInterfaces::SetTestIsRunning(bool running) { 42 void WebTestInterfaces::SetTestIsRunning(bool running) {
48 interfaces_->SetTestIsRunning(running); 43 interfaces_->SetTestIsRunning(running);
49 } 44 }
50 45
51 void WebTestInterfaces::ConfigureForTestWithURL(const WebURL& test_url, 46 void WebTestInterfaces::ConfigureForTestWithURL(const WebURL& test_url,
52 bool generate_pixels) { 47 bool generate_pixels) {
53 interfaces_->ConfigureForTestWithURL(test_url, generate_pixels); 48 interfaces_->ConfigureForTestWithURL(test_url, generate_pixels);
54 } 49 }
55 50
56 void WebTestInterfaces::SetSendWheelGestures(bool send_gestures) {
57 interfaces_->GetEventSender()->set_send_wheel_gestures(send_gestures);
58 }
59
60 WebTestRunner* WebTestInterfaces::TestRunner() { 51 WebTestRunner* WebTestInterfaces::TestRunner() {
61 return interfaces_->GetTestRunner(); 52 return interfaces_->GetTestRunner();
62 } 53 }
63 54
64 WebThemeEngine* WebTestInterfaces::ThemeEngine() { 55 WebThemeEngine* WebTestInterfaces::ThemeEngine() {
65 return interfaces_->GetThemeEngine(); 56 return interfaces_->GetThemeEngine();
66 } 57 }
67 58
68 TestInterfaces* WebTestInterfaces::GetTestInterfaces() { 59 TestInterfaces* WebTestInterfaces::GetTestInterfaces() {
69 return interfaces_.get(); 60 return interfaces_.get();
(...skipping 19 matching lines...) Expand all
89 return new MockWebAudioDevice(sample_rate); 80 return new MockWebAudioDevice(sample_rate);
90 } 81 }
91 82
92 scoped_ptr<blink::WebAppBannerClient> 83 scoped_ptr<blink::WebAppBannerClient>
93 WebTestInterfaces::CreateAppBannerClient() { 84 WebTestInterfaces::CreateAppBannerClient() {
94 scoped_ptr<AppBannerClient> client(new AppBannerClient); 85 scoped_ptr<AppBannerClient> client(new AppBannerClient);
95 interfaces_->SetAppBannerClient(client.get()); 86 interfaces_->SetAppBannerClient(client.get());
96 return std::move(client); 87 return std::move(client);
97 } 88 }
98 89
99 scoped_ptr<WebFrameTestClient> WebTestInterfaces::CreateWebFrameTestClient() { 90 scoped_ptr<WebFrameTestClient> WebTestInterfaces::CreateWebFrameTestClient(
91 WebTestProxyBase* web_test_proxy_base) {
100 return make_scoped_ptr(new WebFrameTestClient( 92 return make_scoped_ptr(new WebFrameTestClient(
101 interfaces_->GetTestRunner(), 93 interfaces_->GetTestRunner(), interfaces_->GetDelegate(),
102 interfaces_->GetDelegate(), 94 interfaces_->GetAccessibilityController(), web_test_proxy_base));
103 interfaces_->GetAccessibilityController(),
104 interfaces_->GetEventSender()));
105 } 95 }
106 96
107 scoped_ptr<WebViewTestClient> WebTestInterfaces::CreateWebViewTestClient( 97 scoped_ptr<WebViewTestClient> WebTestInterfaces::CreateWebViewTestClient(
108 WebTestProxyBase* web_test_proxy_base) { 98 WebTestProxyBase* web_test_proxy_base) {
109 return make_scoped_ptr(new WebViewTestClient(interfaces_->GetTestRunner(), 99 return make_scoped_ptr(new WebViewTestClient(interfaces_->GetTestRunner(),
110 interfaces_->GetEventSender(),
111 web_test_proxy_base)); 100 web_test_proxy_base));
112 } 101 }
113 102
114 std::vector<blink::WebView*> WebTestInterfaces::GetWindowList() { 103 std::vector<blink::WebView*> WebTestInterfaces::GetWindowList() {
115 std::vector<blink::WebView*> result; 104 std::vector<blink::WebView*> result;
116 for (WebTestProxyBase* proxy : interfaces_->GetWindowList()) 105 for (WebTestProxyBase* proxy : interfaces_->GetWindowList())
117 result.push_back(proxy->web_view()); 106 result.push_back(proxy->web_view());
118 return result; 107 return result;
119 } 108 }
120 109
121 } // namespace test_runner 110 } // namespace test_runner
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698