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

Unified Diff: ui/events/blink/input_handler_proxy_unittest.cc

Issue 2573073003: Collapse the API surface on WebInputEvent via accessor functions. (Closed)
Patch Set: Fix nits Created 3 years, 11 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 | « ui/events/blink/input_handler_proxy.cc ('k') | ui/events/blink/input_scroll_elasticity_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/blink/input_handler_proxy_unittest.cc
diff --git a/ui/events/blink/input_handler_proxy_unittest.cc b/ui/events/blink/input_handler_proxy_unittest.cc
index 710b4d2a0ef685814c7df0a4a44e6d0574fcc549..af1566ea334c29fd8f5fdd37d2f39c77402a57fe 100644
--- a/ui/events/blink/input_handler_proxy_unittest.cc
+++ b/ui/events/blink/input_handler_proxy_unittest.cc
@@ -75,12 +75,12 @@ double InSecondsF(const base::TimeTicks& time) {
}
bool WheelEventsMatch(const WebInputEvent& lhs, const WebInputEvent& rhs) {
- if (lhs.size == rhs.size && lhs.type == rhs.type &&
- lhs.type == WebInputEvent::MouseWheel) {
+ if (lhs.size() == rhs.size() && lhs.type() == rhs.type() &&
+ lhs.type() == WebInputEvent::MouseWheel) {
WebMouseWheelEvent rhs_timestamped =
static_cast<const WebMouseWheelEvent&>(rhs);
- rhs_timestamped.timeStampSeconds = lhs.timeStampSeconds;
- return memcmp(&rhs_timestamped, &lhs, rhs.size) == 0;
+ rhs_timestamped.setTimeStampSeconds(lhs.timeStampSeconds());
+ return memcmp(&rhs_timestamped, &lhs, rhs.size()) == 0;
}
return false;
}
@@ -3209,25 +3209,29 @@ TEST_F(InputHandlerProxyEventQueueTest, VSyncAlignedCoalesceScrollAndPinch) {
EXPECT_EQ(7ul, event_queue().size());
EXPECT_EQ(1ul, event_disposition_recorder_.size());
- EXPECT_EQ(WebInputEvent::GestureScrollUpdate, event_queue()[0]->event().type);
+ EXPECT_EQ(WebInputEvent::GestureScrollUpdate,
+ event_queue()[0]->event().type());
EXPECT_EQ(
-35,
ToWebGestureEvent(event_queue()[0]->event()).data.scrollUpdate.deltaY);
- EXPECT_EQ(WebInputEvent::GesturePinchUpdate, event_queue()[1]->event().type);
+ EXPECT_EQ(WebInputEvent::GesturePinchUpdate,
+ event_queue()[1]->event().type());
EXPECT_EQ(
2.0f,
ToWebGestureEvent(event_queue()[1]->event()).data.pinchUpdate.scale);
- EXPECT_EQ(WebInputEvent::GestureScrollEnd, event_queue()[2]->event().type);
- EXPECT_EQ(WebInputEvent::GesturePinchBegin, event_queue()[3]->event().type);
- EXPECT_EQ(WebInputEvent::GestureScrollUpdate, event_queue()[4]->event().type);
+ EXPECT_EQ(WebInputEvent::GestureScrollEnd, event_queue()[2]->event().type());
+ EXPECT_EQ(WebInputEvent::GesturePinchBegin, event_queue()[3]->event().type());
+ EXPECT_EQ(WebInputEvent::GestureScrollUpdate,
+ event_queue()[4]->event().type());
EXPECT_EQ(
-85,
ToWebGestureEvent(event_queue()[4]->event()).data.scrollUpdate.deltaY);
- EXPECT_EQ(WebInputEvent::GesturePinchUpdate, event_queue()[5]->event().type);
+ EXPECT_EQ(WebInputEvent::GesturePinchUpdate,
+ event_queue()[5]->event().type());
EXPECT_EQ(
0.5f,
ToWebGestureEvent(event_queue()[5]->event()).data.pinchUpdate.scale);
- EXPECT_EQ(WebInputEvent::GesturePinchEnd, event_queue()[6]->event().type);
+ EXPECT_EQ(WebInputEvent::GesturePinchEnd, event_queue()[6]->event().type());
testing::Mock::VerifyAndClearExpectations(&mock_input_handler_);
}
« no previous file with comments | « ui/events/blink/input_handler_proxy.cc ('k') | ui/events/blink/input_scroll_elasticity_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698