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

Side by Side Diff: athena/home/home_card_gesture_manager_unittest.cc

Issue 507653005: Fixes the fling and closest state logic in HomeCardGestureManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months 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 | « athena/home/home_card_gesture_manager.cc ('k') | athena/home/home_card_unittest.cc » ('j') | 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 "athena/home/home_card_gesture_manager.h" 5 #include "athena/home/home_card_gesture_manager.h"
6 6
7 #include "athena/home/home_card_constants.h" 7 #include "athena/home/home_card_constants.h"
8 #include "athena/home/public/home_card.h" 8 #include "athena/home/public/home_card.h"
9 #include "athena/test/athena_test_base.h" 9 #include "athena/test/athena_test_base.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 EXPECT_EQ(0, GetProgressCountAndReset()); 161 EXPECT_EQ(0, GetProgressCountAndReset());
162 162
163 ProcessGestureEvent(ui::ET_GESTURE_SCROLL_UPDATE, 1010); 163 ProcessGestureEvent(ui::ET_GESTURE_SCROLL_UPDATE, 1010);
164 ProcessGestureEvent(ui::ET_GESTURE_SCROLL_UPDATE, 800); 164 ProcessGestureEvent(ui::ET_GESTURE_SCROLL_UPDATE, 800);
165 ProcessGestureEvent(ui::ET_GESTURE_SCROLL_UPDATE, 200); 165 ProcessGestureEvent(ui::ET_GESTURE_SCROLL_UPDATE, 200);
166 ProcessFlingGesture(150.0f); 166 ProcessFlingGesture(150.0f);
167 EXPECT_EQ(1, GetEndCountAndReset()); 167 EXPECT_EQ(1, GetEndCountAndReset());
168 EXPECT_EQ(HomeCard::VISIBLE_BOTTOM, final_state_); 168 EXPECT_EQ(HomeCard::VISIBLE_BOTTOM, final_state_);
169 } 169 }
170 170
171 TEST_F(HomeCardGestureManagerTest, WeakFling) {
172 EXPECT_TRUE(ProcessGestureEvent(ui::ET_GESTURE_SCROLL_BEGIN, 1020));
173 EXPECT_EQ(0, GetEndCountAndReset());
174 EXPECT_EQ(0, GetProgressCountAndReset());
175
176 ProcessGestureEvent(ui::ET_GESTURE_SCROLL_UPDATE, 1010);
177 ProcessGestureEvent(ui::ET_GESTURE_SCROLL_UPDATE, 800);
178 ProcessFlingGesture(-30.0f);
179 EXPECT_EQ(1, GetEndCountAndReset());
180 EXPECT_EQ(HomeCard::VISIBLE_BOTTOM, final_state_);
181 }
182
171 } // namespace athena 183 } // namespace athena
OLDNEW
« no previous file with comments | « athena/home/home_card_gesture_manager.cc ('k') | athena/home/home_card_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698