OLD | NEW |
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 #ifndef COMPONENTS_TEST_RUNNER_WEB_TEST_DELEGATE_H_ | 5 #ifndef COMPONENTS_TEST_RUNNER_WEB_TEST_DELEGATE_H_ |
6 #define COMPONENTS_TEST_RUNNER_WEB_TEST_DELEGATE_H_ | 6 #define COMPONENTS_TEST_RUNNER_WEB_TEST_DELEGATE_H_ |
7 | 7 |
| 8 #include <memory> |
8 #include <string> | 9 #include <string> |
9 #include <vector> | 10 #include <vector> |
10 | 11 |
11 #include "base/callback_forward.h" | 12 #include "base/callback_forward.h" |
12 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
13 #include "third_party/WebKit/public/platform/WebString.h" | 14 #include "third_party/WebKit/public/platform/WebString.h" |
14 #include "third_party/WebKit/public/platform/WebTaskRunner.h" | 15 #include "third_party/WebKit/public/platform/WebTaskRunner.h" |
15 #include "third_party/WebKit/public/platform/WebURL.h" | 16 #include "third_party/WebKit/public/platform/WebURL.h" |
16 #include "third_party/WebKit/public/platform/WebVector.h" | 17 #include "third_party/WebKit/public/platform/WebVector.h" |
17 #include "third_party/WebKit/public/platform/modules/screen_orientation/WebScree
nOrientationType.h" | 18 #include "third_party/WebKit/public/platform/modules/screen_orientation/WebScree
nOrientationType.h" |
18 | 19 |
19 #define WEBTESTRUNNER_NEW_HISTORY_CAPTURE | 20 #define WEBTESTRUNNER_NEW_HISTORY_CAPTURE |
20 | 21 |
21 namespace base { | 22 namespace base { |
22 class DictionaryValue; | 23 class DictionaryValue; |
23 } | 24 } |
24 | 25 |
25 namespace blink { | 26 namespace blink { |
26 class WebDeviceMotionData; | 27 class WebDeviceMotionData; |
27 class WebDeviceOrientationData; | 28 class WebDeviceOrientationData; |
28 class WebFrame; | 29 class WebLocalFrame; |
29 class WebGamepad; | 30 class WebGamepad; |
30 class WebGamepads; | 31 class WebGamepads; |
31 class WebHistoryItem; | 32 class WebHistoryItem; |
| 33 class WebInputEvent; |
32 class WebLayer; | 34 class WebLayer; |
33 class WebLocalFrame; | 35 class WebLocalFrame; |
34 class WebMediaStream; | 36 class WebMediaStream; |
35 class WebPlugin; | 37 class WebPlugin; |
36 struct WebPluginParams; | 38 struct WebPluginParams; |
37 struct WebPoint; | 39 struct WebPoint; |
38 struct WebRect; | 40 struct WebRect; |
39 struct WebSize; | 41 struct WebSize; |
40 struct WebURLError; | 42 struct WebURLError; |
41 class WebURLResponse; | 43 class WebURLResponse; |
42 class WebView; | 44 class WebView; |
43 } | 45 } |
44 | 46 |
45 namespace cc { | 47 namespace cc { |
46 class TextureLayer; | 48 class TextureLayer; |
47 class TextureLayerClient; | 49 class TextureLayerClient; |
48 class SharedBitmapManager; | 50 class SharedBitmapManager; |
49 } | 51 } |
50 | 52 |
51 namespace test_runner { | 53 namespace test_runner { |
52 | 54 |
53 class DeviceLightData; | 55 class DeviceLightData; |
54 class GamepadController; | 56 class GamepadController; |
55 class WebTask; | 57 class WebTask; |
56 class WebViewTestProxyBase; | 58 class WebWidgetTestProxyBase; |
57 struct TestPreferences; | 59 struct TestPreferences; |
58 | 60 |
59 class WebTestDelegate { | 61 class WebTestDelegate { |
60 public: | 62 public: |
61 // Set and clear the edit command to execute on the next call to | 63 // Set and clear the edit command to execute on the next call to |
62 // WebViewClient::handleCurrentKeyboardEvent(). | 64 // WebViewClient::handleCurrentKeyboardEvent(). |
63 virtual void ClearEditCommand() = 0; | 65 virtual void ClearEditCommand() = 0; |
64 virtual void SetEditCommand(const std::string& name, | 66 virtual void SetEditCommand(const std::string& name, |
65 const std::string& value) = 0; | 67 const std::string& value) = 0; |
66 | 68 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 bool by_user) = 0; | 157 bool by_user) = 0; |
156 | 158 |
157 // Controls the device scale factor of the main WebView for hidpi tests. | 159 // Controls the device scale factor of the main WebView for hidpi tests. |
158 virtual void SetDeviceScaleFactor(float factor) = 0; | 160 virtual void SetDeviceScaleFactor(float factor) = 0; |
159 | 161 |
160 // When use-zoom-for-dsf mode is enabled, this returns the scale to | 162 // When use-zoom-for-dsf mode is enabled, this returns the scale to |
161 // convert from window coordinates to viewport coordinates. When | 163 // convert from window coordinates to viewport coordinates. When |
162 // use-zoom-for-dsf is disabled, this return always 1.0f. | 164 // use-zoom-for-dsf is disabled, this return always 1.0f. |
163 virtual float GetWindowToViewportScale() = 0; | 165 virtual float GetWindowToViewportScale() = 0; |
164 | 166 |
| 167 // Converts |event| from screen coordinates used by test_runner::EventSender |
| 168 // into coordinates that are understood by the widget associated with |
| 169 // |web_widget_test_proxy_base|. Returns nullptr if no transformation was |
| 170 // necessary (e.g. for a keyboard event OR if widget requires no scaling |
| 171 // and has coordinates starting at (0,0)). |
| 172 virtual std::unique_ptr<blink::WebInputEvent> |
| 173 TransformScreenToWidgetCoordinates( |
| 174 test_runner::WebWidgetTestProxyBase* web_widget_test_proxy_base, |
| 175 const blink::WebInputEvent& event) = 0; |
| 176 |
| 177 // Gets WebWidgetTestProxyBase associated with |frame| (associated with either |
| 178 // a RenderView or a RenderWidget for the local root). |
| 179 virtual test_runner::WebWidgetTestProxyBase* GetWebWidgetTestProxyBase( |
| 180 blink::WebLocalFrame* frame) = 0; |
| 181 |
165 // Enable zoom-for-dsf option. | 182 // Enable zoom-for-dsf option. |
166 virtual void EnableUseZoomForDSF() = 0; | 183 virtual void EnableUseZoomForDSF() = 0; |
167 | 184 |
168 // Returns whether or not the use-zoom-for-dsf flag is enabled. | 185 // Returns whether or not the use-zoom-for-dsf flag is enabled. |
169 virtual bool IsUseZoomForDSFEnabled() = 0; | 186 virtual bool IsUseZoomForDSFEnabled() = 0; |
170 | 187 |
171 // Change the device color profile while running a layout test. | 188 // Change the device color profile while running a layout test. |
172 virtual void SetDeviceColorProfile(const std::string& name) = 0; | 189 virtual void SetDeviceColorProfile(const std::string& name) = 0; |
173 | 190 |
174 // Set the bluetooth adapter while running a layout test, uses Mojo to | 191 // Set the bluetooth adapter while running a layout test, uses Mojo to |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 | 290 |
274 virtual float GetDeviceScaleFactor() const = 0; | 291 virtual float GetDeviceScaleFactor() const = 0; |
275 | 292 |
276 // Run all pending idle tasks, and then run callback. | 293 // Run all pending idle tasks, and then run callback. |
277 virtual void RunIdleTasks(const base::Closure& callback) = 0; | 294 virtual void RunIdleTasks(const base::Closure& callback) = 0; |
278 }; | 295 }; |
279 | 296 |
280 } // namespace test_runner | 297 } // namespace test_runner |
281 | 298 |
282 #endif // COMPONENTS_TEST_RUNNER_WEB_TEST_DELEGATE_H_ | 299 #endif // COMPONENTS_TEST_RUNNER_WEB_TEST_DELEGATE_H_ |
OLD | NEW |