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

Unified Diff: content/test/layouttest_support.cc

Issue 2093343002: Scale the emulated event in EventSender when use-zoom-for-dsf is enabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Scale the emulated event in EventSender when use-zoom-for-dsf is enabled Created 4 years, 6 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/test/layouttest_support.cc
diff --git a/content/test/layouttest_support.cc b/content/test/layouttest_support.cc
index 8ced6323768bd09f45dc04cb4ba5f5c83c6b828c..a3a0f198e46e16294b609b16d40e0df3e8d1974c 100644
--- a/content/test/layouttest_support.cc
+++ b/content/test/layouttest_support.cc
@@ -34,6 +34,7 @@
#include "content/test/mailbox_output_surface.h"
#include "device/bluetooth/bluetooth_adapter.h"
#include "gpu/ipc/service/image_transport_surface.h"
+#include "third_party/WebKit/public/platform/WebFloatRect.h"
#include "third_party/WebKit/public/platform/WebGamepads.h"
#include "third_party/WebKit/public/platform/modules/device_orientation/WebDeviceMotionData.h"
#include "third_party/WebKit/public/platform/modules/device_orientation/WebDeviceOrientationData.h"
@@ -232,6 +233,12 @@ void SetDeviceScaleFactor(RenderView* render_view, float factor) {
SetDeviceScaleFactorForTesting(factor);
}
+float GetWindowToViewportScale(RenderView* render_view) {
+ blink::WebFloatRect rect(0, 0, 1.0f, 0.0);
+ static_cast<RenderViewImpl*>(render_view)->convertWindowToViewport(&rect);
+ return rect.width;
+}
+
void SetDeviceColorProfile(RenderView* render_view, const std::string& name) {
if (name == "reset") {
render_view->GetWidget()->ResetDeviceColorProfileForTesting();

Powered by Google App Engine
This is Rietveld 408576698