| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_PUBLIC_TEST_LAYOUTTEST_SUPPORT_H_ | 5 #ifndef CONTENT_PUBLIC_TEST_LAYOUTTEST_SUPPORT_H_ |
| 6 #define CONTENT_PUBLIC_TEST_LAYOUTTEST_SUPPORT_H_ | 6 #define CONTENT_PUBLIC_TEST_LAYOUTTEST_SUPPORT_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/callback_forward.h" | 14 #include "base/callback_forward.h" |
| 15 #include "cc/layers/texture_layer.h" | 15 #include "cc/layers/texture_layer.h" |
| 16 #include "third_party/WebKit/public/platform/modules/screen_orientation/WebScree
nOrientationType.h" | 16 #include "third_party/WebKit/public/platform/modules/screen_orientation/WebScree
nOrientationType.h" |
| 17 | 17 |
| 18 class GURL; | 18 class GURL; |
| 19 | 19 |
| 20 namespace blink { | 20 namespace blink { |
| 21 class WebDeviceMotionData; | 21 class WebDeviceMotionData; |
| 22 class WebDeviceOrientationData; | 22 class WebDeviceOrientationData; |
| 23 class WebGamepad; | 23 class WebGamepad; |
| 24 class WebGamepads; | 24 class WebGamepads; |
| 25 class WebInputEvent; |
| 25 class WebLayer; | 26 class WebLayer; |
| 27 class WebLocalFrame; |
| 26 struct WebSize; | 28 struct WebSize; |
| 27 class WebView; | 29 class WebView; |
| 28 class WebWidget; | 30 class WebWidget; |
| 29 class WebURLResponse; | 31 class WebURLResponse; |
| 30 } | 32 } |
| 31 | 33 |
| 32 namespace device { | 34 namespace device { |
| 33 class BluetoothAdapter; | 35 class BluetoothAdapter; |
| 34 } | 36 } |
| 35 | 37 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 59 // Turn a renderer into layout test mode. | 61 // Turn a renderer into layout test mode. |
| 60 void EnableRendererLayoutTestMode(); | 62 void EnableRendererLayoutTestMode(); |
| 61 | 63 |
| 62 // "Casts" |render_view| to |WebViewTestProxyBase|. Caller has to ensure that | 64 // "Casts" |render_view| to |WebViewTestProxyBase|. Caller has to ensure that |
| 63 // prior to construction of |render_view|, EnableWebTestProxyCreation was | 65 // prior to construction of |render_view|, EnableWebTestProxyCreation was |
| 64 // called. | 66 // called. |
| 65 test_runner::WebViewTestProxyBase* GetWebViewTestProxyBase( | 67 test_runner::WebViewTestProxyBase* GetWebViewTestProxyBase( |
| 66 RenderView* render_view); | 68 RenderView* render_view); |
| 67 | 69 |
| 68 // "Casts" |render_frame| to |WebFrameTestProxyBase|. Caller has to ensure | 70 // "Casts" |render_frame| to |WebFrameTestProxyBase|. Caller has to ensure |
| 69 // that prior to construction of |render_frame|, EnableiewTestProxyCreation | 71 // that prior to construction of |render_frame|, EnableTestProxyCreation |
| 70 // was called. | 72 // was called. |
| 71 test_runner::WebFrameTestProxyBase* GetWebFrameTestProxyBase( | 73 test_runner::WebFrameTestProxyBase* GetWebFrameTestProxyBase( |
| 72 RenderFrame* render_frame); | 74 RenderFrame* render_frame); |
| 73 | 75 |
| 76 // Gets WebWidgetTestProxyBase associated with |frame| (either the view's widget |
| 77 // or the local root's frame widget). Caller has to ensure that prior to |
| 78 // construction of |render_frame|, EnableTestProxyCreation was called. |
| 79 test_runner::WebWidgetTestProxyBase* GetWebWidgetTestProxyBase( |
| 80 blink::WebLocalFrame* frame); |
| 81 |
| 74 // Enable injecting of a WebViewTestProxy between WebViews and RenderViews, | 82 // Enable injecting of a WebViewTestProxy between WebViews and RenderViews, |
| 75 // WebWidgetTestProxy between WebWidgets and RenderWidgets and WebFrameTestProxy | 83 // WebWidgetTestProxy between WebWidgets and RenderWidgets and WebFrameTestProxy |
| 76 // between WebFrames and RenderFrames. | 84 // between WebFrames and RenderFrames. |
| 77 // |view_proxy_creation_callback| is invoked after creating WebViewTestProxy. | 85 // |view_proxy_creation_callback| is invoked after creating WebViewTestProxy. |
| 78 // |widget_proxy_creation_callback| is invoked after creating | 86 // |widget_proxy_creation_callback| is invoked after creating |
| 79 // WebWidgetTestProxy. | 87 // WebWidgetTestProxy. |
| 80 // |frame_proxy_creation_callback| is called after creating WebFrameTestProxy. | 88 // |frame_proxy_creation_callback| is called after creating WebFrameTestProxy. |
| 81 using ViewProxyCreationCallback = | 89 using ViewProxyCreationCallback = |
| 82 base::Callback<void(RenderView*, test_runner::WebViewTestProxyBase*)>; | 90 base::Callback<void(RenderView*, test_runner::WebViewTestProxyBase*)>; |
| 83 using WidgetProxyCreationCallback = | 91 using WidgetProxyCreationCallback = |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 // Changes the window rect of the given render view. | 132 // Changes the window rect of the given render view. |
| 125 void ForceResizeRenderView(RenderView* render_view, | 133 void ForceResizeRenderView(RenderView* render_view, |
| 126 const blink::WebSize& new_size); | 134 const blink::WebSize& new_size); |
| 127 | 135 |
| 128 // Set the device scale factor and force the compositor to resize. | 136 // Set the device scale factor and force the compositor to resize. |
| 129 void SetDeviceScaleFactor(RenderView* render_view, float factor); | 137 void SetDeviceScaleFactor(RenderView* render_view, float factor); |
| 130 | 138 |
| 131 // Get the window to viewport scale. | 139 // Get the window to viewport scale. |
| 132 float GetWindowToViewportScale(RenderView* render_view); | 140 float GetWindowToViewportScale(RenderView* render_view); |
| 133 | 141 |
| 142 // Converts |event| from screen coordinates to coordinates used by the widget |
| 143 // associated with the |web_widget_test_proxy_base|. Returns nullptr if no |
| 144 // transformation was necessary (e.g. for a keyboard event OR if widget requires |
| 145 // no scaling and has coordinates starting at (0,0)). |
| 146 std::unique_ptr<blink::WebInputEvent> TransformScreenToWidgetCoordinates( |
| 147 test_runner::WebWidgetTestProxyBase* web_widget_test_proxy_base, |
| 148 const blink::WebInputEvent& event); |
| 149 |
| 134 // Get the ICC profile for a given name string. This is not in the ICCProfile | 150 // Get the ICC profile for a given name string. This is not in the ICCProfile |
| 135 // class to avoid bloating the shipping build. | 151 // class to avoid bloating the shipping build. |
| 136 gfx::ICCProfile GetTestingICCProfile(const std::string& name); | 152 gfx::ICCProfile GetTestingICCProfile(const std::string& name); |
| 137 | 153 |
| 138 // Set the device color profile associated with the profile |name|. | 154 // Set the device color profile associated with the profile |name|. |
| 139 void SetDeviceColorProfile( | 155 void SetDeviceColorProfile( |
| 140 RenderView* render_view, const gfx::ICCProfile& icc_profile); | 156 RenderView* render_view, const gfx::ICCProfile& icc_profile); |
| 141 | 157 |
| 142 // Sets the scan duration to 0. | 158 // Sets the scan duration to 0. |
| 143 void SetTestBluetoothScanDuration(); | 159 void SetTestBluetoothScanDuration(); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 159 // Provides a text dump of the contents of the given page state. | 175 // Provides a text dump of the contents of the given page state. |
| 160 std::string DumpBackForwardList(std::vector<PageState>& page_state, | 176 std::string DumpBackForwardList(std::vector<PageState>& page_state, |
| 161 size_t current_index); | 177 size_t current_index); |
| 162 | 178 |
| 163 // Run all pending idle tasks immediately, and then invoke callback. | 179 // Run all pending idle tasks immediately, and then invoke callback. |
| 164 void SchedulerRunIdleTasks(const base::Closure& callback); | 180 void SchedulerRunIdleTasks(const base::Closure& callback); |
| 165 | 181 |
| 166 } // namespace content | 182 } // namespace content |
| 167 | 183 |
| 168 #endif // CONTENT_PUBLIC_TEST_LAYOUTTEST_SUPPORT_H_ | 184 #endif // CONTENT_PUBLIC_TEST_LAYOUTTEST_SUPPORT_H_ |
| OLD | NEW |