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

Unified Diff: content/browser/renderer_host/input/web_input_event_util_unittest.cc

Issue 1440923002: Convert the coordinates in WebInputEvent To Viewport in InputRouter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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/browser/renderer_host/input/web_input_event_util_unittest.cc
diff --git a/content/browser/renderer_host/input/web_input_event_util_unittest.cc b/content/browser/renderer_host/input/web_input_event_util_unittest.cc
index 439e2c1893a36eec4d1703bd0e1da86bec71cddd..d3dfb3cc182fb9c3296f38c2a565650f75805ddb 100644
--- a/content/browser/renderer_host/input/web_input_event_util_unittest.cc
+++ b/content/browser/renderer_host/input/web_input_event_util_unittest.cc
@@ -10,6 +10,7 @@
#include <cmath>
#include "content/browser/renderer_host/input/web_input_event_util.h"
+#include "content/common/input/synthetic_web_input_event_builders.h"
#include "content/common/input/web_input_event_traits.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/events/blink/blink_event_util.h"
@@ -122,4 +123,12 @@ TEST(WebInputEventUtilTest, ScrollUpdateConversion) {
EXPECT_TRUE(web_event.data.scrollUpdate.previousUpdateInSequencePrevented);
}
+TEST(WebInputEventUtilTest, NoScalingWith1DSF) {
+ auto event =
+ SyntheticWebMouseEventBuilder::Build(blink::WebInputEvent::MouseMove,
+ 10, 10, 0);
+ EXPECT_FALSE(ConvertWebInputEventToViewport(event, 1.f));
+ EXPECT_TRUE(ConvertWebInputEventToViewport(event, 2.f));
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698