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

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

Issue 2882443002: Tiimer based phase info generated for mouse wheel events. (Closed)
Patch Set: review comments addressed. Created 3 years, 7 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
« no previous file with comments | « no previous file | content/browser/renderer_host/input/mouse_wheel_event_queue.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/input/input_router_impl_unittest.cc
diff --git a/content/browser/renderer_host/input/input_router_impl_unittest.cc b/content/browser/renderer_host/input/input_router_impl_unittest.cc
index 255e97b8e7d3c98f438b07303461aefa6991273d..162b98c7e550ca359a15c5241a36cf3864260085 100644
--- a/content/browser/renderer_host/input/input_router_impl_unittest.cc
+++ b/content/browser/renderer_host/input/input_router_impl_unittest.cc
@@ -236,6 +236,19 @@ class InputRouterImplTest : public testing::Test {
precise)));
}
+ void SimulateWheelEventWithPhase(float x,
+ float y,
+ float dX,
+ float dY,
+ int modifiers,
+ bool precise,
+ WebMouseWheelEvent::Phase phase) {
+ WebMouseWheelEvent wheel_event = SyntheticWebMouseWheelEventBuilder::Build(
+ x, y, dX, dY, modifiers, precise);
+ wheel_event.phase = phase;
+ input_router_->SendWheelEvent(MouseWheelEventWithLatencyInfo(wheel_event));
+ }
+
void SimulateMouseEvent(WebInputEvent::Type type, int x, int y) {
input_router_->SendMouseEvent(MouseEventWithLatencyInfo(
SyntheticWebMouseEventBuilder::Build(type, x, y, 0)));
@@ -387,8 +400,17 @@ class InputRouterImplTest : public testing::Test {
void UnhandledWheelEvent(bool wheel_scroll_latching_enabled) {
// Simulate wheel events.
- SimulateWheelEvent(0, 0, 0, -5, 0, false); // sent directly
- SimulateWheelEvent(0, 0, 0, -10, 0, false); // enqueued
+ if (wheel_scroll_latching_enabled) {
+ SimulateWheelEventWithPhase(
+ 0, 0, 0, -5, 0, false,
+ WebMouseWheelEvent::kPhaseBegan); // sent directly
+ SimulateWheelEventWithPhase(
+ 0, 0, 0, -10, 0, false,
+ WebMouseWheelEvent::kPhaseChanged); // enqueued
+ } else {
+ SimulateWheelEvent(0, 0, 0, -5, 0, false); // sent directly
+ SimulateWheelEvent(0, 0, 0, -10, 0, false); // enqueued
+ }
// Check that only the first event was sent.
EXPECT_TRUE(process_->sink().GetUniqueMessageMatching(
@@ -1097,11 +1119,10 @@ TEST_F(InputRouterImplTest, AckedTouchEventState) {
}
#endif // defined(USE_AURA)
-TEST_F(InputRouterImplTest, UnhandledWheelEventWithoutLatching) {
+TEST_F(InputRouterImplTest, UnhandledWheelEvent) {
UnhandledWheelEvent(true);
}
-TEST_F(InputRouterImplWheelScrollLatchingDisabledTest,
- UnhandledWheelEventWithLatching) {
+TEST_F(InputRouterImplWheelScrollLatchingDisabledTest, UnhandledWheelEvent) {
UnhandledWheelEvent(false);
}
« no previous file with comments | « no previous file | content/browser/renderer_host/input/mouse_wheel_event_queue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698