OLD | NEW |
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 <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 25 matching lines...) Expand all Loading... |
36 class WebView; | 36 class WebView; |
37 class WebWidget; | 37 class WebWidget; |
38 struct WebFileChooserParams; | 38 struct WebFileChooserParams; |
39 struct WebPoint; | 39 struct WebPoint; |
40 struct WebWindowFeatures; | 40 struct WebWindowFeatures; |
41 } | 41 } |
42 | 42 |
43 namespace test_runner { | 43 namespace test_runner { |
44 | 44 |
45 class AccessibilityController; | 45 class AccessibilityController; |
46 class EventSender; | |
47 class TestInterfaces; | 46 class TestInterfaces; |
48 class TestRunnerForSpecificView; | 47 class TestRunnerForSpecificView; |
49 class TextInputController; | 48 class TextInputController; |
50 class WebTestDelegate; | 49 class WebTestDelegate; |
51 class WebTestInterfaces; | 50 class WebTestInterfaces; |
52 | 51 |
53 // WebTestProxyBase is the "brain" of WebTestProxy in the sense that | 52 // WebTestProxyBase is the "brain" of WebTestProxy in the sense that |
54 // WebTestProxy does the bridge between RenderViewImpl and WebTestProxyBase and | 53 // WebTestProxy does the bridge between RenderViewImpl and WebTestProxyBase and |
55 // when it requires a behavior to be different from the usual, it will call | 54 // when it requires a behavior to be different from the usual, it will call |
56 // WebTestProxyBase that implements the expected behavior. | 55 // WebTestProxyBase that implements the expected behavior. |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 WebTestDelegate* delegate() { return delegate_; } | 87 WebTestDelegate* delegate() { return delegate_; } |
89 void set_delegate(WebTestDelegate* delegate) { | 88 void set_delegate(WebTestDelegate* delegate) { |
90 DCHECK(delegate); | 89 DCHECK(delegate); |
91 DCHECK(!delegate_); | 90 DCHECK(!delegate_); |
92 delegate_ = delegate; | 91 delegate_ = delegate; |
93 } | 92 } |
94 | 93 |
95 TestInterfaces* test_interfaces() { return test_interfaces_; } | 94 TestInterfaces* test_interfaces() { return test_interfaces_; } |
96 void SetInterfaces(WebTestInterfaces* web_test_interfaces); | 95 void SetInterfaces(WebTestInterfaces* web_test_interfaces); |
97 | 96 |
98 EventSender* event_sender() { return event_sender_.get(); } | |
99 void SetSendWheelGestures(bool send_gestures); | |
100 | |
101 AccessibilityController* accessibility_controller() { | 97 AccessibilityController* accessibility_controller() { |
102 return accessibility_controller_.get(); | 98 return accessibility_controller_.get(); |
103 } | 99 } |
104 | 100 |
105 TestRunnerForSpecificView* view_test_runner() { | 101 TestRunnerForSpecificView* view_test_runner() { |
106 return view_test_runner_.get(); | 102 return view_test_runner_.get(); |
107 } | 103 } |
108 | 104 |
109 void Reset(); | 105 void Reset(); |
110 void BindTo(blink::WebLocalFrame* frame); | 106 void BindTo(blink::WebLocalFrame* frame); |
(...skipping 10 matching lines...) Expand all Loading... |
121 } | 117 } |
122 | 118 |
123 private: | 119 private: |
124 TestInterfaces* test_interfaces_; | 120 TestInterfaces* test_interfaces_; |
125 WebTestDelegate* delegate_; | 121 WebTestDelegate* delegate_; |
126 blink::WebView* web_view_; | 122 blink::WebView* web_view_; |
127 blink::WebWidget* web_widget_; | 123 blink::WebWidget* web_widget_; |
128 std::unique_ptr<WebViewTestClient> view_test_client_; | 124 std::unique_ptr<WebViewTestClient> view_test_client_; |
129 std::unique_ptr<WebWidgetTestClient> widget_test_client_; | 125 std::unique_ptr<WebWidgetTestClient> widget_test_client_; |
130 std::unique_ptr<AccessibilityController> accessibility_controller_; | 126 std::unique_ptr<AccessibilityController> accessibility_controller_; |
131 std::unique_ptr<EventSender> event_sender_; | |
132 std::unique_ptr<TextInputController> text_input_controller_; | 127 std::unique_ptr<TextInputController> text_input_controller_; |
133 std::unique_ptr<TestRunnerForSpecificView> view_test_runner_; | 128 std::unique_ptr<TestRunnerForSpecificView> view_test_runner_; |
134 | 129 |
135 DISALLOW_COPY_AND_ASSIGN(WebTestProxyBase); | 130 DISALLOW_COPY_AND_ASSIGN(WebTestProxyBase); |
136 }; | 131 }; |
137 | 132 |
138 // WebTestProxy is used during LayoutTests and always instantiated, at time of | 133 // WebTestProxy is used during LayoutTests and always instantiated, at time of |
139 // writing with Base=RenderViewImpl. It does not directly inherit from it for | 134 // writing with Base=RenderViewImpl. It does not directly inherit from it for |
140 // layering purposes. | 135 // layering purposes. |
141 // The intent of that class is to wrap RenderViewImpl for tests purposes in | 136 // The intent of that class is to wrap RenderViewImpl for tests purposes in |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 | 246 |
252 private: | 247 private: |
253 virtual ~WebTestProxy() {} | 248 virtual ~WebTestProxy() {} |
254 | 249 |
255 DISALLOW_COPY_AND_ASSIGN(WebTestProxy); | 250 DISALLOW_COPY_AND_ASSIGN(WebTestProxy); |
256 }; | 251 }; |
257 | 252 |
258 } // namespace test_runner | 253 } // namespace test_runner |
259 | 254 |
260 #endif // COMPONENTS_TEST_RUNNER_WEB_TEST_PROXY_H_ | 255 #endif // COMPONENTS_TEST_RUNNER_WEB_TEST_PROXY_H_ |
OLD | NEW |