Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: ui/android/overscroll_refresh_unittest.cc

Issue 2528823002: Separate SwipeRefreshHandler and ContentViewCore (Closed)
Patch Set: tedchoc's requested changes Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/android/overscroll_refresh_handler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « ui/android/overscroll_refresh_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698