| 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/android/scoped_java_ref.h" |
| 5 #include "cc/layers/layer.h" | 6 #include "cc/layers/layer.h" |
| 6 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 7 #include "ui/android/overscroll_refresh.h" | 8 #include "ui/android/overscroll_refresh.h" |
| 9 #include "ui/android/overscroll_refresh_handler.h" |
| 8 | 10 |
| 9 namespace ui { | 11 namespace ui { |
| 10 | 12 |
| 11 class OverscrollRefreshTest : public OverscrollRefreshHandler, | 13 class OverscrollRefreshTest : public OverscrollRefreshHandler, |
| 12 public testing::Test { | 14 public testing::Test { |
| 13 public: | 15 public: |
| 14 OverscrollRefreshTest() {} | 16 OverscrollRefreshTest() : OverscrollRefreshHandler(nullptr) {} |
| 15 | 17 |
| 16 // OverscrollRefreshHandler implementation. | 18 // OverscrollRefreshHandler implementation. |
| 17 bool PullStart() override { | 19 bool PullStart() override { |
| 18 started_ = true; | 20 started_ = true; |
| 19 return true; | 21 return true; |
| 20 } | 22 } |
| 21 | 23 |
| 22 void PullUpdate(float delta) override { delta_ += delta; } | 24 void PullUpdate(float delta) override { delta_ += delta; } |
| 23 | 25 |
| 24 void PullRelease(bool allow_refresh) override { | 26 void PullRelease(bool allow_refresh) override { |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 EXPECT_TRUE(GetAndResetPullStarted()); | 234 EXPECT_TRUE(GetAndResetPullStarted()); |
| 233 | 235 |
| 234 // An early reset should prevent the refresh action from firing. | 236 // An early reset should prevent the refresh action from firing. |
| 235 effect.Reset(); | 237 effect.Reset(); |
| 236 EXPECT_TRUE(GetAndResetPullReset()); | 238 EXPECT_TRUE(GetAndResetPullReset()); |
| 237 effect.OnScrollEnd(gfx::Vector2dF()); | 239 effect.OnScrollEnd(gfx::Vector2dF()); |
| 238 EXPECT_FALSE(GetAndResetPullReleased()); | 240 EXPECT_FALSE(GetAndResetPullReleased()); |
| 239 } | 241 } |
| 240 | 242 |
| 241 } // namespace ui | 243 } // namespace ui |
| OLD | NEW |