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

Unified Diff: content/browser/renderer_host/render_widget_host_view_aura_unittest.cc

Issue 1372253002: gfx: Make conversions from gfx::Point to PointF explicit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pointfconvert-gfx: . Created 5 years, 3 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/render_widget_host_view_aura_unittest.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
index d360dc907430d6b16dd40afb9f84b048f0a79bf3..eb1a687421ceaf4d050f41e42ab9242ab0423e16 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
@@ -1083,7 +1083,7 @@ TEST_F(RenderWidgetHostViewAuraTest, FinishCompositionByMouse) {
sink_->ClearMessages();
// Simulates the mouse press.
- ui::MouseEvent mouse_event(ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(),
+ ui::MouseEvent mouse_event(ui::ET_MOUSE_PRESSED, gfx::PointF(), gfx::PointF(),
ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON,
0);
view_->OnMouseEvent(&mouse_event);
@@ -1110,17 +1110,11 @@ TEST_F(RenderWidgetHostViewAuraTest, TouchEventState) {
// Start with no touch-event handler in the renderer.
widget_host_->OnMessageReceived(ViewHostMsg_HasTouchEventHandlers(0, false));
- ui::TouchEvent press(ui::ET_TOUCH_PRESSED,
- gfx::Point(30, 30),
- 0,
+ ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::PointF(30.f, 30.f), 0,
ui::EventTimeForNow());
- ui::TouchEvent move(ui::ET_TOUCH_MOVED,
- gfx::Point(20, 20),
- 0,
+ ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::PointF(20.f, 20.f), 0,
ui::EventTimeForNow());
- ui::TouchEvent release(ui::ET_TOUCH_RELEASED,
- gfx::Point(20, 20),
- 0,
+ ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::PointF(20.f, 20.f), 0,
ui::EventTimeForNow());
// The touch events should get forwarded from the view, but they should not
@@ -1175,15 +1169,15 @@ TEST_F(RenderWidgetHostViewAuraTest, TouchEventState) {
widget_host_->OnMessageReceived(InputHostMsg_HandleInputEvent_ACK(0, ack));
EXPECT_EQ(0U, GetSentMessageCountAndResetSink());
- ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(20, 20), 0,
- base::Time::NowFromSystemTime() - base::Time());
+ ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::PointF(20.f, 20.f), 0,
+ base::Time::NowFromSystemTime() - base::Time());
view_->OnTouchEvent(&move2);
EXPECT_TRUE(press.synchronous_handling_disabled());
EXPECT_EQ(ui::MotionEvent::ACTION_MOVE, pointer_state().GetAction());
EXPECT_EQ(1U, pointer_state().GetPointerCount());
- ui::TouchEvent release2(ui::ET_TOUCH_RELEASED, gfx::Point(20, 20), 0,
- base::Time::NowFromSystemTime() - base::Time());
+ ui::TouchEvent release2(ui::ET_TOUCH_RELEASED, gfx::PointF(20.f, 20.f), 0,
+ base::Time::NowFromSystemTime() - base::Time());
view_->OnTouchEvent(&release2);
EXPECT_TRUE(press.synchronous_handling_disabled());
EXPECT_EQ(0U, pointer_state().GetPointerCount());
@@ -1197,7 +1191,7 @@ TEST_F(RenderWidgetHostViewAuraTest, MultiTouchPointsStates) {
view_->UseFakeDispatcher();
GetSentMessageCountAndResetSink();
- ui::TouchEvent press0(ui::ET_TOUCH_PRESSED, gfx::Point(30, 30), 0,
+ ui::TouchEvent press0(ui::ET_TOUCH_PRESSED, gfx::PointF(30.f, 30.f), 0,
ui::EventTimeForNow());
view_->OnTouchEvent(&press0);
@@ -1208,7 +1202,7 @@ TEST_F(RenderWidgetHostViewAuraTest, MultiTouchPointsStates) {
EXPECT_EQ(1U, pointer_state().GetPointerCount());
EXPECT_EQ(1U, view_->dispatcher_->GetAndResetProcessedTouchEventCount());
- ui::TouchEvent move0(ui::ET_TOUCH_MOVED, gfx::Point(20, 20), 0,
+ ui::TouchEvent move0(ui::ET_TOUCH_MOVED, gfx::PointF(20.f, 20.f), 0,
ui::EventTimeForNow());
view_->OnTouchEvent(&move0);
@@ -1221,7 +1215,7 @@ TEST_F(RenderWidgetHostViewAuraTest, MultiTouchPointsStates) {
// For the second touchstart, only the state of the second touch point is
// StatePressed, the state of the first touch point is StateStationary.
- ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), 1,
+ ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::PointF(10.f, 10.f), 1,
ui::EventTimeForNow());
view_->OnTouchEvent(&press1);
@@ -1235,7 +1229,7 @@ TEST_F(RenderWidgetHostViewAuraTest, MultiTouchPointsStates) {
// For the touchmove of second point, the state of the second touch point is
// StateMoved, the state of the first touch point is StateStationary.
- ui::TouchEvent move1(ui::ET_TOUCH_MOVED, gfx::Point(30, 30), 1,
+ ui::TouchEvent move1(ui::ET_TOUCH_MOVED, gfx::PointF(30.f, 30.f), 1,
ui::EventTimeForNow());
view_->OnTouchEvent(&move1);
@@ -1248,7 +1242,7 @@ TEST_F(RenderWidgetHostViewAuraTest, MultiTouchPointsStates) {
// For the touchmove of first point, the state of the first touch point is
// StateMoved, the state of the second touch point is StateStationary.
- ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(10, 10), 0,
+ ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::PointF(10.f, 10.f), 0,
ui::EventTimeForNow());
view_->OnTouchEvent(&move2);
@@ -1259,7 +1253,7 @@ TEST_F(RenderWidgetHostViewAuraTest, MultiTouchPointsStates) {
EXPECT_EQ(2U, pointer_state().GetPointerCount());
EXPECT_EQ(1U, view_->dispatcher_->GetAndResetProcessedTouchEventCount());
- ui::TouchEvent cancel0(ui::ET_TOUCH_CANCELLED, gfx::Point(10, 10), 0,
+ ui::TouchEvent cancel0(ui::ET_TOUCH_CANCELLED, gfx::PointF(10.f, 10.f), 0,
ui::EventTimeForNow());
// For the touchcancel, only the state of the current touch point is
@@ -1268,7 +1262,7 @@ TEST_F(RenderWidgetHostViewAuraTest, MultiTouchPointsStates) {
EXPECT_EQ(1U, pointer_state().GetPointerCount());
EXPECT_EQ(1U, view_->dispatcher_->GetAndResetProcessedTouchEventCount());
- ui::TouchEvent cancel1(ui::ET_TOUCH_CANCELLED, gfx::Point(30, 30), 1,
+ ui::TouchEvent cancel1(ui::ET_TOUCH_CANCELLED, gfx::PointF(30.f, 30.f), 1,
ui::EventTimeForNow());
view_->OnTouchEvent(&cancel1);
@@ -1284,17 +1278,11 @@ TEST_F(RenderWidgetHostViewAuraTest, TouchEventSyncAsync) {
widget_host_->OnMessageReceived(ViewHostMsg_HasTouchEventHandlers(0, true));
- ui::TouchEvent press(ui::ET_TOUCH_PRESSED,
- gfx::Point(30, 30),
- 0,
+ ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::PointF(30.f, 30.f), 0,
ui::EventTimeForNow());
- ui::TouchEvent move(ui::ET_TOUCH_MOVED,
- gfx::Point(20, 20),
- 0,
+ ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::PointF(20.f, 20.f), 0,
ui::EventTimeForNow());
- ui::TouchEvent release(ui::ET_TOUCH_RELEASED,
- gfx::Point(20, 20),
- 0,
+ ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::PointF(20.f, 20.f), 0,
ui::EventTimeForNow());
view_->OnTouchEvent(&press);
@@ -3445,11 +3433,11 @@ TEST_F(RenderWidgetHostViewAuraTest,
widget_host_->OnMessageReceived(ViewHostMsg_HasTouchEventHandlers(0, true));
- ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(30, 30), 0,
+ ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::PointF(30.f, 30.f), 0,
ui::EventTimeForNow());
// Construct a move with a touch id which doesn't exist.
- ui::TouchEvent invalid_move(ui::ET_TOUCH_MOVED, gfx::Point(30, 30), 1,
+ ui::TouchEvent invalid_move(ui::ET_TOUCH_MOVED, gfx::PointF(30.f, 30.f), 1,
ui::EventTimeForNow());
// Valid press is handled asynchronously.
@@ -3491,7 +3479,7 @@ TEST_F(RenderWidgetHostViewAuraTest, SetCanScrollForWebMouseWheelEvent) {
sink_->ClearMessages();
// Simulates the mouse wheel event with ctrl modifier applied.
- ui::MouseWheelEvent event(gfx::Vector2d(1, 1), gfx::Point(), gfx::Point(),
+ ui::MouseWheelEvent event(gfx::Vector2d(1, 1), gfx::PointF(), gfx::PointF(),
ui::EventTimeForNow(), ui::EF_CONTROL_DOWN, 0);
view_->OnMouseEvent(&event);
@@ -3509,7 +3497,7 @@ TEST_F(RenderWidgetHostViewAuraTest, SetCanScrollForWebMouseWheelEvent) {
INPUT_EVENT_ACK_STATE_CONSUMED);
// Simulates the mouse wheel event with no modifier applied.
- event = ui::MouseWheelEvent(gfx::Vector2d(1, 1), gfx::Point(), gfx::Point(),
+ event = ui::MouseWheelEvent(gfx::Vector2d(1, 1), gfx::PointF(), gfx::PointF(),
ui::EventTimeForNow(), ui::EF_NONE, 0);
view_->OnMouseEvent(&event);
@@ -3525,8 +3513,9 @@ TEST_F(RenderWidgetHostViewAuraTest, SetCanScrollForWebMouseWheelEvent) {
INPUT_EVENT_ACK_STATE_CONSUMED);
// Simulates the scroll event with ctrl modifier applied.
- ui::ScrollEvent scroll(ui::ET_SCROLL, gfx::Point(2, 2), ui::EventTimeForNow(),
- ui::EF_CONTROL_DOWN, 0, 5, 0, 5, 2);
+ ui::ScrollEvent scroll(ui::ET_SCROLL, gfx::PointF(2.f, 2.f),
+ ui::EventTimeForNow(), ui::EF_CONTROL_DOWN, 0, 5, 0, 5,
+ 2);
view_->OnScrollEvent(&scroll);
input_event = GetInputEventFromMessage(*sink_->GetMessageAt(0));
@@ -3543,15 +3532,15 @@ TEST_F(RenderWidgetHostViewAuraTest, CorrectNumberOfAcksAreDispatched) {
view_->Show();
view_->UseFakeDispatcher();
- ui::TouchEvent press1(
- ui::ET_TOUCH_PRESSED, gfx::Point(30, 30), 0, ui::EventTimeForNow());
+ ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::PointF(30.f, 30.f), 0,
+ ui::EventTimeForNow());
view_->OnTouchEvent(&press1);
SendTouchEventACK(blink::WebInputEvent::TouchStart,
INPUT_EVENT_ACK_STATE_CONSUMED, press1.unique_event_id());
- ui::TouchEvent press2(
- ui::ET_TOUCH_PRESSED, gfx::Point(20, 20), 1, ui::EventTimeForNow());
+ ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::PointF(20.f, 20.f), 1,
+ ui::EventTimeForNow());
view_->OnTouchEvent(&press2);
SendTouchEventACK(blink::WebInputEvent::TouchStart,
INPUT_EVENT_ACK_STATE_CONSUMED, press2.unique_event_id());

Powered by Google App Engine
This is Rietveld 408576698