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/time/time.h" | 8 #include "base/time/time.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 #include "ui/events/gesture_detection/velocity_tracker_state.h" | 10 #include "ui/events/gesture_detection/velocity_tracker_state.h" |
11 #include "ui/events/test/mock_motion_event.h" | 11 #include "ui/events/test/motion_event_test_utils.h" |
12 #include "ui/gfx/geometry/point_f.h" | 12 #include "ui/gfx/geometry/point_f.h" |
13 #include "ui/gfx/geometry/vector2d_f.h" | 13 #include "ui/gfx/geometry/vector2d_f.h" |
14 | 14 |
15 using base::TimeDelta; | 15 using base::TimeDelta; |
16 using base::TimeTicks; | 16 using base::TimeTicks; |
17 using ui::test::MockMotionEvent; | 17 using ui::test::MockMotionEvent; |
18 | 18 |
19 namespace ui { | 19 namespace ui { |
20 namespace { | 20 namespace { |
21 | 21 |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 state.AddMovement(Sample( | 213 state.AddMovement(Sample( |
214 MotionEvent::ACTION_UP, p1, t1, v, base::TimeDelta())); | 214 MotionEvent::ACTION_UP, p1, t1, v, base::TimeDelta())); |
215 | 215 |
216 // The tracked velocity should have been reset. | 216 // The tracked velocity should have been reset. |
217 state.ComputeCurrentVelocity(1000, 1000); | 217 state.ComputeCurrentVelocity(1000, 1000); |
218 EXPECT_EQ(0.f, state.GetXVelocity(0)); | 218 EXPECT_EQ(0.f, state.GetXVelocity(0)); |
219 EXPECT_EQ(0.f, state.GetYVelocity(0)); | 219 EXPECT_EQ(0.f, state.GetYVelocity(0)); |
220 } | 220 } |
221 | 221 |
222 } // namespace ui | 222 } // namespace ui |
OLD | NEW |