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

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

Issue 2528823002: Separate SwipeRefreshHandler and ContentViewCore (Closed)
Patch Set: boliu's requested changes + some lint fixes 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
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()
17 : OverscrollRefreshHandler(base::android::JavaRef<jobject>()) {}
boliu 2016/12/06 16:06:45 nit: I *think* nullptr is good enough?
rlanday 2016/12/06 19:01:16 Ok I'll try that
15 18
16 // OverscrollRefreshHandler implementation. 19 // OverscrollRefreshHandler implementation.
17 bool PullStart() override { 20 bool PullStart() override {
18 started_ = true; 21 started_ = true;
19 return true; 22 return true;
20 } 23 }
21 24
22 void PullUpdate(float delta) override { delta_ += delta; } 25 void PullUpdate(float delta) override { delta_ += delta; }
23 26
24 void PullRelease(bool allow_refresh) override { 27 void PullRelease(bool allow_refresh) override {
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 EXPECT_TRUE(GetAndResetPullStarted()); 235 EXPECT_TRUE(GetAndResetPullStarted());
233 236
234 // An early reset should prevent the refresh action from firing. 237 // An early reset should prevent the refresh action from firing.
235 effect.Reset(); 238 effect.Reset();
236 EXPECT_TRUE(GetAndResetPullReset()); 239 EXPECT_TRUE(GetAndResetPullReset());
237 effect.OnScrollEnd(gfx::Vector2dF()); 240 effect.OnScrollEnd(gfx::Vector2dF());
238 EXPECT_FALSE(GetAndResetPullReleased()); 241 EXPECT_FALSE(GetAndResetPullReleased());
239 } 242 }
240 243
241 } // namespace ui 244 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698