Index: content/public/test/layouttest_support.h |
diff --git a/content/public/test/layouttest_support.h b/content/public/test/layouttest_support.h |
index b43d37fe4af9fecc018d52188eb634767bf9156c..b7a77d129f7cf472b322acc0b9ebfca427314c10 100644 |
--- a/content/public/test/layouttest_support.h |
+++ b/content/public/test/layouttest_support.h |
@@ -22,7 +22,9 @@ class WebDeviceMotionData; |
class WebDeviceOrientationData; |
class WebGamepad; |
class WebGamepads; |
+class WebInputEvent; |
class WebLayer; |
+class WebLocalFrame; |
struct WebSize; |
class WebView; |
class WebWidget; |
@@ -66,11 +68,17 @@ test_runner::WebViewTestProxyBase* GetWebViewTestProxyBase( |
RenderView* render_view); |
// "Casts" |render_frame| to |WebFrameTestProxyBase|. Caller has to ensure |
-// that prior to construction of |render_frame|, EnableiewTestProxyCreation |
+// that prior to construction of |render_frame|, EnableTestProxyCreation |
// was called. |
test_runner::WebFrameTestProxyBase* GetWebFrameTestProxyBase( |
RenderFrame* render_frame); |
+// Gets WebWidgetTestProxyBase associated with |frame| (either the view's widget |
+// or the local root's frame widget). Caller has to ensure that prior to |
+// construction of |render_frame|, EnableTestProxyCreation was called. |
+test_runner::WebWidgetTestProxyBase* GetWebWidgetTestProxyBase( |
+ blink::WebLocalFrame* frame); |
+ |
// Enable injecting of a WebViewTestProxy between WebViews and RenderViews, |
// WebWidgetTestProxy between WebWidgets and RenderWidgets and WebFrameTestProxy |
// between WebFrames and RenderFrames. |
@@ -131,6 +139,14 @@ void SetDeviceScaleFactor(RenderView* render_view, float factor); |
// Get the window to viewport scale. |
float GetWindowToViewportScale(RenderView* render_view); |
+// Converts |event| from screen coordinates to coordinates used by the widget |
+// associated with the |web_widget_test_proxy_base|. Returns nullptr if no |
+// transformation was necessary (e.g. for a keyboard event OR if widget requires |
+// no scaling and has coordinates starting at (0,0)). |
+std::unique_ptr<blink::WebInputEvent> TransformScreenToWidgetCoordinates( |
+ test_runner::WebWidgetTestProxyBase* web_widget_test_proxy_base, |
+ const blink::WebInputEvent& event); |
+ |
// Get the ICC profile for a given name string. This is not in the ICCProfile |
// class to avoid bloating the shipping build. |
gfx::ICCProfile GetTestingICCProfile(const std::string& name); |