| 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 <limits.h> |
| 6 |
| 5 #include "base/time/time.h" | 7 #include "base/time/time.h" |
| 6 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 7 #include "ui/events/android/scroller.h" | 9 #include "ui/events/android/scroller.h" |
| 8 | 10 |
| 9 namespace ui { | 11 namespace ui { |
| 10 namespace { | 12 namespace { |
| 11 | 13 |
| 12 const float kDefaultStartX = 7.f; | 14 const float kDefaultStartX = 7.f; |
| 13 const float kDefaultStartY = 25.f; | 15 const float kDefaultStartY = 25.f; |
| 14 const float kDefaultDeltaX = -20.f; | 16 const float kDefaultDeltaX = -20.f; |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 // Try to advance further; nothing should change. | 169 // Try to advance further; nothing should change. |
| 168 EXPECT_FALSE(scroller.ComputeScrollOffset( | 170 EXPECT_FALSE(scroller.ComputeScrollOffset( |
| 169 start_time + scroll_duration * 2, &offset, &velocity)); | 171 start_time + scroll_duration * 2, &offset, &velocity)); |
| 170 EXPECT_EQ(scroller.GetFinalX(), offset.x()); | 172 EXPECT_EQ(scroller.GetFinalX(), offset.x()); |
| 171 EXPECT_EQ(scroller.GetFinalY(), offset.y()); | 173 EXPECT_EQ(scroller.GetFinalY(), offset.y()); |
| 172 EXPECT_TRUE(scroller.IsFinished()); | 174 EXPECT_TRUE(scroller.IsFinished()); |
| 173 EXPECT_EQ(scroll_duration, scroller.GetTimePassed()); | 175 EXPECT_EQ(scroll_duration, scroller.GetTimePassed()); |
| 174 } | 176 } |
| 175 | 177 |
| 176 } // namespace ui | 178 } // namespace ui |
| OLD | NEW |