| 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 26 matching lines...) Expand all Loading... |
| 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 AccessibilityController; | 44 class AccessibilityController; |
| 45 class EventSender; | 45 class EventSender; |
| 46 class TestInterfaces; | 46 class TestInterfaces; |
| 47 class TestRunnerForSpecificView; |
| 47 class TextInputController; | 48 class TextInputController; |
| 48 class WebTestDelegate; | 49 class WebTestDelegate; |
| 49 class WebTestInterfaces; | 50 class WebTestInterfaces; |
| 50 | 51 |
| 51 // WebTestProxyBase is the "brain" of WebTestProxy in the sense that | 52 // WebTestProxyBase is the "brain" of WebTestProxy in the sense that |
| 52 // WebTestProxy does the bridge between RenderViewImpl and WebTestProxyBase and | 53 // WebTestProxy does the bridge between RenderViewImpl and WebTestProxyBase and |
| 53 // 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 |
| 54 // WebTestProxyBase that implements the expected behavior. | 55 // WebTestProxyBase that implements the expected behavior. |
| 55 // See WebTestProxy class comments for more information. | 56 // See WebTestProxy class comments for more information. |
| 56 class TEST_RUNNER_EXPORT WebTestProxyBase { | 57 class TEST_RUNNER_EXPORT WebTestProxyBase { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 86 TestInterfaces* test_interfaces() { return test_interfaces_; } | 87 TestInterfaces* test_interfaces() { return test_interfaces_; } |
| 87 void SetInterfaces(WebTestInterfaces* web_test_interfaces); | 88 void SetInterfaces(WebTestInterfaces* web_test_interfaces); |
| 88 | 89 |
| 89 EventSender* event_sender() { return event_sender_.get(); } | 90 EventSender* event_sender() { return event_sender_.get(); } |
| 90 void SetSendWheelGestures(bool send_gestures); | 91 void SetSendWheelGestures(bool send_gestures); |
| 91 | 92 |
| 92 AccessibilityController* accessibility_controller() { | 93 AccessibilityController* accessibility_controller() { |
| 93 return accessibility_controller_.get(); | 94 return accessibility_controller_.get(); |
| 94 } | 95 } |
| 95 | 96 |
| 97 TestRunnerForSpecificView* view_test_runner() { |
| 98 return view_test_runner_.get(); |
| 99 } |
| 100 |
| 96 void Reset(); | 101 void Reset(); |
| 97 void BindTo(blink::WebLocalFrame* frame); | 102 void BindTo(blink::WebLocalFrame* frame); |
| 98 | 103 |
| 99 void GetScreenOrientationForTesting(blink::WebScreenInfo&); | 104 void GetScreenOrientationForTesting(blink::WebScreenInfo&); |
| 100 | 105 |
| 101 protected: | 106 protected: |
| 102 WebTestProxyBase(); | 107 WebTestProxyBase(); |
| 103 ~WebTestProxyBase(); | 108 ~WebTestProxyBase(); |
| 104 | 109 |
| 105 blink::WebViewClient* view_test_client() { return view_test_client_.get(); } | 110 blink::WebViewClient* view_test_client() { return view_test_client_.get(); } |
| 106 | 111 |
| 107 private: | 112 private: |
| 108 TestInterfaces* test_interfaces_; | 113 TestInterfaces* test_interfaces_; |
| 109 WebTestDelegate* delegate_; | 114 WebTestDelegate* delegate_; |
| 110 blink::WebView* web_view_; | 115 blink::WebView* web_view_; |
| 111 blink::WebWidget* web_widget_; | 116 blink::WebWidget* web_widget_; |
| 112 std::unique_ptr<WebViewTestClient> view_test_client_; | 117 std::unique_ptr<WebViewTestClient> view_test_client_; |
| 113 std::unique_ptr<AccessibilityController> accessibility_controller_; | 118 std::unique_ptr<AccessibilityController> accessibility_controller_; |
| 114 std::unique_ptr<EventSender> event_sender_; | 119 std::unique_ptr<EventSender> event_sender_; |
| 115 std::unique_ptr<TextInputController> text_input_controller_; | 120 std::unique_ptr<TextInputController> text_input_controller_; |
| 121 std::unique_ptr<TestRunnerForSpecificView> view_test_runner_; |
| 116 | 122 |
| 117 DISALLOW_COPY_AND_ASSIGN(WebTestProxyBase); | 123 DISALLOW_COPY_AND_ASSIGN(WebTestProxyBase); |
| 118 }; | 124 }; |
| 119 | 125 |
| 120 // WebTestProxy is used during LayoutTests and always instantiated, at time of | 126 // WebTestProxy is used during LayoutTests and always instantiated, at time of |
| 121 // writing with Base=RenderViewImpl. It does not directly inherit from it for | 127 // writing with Base=RenderViewImpl. It does not directly inherit from it for |
| 122 // layering purposes. | 128 // layering purposes. |
| 123 // The intent of that class is to wrap RenderViewImpl for tests purposes in | 129 // The intent of that class is to wrap RenderViewImpl for tests purposes in |
| 124 // order to reduce the amount of test specific code in the production code. | 130 // order to reduce the amount of test specific code in the production code. |
| 125 // WebTestProxy is only doing the glue between RenderViewImpl and | 131 // WebTestProxy is only doing the glue between RenderViewImpl and |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 | 233 |
| 228 private: | 234 private: |
| 229 virtual ~WebTestProxy() {} | 235 virtual ~WebTestProxy() {} |
| 230 | 236 |
| 231 DISALLOW_COPY_AND_ASSIGN(WebTestProxy); | 237 DISALLOW_COPY_AND_ASSIGN(WebTestProxy); |
| 232 }; | 238 }; |
| 233 | 239 |
| 234 } // namespace test_runner | 240 } // namespace test_runner |
| 235 | 241 |
| 236 #endif // COMPONENTS_TEST_RUNNER_WEB_TEST_PROXY_H_ | 242 #endif // COMPONENTS_TEST_RUNNER_WEB_TEST_PROXY_H_ |
| OLD | NEW |