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

Side by Side Diff: content/browser/renderer_host/input/web_input_event_util_unittest.cc

Issue 1989623002: Suppressed MEs for gestures from cancelled PEs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Needed on Windows to get |M_PI| from <cmath>. 5 // Needed on Windows to get |M_PI| from <cmath>.
6 #ifdef _WIN32 6 #ifdef _WIN32
7 #define _USE_MATH_DEFINES 7 #define _USE_MATH_DEFINES
8 #endif 8 #endif
9 9
10 #include <stddef.h> 10 #include <stddef.h>
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 ui::GestureEventData event(details, 101 ui::GestureEventData event(details,
102 motion_event_id, 102 motion_event_id,
103 tool_type, 103 tool_type,
104 timestamp, 104 timestamp,
105 pos.x(), 105 pos.x(),
106 pos.y(), 106 pos.y(),
107 raw_pos.x(), 107 raw_pos.x(),
108 raw_pos.y(), 108 raw_pos.y(),
109 touch_points, 109 touch_points,
110 rect, 110 rect,
111 flags); 111 flags,
112 0U);
112 113
113 blink::WebGestureEvent web_event = 114 blink::WebGestureEvent web_event =
114 ui::CreateWebGestureEventFromGestureEventData(event); 115 ui::CreateWebGestureEventFromGestureEventData(event);
115 EXPECT_EQ(WebInputEvent::GestureScrollUpdate, web_event.type); 116 EXPECT_EQ(WebInputEvent::GestureScrollUpdate, web_event.type);
116 EXPECT_EQ(0, web_event.modifiers); 117 EXPECT_EQ(0, web_event.modifiers);
117 EXPECT_EQ((timestamp - base::TimeTicks()).InSecondsF(), 118 EXPECT_EQ((timestamp - base::TimeTicks()).InSecondsF(),
118 web_event.timeStampSeconds); 119 web_event.timeStampSeconds);
119 EXPECT_EQ(gfx::ToFlooredInt(pos.x()), web_event.x); 120 EXPECT_EQ(gfx::ToFlooredInt(pos.x()), web_event.x);
120 EXPECT_EQ(gfx::ToFlooredInt(pos.y()), web_event.y); 121 EXPECT_EQ(gfx::ToFlooredInt(pos.y()), web_event.y);
121 EXPECT_EQ(gfx::ToFlooredInt(raw_pos.x()), web_event.globalX); 122 EXPECT_EQ(gfx::ToFlooredInt(raw_pos.x()), web_event.globalX);
122 EXPECT_EQ(gfx::ToFlooredInt(raw_pos.y()), web_event.globalY); 123 EXPECT_EQ(gfx::ToFlooredInt(raw_pos.y()), web_event.globalY);
123 EXPECT_EQ(blink::WebGestureDeviceTouchscreen, web_event.sourceDevice); 124 EXPECT_EQ(blink::WebGestureDeviceTouchscreen, web_event.sourceDevice);
124 EXPECT_EQ(delta.x(), web_event.data.scrollUpdate.deltaX); 125 EXPECT_EQ(delta.x(), web_event.data.scrollUpdate.deltaX);
125 EXPECT_EQ(delta.y(), web_event.data.scrollUpdate.deltaY); 126 EXPECT_EQ(delta.y(), web_event.data.scrollUpdate.deltaY);
126 EXPECT_TRUE(web_event.data.scrollUpdate.previousUpdateInSequencePrevented); 127 EXPECT_TRUE(web_event.data.scrollUpdate.previousUpdateInSequencePrevented);
127 } 128 }
128 129
129 } // namespace content 130 } // namespace content
OLDNEW
« no previous file with comments | « components/test_runner/event_sender.cc ('k') | content/browser/renderer_host/ui_events_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698