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

Unified Diff: athena/home/home_card_gesture_manager_unittest.cc

Issue 582923002: Do not EASE_IN_OUT after fling, rather EASE_OUT. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « athena/home/home_card_gesture_manager.cc ('k') | athena/home/home_card_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: athena/home/home_card_gesture_manager_unittest.cc
diff --git a/athena/home/home_card_gesture_manager_unittest.cc b/athena/home/home_card_gesture_manager_unittest.cc
index 72ad612b13f9b4f50170f5ad8f6a5e728f618c0f..99b2bee5efab95bb5413cac7b9878a39c638262b 100644
--- a/athena/home/home_card_gesture_manager_unittest.cc
+++ b/athena/home/home_card_gesture_manager_unittest.cc
@@ -21,6 +21,7 @@ class HomeCardGestureManagerTest : public test::AthenaTestBase,
last_from_state_(HomeCard::HIDDEN),
last_to_state_(HomeCard::HIDDEN),
last_progress_(0.0f),
+ was_fling_(false),
last_y_(0),
progress_count_(0),
end_count_(0) {}
@@ -82,6 +83,7 @@ class HomeCardGestureManagerTest : public test::AthenaTestBase,
HomeCard::State last_from_state_;
HomeCard::State last_to_state_;
float last_progress_;
+ bool was_fling_;
private:
gfx::Rect screen_bounds() const {
@@ -89,8 +91,10 @@ class HomeCardGestureManagerTest : public test::AthenaTestBase,
}
// HomeCardGestureManager::Delegate:
- virtual void OnGestureEnded(HomeCard::State final_state) OVERRIDE {
+ virtual void OnGestureEnded(HomeCard::State final_state,
+ bool is_fling) OVERRIDE {
final_state_ = final_state;
+ was_fling_ = is_fling;
++end_count_;
}
@@ -162,6 +166,7 @@ TEST_F(HomeCardGestureManagerTest, Basic) {
EXPECT_TRUE(ProcessGestureEvent(ui::ET_GESTURE_SCROLL_END, 810));
EXPECT_EQ(1, GetEndCountAndReset());
EXPECT_EQ(HomeCard::VISIBLE_BOTTOM, final_state_);
+ EXPECT_FALSE(was_fling_);
}
// Test gesture progress when the gesture is initiated when the home card is in
@@ -220,6 +225,7 @@ TEST_F(HomeCardGestureManagerTest, StartBottom) {
EXPECT_TRUE(ProcessGestureEvent(ui::ET_GESTURE_SCROLL_END, 300));
EXPECT_EQ(1, GetEndCountAndReset());
EXPECT_EQ(HomeCard::VISIBLE_CENTERED, final_state_);
+ EXPECT_FALSE(was_fling_);
}
TEST_F(HomeCardGestureManagerTest, FlingUpAtEnd) {
@@ -233,6 +239,7 @@ TEST_F(HomeCardGestureManagerTest, FlingUpAtEnd) {
ProcessFlingGesture(-150.0f);
EXPECT_EQ(1, GetEndCountAndReset());
EXPECT_EQ(HomeCard::VISIBLE_BOTTOM, final_state_);
+ EXPECT_TRUE(was_fling_);
}
TEST_F(HomeCardGestureManagerTest, FlingDownAtEnd) {
@@ -247,6 +254,7 @@ TEST_F(HomeCardGestureManagerTest, FlingDownAtEnd) {
ProcessFlingGesture(150.0f);
EXPECT_EQ(1, GetEndCountAndReset());
EXPECT_EQ(HomeCard::VISIBLE_BOTTOM, final_state_);
+ EXPECT_TRUE(was_fling_);
}
TEST_F(HomeCardGestureManagerTest, WeakFling) {
@@ -260,6 +268,7 @@ TEST_F(HomeCardGestureManagerTest, WeakFling) {
ProcessFlingGesture(-30.0f);
EXPECT_EQ(1, GetEndCountAndReset());
EXPECT_EQ(HomeCard::VISIBLE_MINIMIZED, final_state_);
+ EXPECT_FALSE(was_fling_);
}
// Test the situation where the user intends a single fling but the finger
@@ -281,6 +290,7 @@ TEST_F(HomeCardGestureManagerTest, FastFling) {
ProcessFlingGesture(-150.0f);
EXPECT_EQ(1, GetEndCountAndReset());
EXPECT_EQ(HomeCard::VISIBLE_BOTTOM, final_state_);
+ EXPECT_TRUE(was_fling_);
}
} // namespace athena
« no previous file with comments | « athena/home/home_card_gesture_manager.cc ('k') | athena/home/home_card_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698