| OLD | NEW |
| 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 #include "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/logging.h" | 6 #include "base/logging.h" |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 #include "ui/events/event_constants.h" | 11 #include "ui/events/event_constants.h" |
| 12 #include "ui/events/gesture_detection/gesture_event_data.h" | 12 #include "ui/events/gesture_detection/gesture_event_data.h" |
| 13 #include "ui/events/gesture_detection/gesture_provider.h" | 13 #include "ui/events/gesture_detection/gesture_provider.h" |
| 14 #include "ui/events/gesture_detection/mock_motion_event.h" | |
| 15 #include "ui/events/gesture_detection/motion_event.h" | 14 #include "ui/events/gesture_detection/motion_event.h" |
| 15 #include "ui/events/test/mock_motion_event.h" |
| 16 #include "ui/gfx/geometry/point_f.h" | 16 #include "ui/gfx/geometry/point_f.h" |
| 17 | 17 |
| 18 using base::TimeDelta; | 18 using base::TimeDelta; |
| 19 using base::TimeTicks; | 19 using base::TimeTicks; |
| 20 using ui::test::MockMotionEvent; |
| 20 | 21 |
| 21 namespace ui { | 22 namespace ui { |
| 22 namespace { | 23 namespace { |
| 23 | 24 |
| 24 const float kFakeCoordX = 42.f; | 25 const float kFakeCoordX = 42.f; |
| 25 const float kFakeCoordY = 24.f; | 26 const float kFakeCoordY = 24.f; |
| 26 const TimeDelta kOneSecond = TimeDelta::FromSeconds(1); | 27 const TimeDelta kOneSecond = TimeDelta::FromSeconds(1); |
| 27 const TimeDelta kOneMicrosecond = TimeDelta::FromMicroseconds(1); | 28 const TimeDelta kOneMicrosecond = TimeDelta::FromMicroseconds(1); |
| 28 const TimeDelta kDeltaTimeForFlingSequences = TimeDelta::FromMilliseconds(5); | 29 const TimeDelta kDeltaTimeForFlingSequences = TimeDelta::FromMilliseconds(5); |
| 29 const float kMockTouchRadius = MockMotionEvent::TOUCH_MAJOR / 2; | 30 const float kMockTouchRadius = MockMotionEvent::TOUCH_MAJOR / 2; |
| (...skipping 2259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2289 ObtainMotionEvent(event_time + kOneMicrosecond, MotionEvent::ACTION_UP); | 2290 ObtainMotionEvent(event_time + kOneMicrosecond, MotionEvent::ACTION_UP); |
| 2290 EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); | 2291 EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); |
| 2291 EXPECT_EQ(ET_GESTURE_TAP, GetMostRecentGestureEventType()); | 2292 EXPECT_EQ(ET_GESTURE_TAP, GetMostRecentGestureEventType()); |
| 2292 EXPECT_EQ(kMinGestureBoundsLength, | 2293 EXPECT_EQ(kMinGestureBoundsLength, |
| 2293 GetMostRecentGestureEvent().details.bounding_box_f().width()); | 2294 GetMostRecentGestureEvent().details.bounding_box_f().width()); |
| 2294 EXPECT_EQ(kMinGestureBoundsLength, | 2295 EXPECT_EQ(kMinGestureBoundsLength, |
| 2295 GetMostRecentGestureEvent().details.bounding_box_f().height()); | 2296 GetMostRecentGestureEvent().details.bounding_box_f().height()); |
| 2296 } | 2297 } |
| 2297 | 2298 |
| 2298 } // namespace ui | 2299 } // namespace ui |
| OLD | NEW |