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

Side by Side Diff: components/test_runner/web_test_proxy.h

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 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 #ifndef COMPONENTS_TEST_RUNNER_WEB_TEST_PROXY_H_ 5 #ifndef COMPONENTS_TEST_RUNNER_WEB_TEST_PROXY_H_
6 #define COMPONENTS_TEST_RUNNER_WEB_TEST_PROXY_H_ 6 #define COMPONENTS_TEST_RUNNER_WEB_TEST_PROXY_H_
7 7
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 23 matching lines...) Expand all
34 class WebString; 34 class WebString;
35 class WebView; 35 class WebView;
36 class WebWidget; 36 class WebWidget;
37 struct WebFileChooserParams; 37 struct WebFileChooserParams;
38 struct WebPoint; 38 struct WebPoint;
39 struct WebWindowFeatures; 39 struct WebWindowFeatures;
40 } 40 }
41 41
42 namespace test_runner { 42 namespace test_runner {
43 43
44 class EventSender;
44 class TestInterfaces; 45 class TestInterfaces;
45 class WebTestDelegate; 46 class WebTestDelegate;
46 class WebTestInterfaces; 47 class WebTestInterfaces;
47 48
48 // WebTestProxyBase is the "brain" of WebTestProxy in the sense that 49 // WebTestProxyBase is the "brain" of WebTestProxy in the sense that
49 // WebTestProxy does the bridge between RenderViewImpl and WebTestProxyBase and 50 // WebTestProxy does the bridge between RenderViewImpl and WebTestProxyBase and
50 // when it requires a behavior to be different from the usual, it will call 51 // when it requires a behavior to be different from the usual, it will call
51 // WebTestProxyBase that implements the expected behavior. 52 // WebTestProxyBase that implements the expected behavior.
52 // See WebTestProxy class comments for more information. 53 // See WebTestProxy class comments for more information.
53 class TEST_RUNNER_EXPORT WebTestProxyBase { 54 class TEST_RUNNER_EXPORT WebTestProxyBase {
(...skipping 18 matching lines...) Expand all
72 view_test_client_ = std::move(view_test_client); 73 view_test_client_ = std::move(view_test_client);
73 } 74 }
74 75
75 WebTestDelegate* delegate() { return delegate_; } 76 WebTestDelegate* delegate() { return delegate_; }
76 void set_delegate(WebTestDelegate* delegate) { 77 void set_delegate(WebTestDelegate* delegate) {
77 DCHECK(delegate); 78 DCHECK(delegate);
78 DCHECK(!delegate_); 79 DCHECK(!delegate_);
79 delegate_ = delegate; 80 delegate_ = delegate;
80 } 81 }
81 82
82 void SetInterfaces(WebTestInterfaces* interfaces); 83 TestInterfaces* test_interfaces() { return test_interfaces_; }
84 void SetInterfaces(WebTestInterfaces* web_test_interfaces);
85
86 EventSender* event_sender() { return event_sender_.get(); }
87 void SetSendWheelGestures(bool send_gestures);
88
89 void Reset();
90 void BindTo(blink::WebLocalFrame* frame);
83 91
84 void GetScreenOrientationForTesting(blink::WebScreenInfo&); 92 void GetScreenOrientationForTesting(blink::WebScreenInfo&);
85 93
86 protected: 94 protected:
87 WebTestProxyBase(); 95 WebTestProxyBase();
88 ~WebTestProxyBase(); 96 ~WebTestProxyBase();
89 97
90 blink::WebViewClient* view_test_client() { return view_test_client_.get(); } 98 blink::WebViewClient* view_test_client() { return view_test_client_.get(); }
91 99
92 private: 100 private:
93 TestInterfaces* test_interfaces_; 101 TestInterfaces* test_interfaces_;
94 WebTestDelegate* delegate_; 102 WebTestDelegate* delegate_;
95 blink::WebView* web_view_; 103 blink::WebView* web_view_;
96 blink::WebWidget* web_widget_; 104 blink::WebWidget* web_widget_;
97 scoped_ptr<WebViewTestClient> view_test_client_; 105 scoped_ptr<WebViewTestClient> view_test_client_;
106 scoped_ptr<EventSender> event_sender_;
98 107
99 DISALLOW_COPY_AND_ASSIGN(WebTestProxyBase); 108 DISALLOW_COPY_AND_ASSIGN(WebTestProxyBase);
100 }; 109 };
101 110
102 // WebTestProxy is used during LayoutTests and always instantiated, at time of 111 // WebTestProxy is used during LayoutTests and always instantiated, at time of
103 // writing with Base=RenderViewImpl. It does not directly inherit from it for 112 // writing with Base=RenderViewImpl. It does not directly inherit from it for
104 // layering purposes. 113 // layering purposes.
105 // The intent of that class is to wrap RenderViewImpl for tests purposes in 114 // The intent of that class is to wrap RenderViewImpl for tests purposes in
106 // order to reduce the amount of test specific code in the production code. 115 // order to reduce the amount of test specific code in the production code.
107 // WebTestProxy is only doing the glue between RenderViewImpl and 116 // WebTestProxy is only doing the glue between RenderViewImpl and
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 218
210 private: 219 private:
211 virtual ~WebTestProxy() {} 220 virtual ~WebTestProxy() {}
212 221
213 DISALLOW_COPY_AND_ASSIGN(WebTestProxy); 222 DISALLOW_COPY_AND_ASSIGN(WebTestProxy);
214 }; 223 };
215 224
216 } // namespace test_runner 225 } // namespace test_runner
217 226
218 #endif // COMPONENTS_TEST_RUNNER_WEB_TEST_PROXY_H_ 227 #endif // COMPONENTS_TEST_RUNNER_WEB_TEST_PROXY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698