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

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

Issue 1218663006: Use new WebTouchPoint field names. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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/browser/renderer_host/input/touch_event_queue_unittest.cc
diff --git a/content/browser/renderer_host/input/touch_event_queue_unittest.cc b/content/browser/renderer_host/input/touch_event_queue_unittest.cc
index e322a5f23f9ea72d88e404a010f65b017079097f..b1182458165ae109f9179aaa38e013792167fe0e 100644
--- a/content/browser/renderer_host/input/touch_event_queue_unittest.cc
+++ b/content/browser/renderer_host/input/touch_event_queue_unittest.cc
@@ -184,8 +184,8 @@ class TouchEventQueueTest : public testing::Test,
CHECK_GE(index, 0);
CHECK_LT(index, touch_event_.touchesLengthCap);
WebTouchPoint& point = touch_event_.touches[index];
- point.radiusX = radius_x;
- point.radiusY = radius_y;
+ point.width = radius_x;
+ point.height = radius_y;
touch_event_.touches[index].state = WebTouchPoint::StateMoved;
touch_event_.causesScrollingIfUncanceled = true;
WebTouchEventTraits::ResetType(WebInputEvent::TouchMove,
@@ -211,7 +211,7 @@ class TouchEventQueueTest : public testing::Test,
CHECK_GE(index, 0);
CHECK_LT(index, touch_event_.touchesLengthCap);
WebTouchPoint& point = touch_event_.touches[index];
- point.force = force;
+ point.pressure = force;
touch_event_.touches[index].state = WebTouchPoint::StateMoved;
touch_event_.causesScrollingIfUncanceled = true;
WebTouchEventTraits::ResetType(WebInputEvent::TouchMove,
@@ -834,7 +834,7 @@ TEST_F(TouchEventQueueTest, AckWithFollowupEvents) {
WebTouchEvent followup_event;
followup_event.type = WebInputEvent::TouchMove;
followup_event.touchesLength = 1;
- followup_event.touches[0].id = 0;
+ followup_event.touches[0].pointerId = 0;
followup_event.touches[0].state = WebTouchPoint::StateMoved;
SetFollowupEvent(followup_event);
@@ -903,7 +903,7 @@ TEST_F(TouchEventQueueTest, ImmediateAckWithFollowupEvents) {
WebTouchEvent followup_event;
followup_event.type = WebInputEvent::TouchStart;
followup_event.touchesLength = 1;
- followup_event.touches[0].id = 1;
+ followup_event.touches[0].pointerId = 1;
followup_event.touches[0].state = WebTouchPoint::StatePressed;
SetFollowupEvent(followup_event);
@@ -913,7 +913,7 @@ TEST_F(TouchEventQueueTest, ImmediateAckWithFollowupEvents) {
WebTouchEvent stationary_event;
stationary_event.touchesLength = 1;
stationary_event.type = WebInputEvent::TouchMove;
- stationary_event.touches[0].id = 1;
+ stationary_event.touches[0].pointerId = 1;
stationary_event.touches[0].state = WebTouchPoint::StateStationary;
SendTouchEvent(stationary_event);
@@ -2432,15 +2432,15 @@ TEST_F(TouchEventQueueTest, UnseenTouchPointerIdsNotForwarded) {
EXPECT_EQ(1U, GetAndResetAckedEventCount());
// Give the touchmove a previously unseen pointer id; it should not be sent.
- int press_id = event.touches[0].id;
+ int press_id = event.touches[0].pointerId;
event.MovePoint(0, 1, 1);
- event.touches[0].id = 7;
+ event.touches[0].pointerId = 7;
SendTouchEvent(event);
EXPECT_EQ(0U, GetAndResetSentEventCount());
EXPECT_EQ(1U, GetAndResetAckedEventCount());
// Give the touchmove a valid id; it should be sent.
- event.touches[0].id = press_id;
+ event.touches[0].pointerId = press_id;
SendTouchEvent(event);
EXPECT_EQ(1U, GetAndResetSentEventCount());
SendTouchEventAck(INPUT_EVENT_ACK_STATE_CONSUMED);
@@ -2448,13 +2448,13 @@ TEST_F(TouchEventQueueTest, UnseenTouchPointerIdsNotForwarded) {
// Do the same for release.
event.ReleasePoint(0);
- event.touches[0].id = 11;
+ event.touches[0].pointerId = 11;
SendTouchEvent(event);
EXPECT_EQ(0U, GetAndResetSentEventCount());
EXPECT_EQ(1U, GetAndResetAckedEventCount());
// Give the touchmove a valid id; it should be sent.
- event.touches[0].id = press_id;
+ event.touches[0].pointerId = press_id;
SendTouchEvent(event);
EXPECT_EQ(1U, GetAndResetSentEventCount());
SendTouchEventAck(INPUT_EVENT_ACK_STATE_CONSUMED);

Powered by Google App Engine
This is Rietveld 408576698