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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
| 7 #include <memory> |
| 8 |
7 #include "base/logging.h" | 9 #include "base/logging.h" |
8 #include "base/memory/scoped_ptr.h" | |
9 #include "base/time/time.h" | 10 #include "base/time/time.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
11 #include "ui/events/gesture_detection/velocity_tracker_state.h" | 12 #include "ui/events/gesture_detection/velocity_tracker_state.h" |
12 #include "ui/events/test/motion_event_test_utils.h" | 13 #include "ui/events/test/motion_event_test_utils.h" |
13 #include "ui/gfx/geometry/point_f.h" | 14 #include "ui/gfx/geometry/point_f.h" |
14 #include "ui/gfx/geometry/vector2d_f.h" | 15 #include "ui/gfx/geometry/vector2d_f.h" |
15 | 16 |
16 using base::TimeDelta; | 17 using base::TimeDelta; |
17 using base::TimeTicks; | 18 using base::TimeTicks; |
18 using ui::test::MockMotionEvent; | 19 using ui::test::MockMotionEvent; |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 | 255 |
255 // This does not hold for the unrestricted LSQ2 strategy. | 256 // This does not hold for the unrestricted LSQ2 strategy. |
256 state_unrestricted.ComputeCurrentVelocity(1000, 20000); | 257 state_unrestricted.ComputeCurrentVelocity(1000, 20000); |
257 EXPECT_EQ(0, state_unrestricted.GetXVelocity(0)); | 258 EXPECT_EQ(0, state_unrestricted.GetXVelocity(0)); |
258 // Y velocity is negative, despite the fact that the finger only moved in the | 259 // Y velocity is negative, despite the fact that the finger only moved in the |
259 // positive y direction. | 260 // positive y direction. |
260 EXPECT_GT(0, state_unrestricted.GetYVelocity(0)); | 261 EXPECT_GT(0, state_unrestricted.GetYVelocity(0)); |
261 } | 262 } |
262 | 263 |
263 } // namespace ui | 264 } // namespace ui |
OLD | NEW |