X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fcontent%2Fbrowser%2Frenderer_host%2Finput%2Fsynthetic_gesture_controller_unittest.cc;h=985210dd8b1b2ca159b3c40e51450f93c9bb026c;hb=ff3e2503a20db9193d323c1d19c38c68004dec4a;hp=c55b600f614b25f40b91ed60685abc82a217870d;hpb=7338fba38ba696536d1cc9d389afd716a6ab2fe6;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/content/browser/renderer_host/input/synthetic_gesture_controller_unittest.cc b/src/content/browser/renderer_host/input/synthetic_gesture_controller_unittest.cc index c55b600..985210d 100644 --- a/src/content/browser/renderer_host/input/synthetic_gesture_controller_unittest.cc +++ b/src/content/browser/renderer_host/input/synthetic_gesture_controller_unittest.cc @@ -218,8 +218,10 @@ class MockSyntheticPinchTouchTarget : public MockSyntheticGestureTarget { if (!started_) { ASSERT_EQ(touch_event.type, WebInputEvent::TouchStart); - start_0_ = gfx::Point(touch_event.touches[0].position); - start_1_ = gfx::Point(touch_event.touches[1].position); + start_0_ = gfx::PointF(touch_event.touches[0].position.x, + touch_event.touches[0].position.y); + start_1_ = gfx::PointF(touch_event.touches[1].position.x, + touch_event.touches[1].position.y); last_pointer_distance_ = (start_0_ - start_1_).Length(); started_ = true; @@ -227,8 +229,10 @@ class MockSyntheticPinchTouchTarget : public MockSyntheticGestureTarget { ASSERT_NE(touch_event.type, WebInputEvent::TouchStart); ASSERT_NE(touch_event.type, WebInputEvent::TouchCancel); - gfx::PointF current_0 = gfx::Point(touch_event.touches[0].position); - gfx::PointF current_1 = gfx::Point(touch_event.touches[1].position); + gfx::PointF current_0 = gfx::PointF(touch_event.touches[0].position.x, + touch_event.touches[0].position.y); + gfx::PointF current_1 = gfx::PointF(touch_event.touches[1].position.x, + touch_event.touches[1].position.y); total_num_pixels_covered_ = (current_0 - start_0_).Length() + (current_1 - start_1_).Length(); @@ -273,7 +277,7 @@ class MockSyntheticTapGestureTarget : public MockSyntheticGestureTarget { virtual ~MockSyntheticTapGestureTarget() {} bool GestureFinished() const { return state_ == FINISHED; } - gfx::Point position() const { return position_; } + gfx::PointF position() const { return position_; } base::TimeDelta GetDuration() const { return stop_time_ - start_time_; } protected: @@ -283,7 +287,9 @@ class MockSyntheticTapGestureTarget : public MockSyntheticGestureTarget { FINISHED }; - gfx::Point position_; + // TODO(tdresser): clean up accesses to position_ once WebTouchPoint stores + // its location as a WebFloatPoint. See crbug.com/336807. + gfx::PointF position_; base::TimeDelta start_time_; base::TimeDelta stop_time_; GestureState state_; @@ -303,14 +309,16 @@ class MockSyntheticTapTouchTarget : public MockSyntheticTapGestureTarget { switch (state_) { case NOT_STARTED: EXPECT_EQ(touch_event.type, WebInputEvent::TouchStart); - position_ = gfx::Point(touch_event.touches[0].position); + position_ = gfx::PointF(touch_event.touches[0].position.x, + touch_event.touches[0].position.y); start_time_ = base::TimeDelta::FromMilliseconds( static_cast(touch_event.timeStampSeconds * 1000)); state_ = STARTED; break; case STARTED: EXPECT_EQ(touch_event.type, WebInputEvent::TouchEnd); - EXPECT_EQ(position_, gfx::Point(touch_event.touches[0].position)); + EXPECT_EQ(position_, gfx::PointF(touch_event.touches[0].position.x, + touch_event.touches[0].position.y)); stop_time_ = base::TimeDelta::FromMilliseconds( static_cast(touch_event.timeStampSeconds * 1000)); state_ = FINISHED;