Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Unified Diff: content/public/test/layouttest_support.h

Issue 2036873002: Making EventSender talk to the right WebWidget (for OOPIF support). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use RenderWidget::viewRect() [rather than windowRect()] in TransformScreenToWidgetCoordinates. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
« no previous file with comments | « components/test_runner/web_widget_test_proxy.cc ('k') | content/shell/renderer/layout_test/blink_test_runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698