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

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

Issue 529813002: Simplify HomeCardGestureManager::UpdateScrollState() (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
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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 EXPECT_TRUE(ProcessGestureEvent(ui::ET_GESTURE_SCROLL_BEGIN, 1020)); 103 EXPECT_TRUE(ProcessGestureEvent(ui::ET_GESTURE_SCROLL_BEGIN, 1020));
104 EXPECT_EQ(0, GetEndCountAndReset()); 104 EXPECT_EQ(0, GetEndCountAndReset());
105 EXPECT_EQ(0, GetProgressCountAndReset()); 105 EXPECT_EQ(0, GetProgressCountAndReset());
106 106
107 ProcessGestureEvent(ui::ET_GESTURE_SCROLL_UPDATE, 1019); 107 ProcessGestureEvent(ui::ET_GESTURE_SCROLL_UPDATE, 1019);
108 EXPECT_EQ(1, GetProgressCountAndReset()); 108 EXPECT_EQ(1, GetProgressCountAndReset());
109 EXPECT_EQ(HomeCard::VISIBLE_MINIMIZED, last_from_state_); 109 EXPECT_EQ(HomeCard::VISIBLE_MINIMIZED, last_from_state_);
110 EXPECT_EQ(HomeCard::VISIBLE_BOTTOM, last_to_state_); 110 EXPECT_EQ(HomeCard::VISIBLE_BOTTOM, last_to_state_);
111 EXPECT_GT(1.0f, last_progress_); 111 EXPECT_GT(1.0f, last_progress_);
112 112
113 ProcessGestureEvent(ui::ET_GESTURE_SCROLL_UPDATE, 1020);
114 ProcessGestureEvent(ui::ET_GESTURE_SCROLL_UPDATE, 1022);
115 EXPECT_EQ(2, GetProgressCountAndReset());
116 EXPECT_EQ(HomeCard::VISIBLE_BOTTOM, last_from_state_);
117 EXPECT_EQ(HomeCard::VISIBLE_MINIMIZED, last_to_state_);
118 EXPECT_EQ(1.0f, last_progress_);
119
113 ProcessGestureEvent(ui::ET_GESTURE_SCROLL_UPDATE, 1010); 120 ProcessGestureEvent(ui::ET_GESTURE_SCROLL_UPDATE, 1010);
114 float progress_1010 = last_progress_; 121 float progress_1010 = last_progress_;
115 ProcessGestureEvent(ui::ET_GESTURE_SCROLL_UPDATE, 1008); 122 ProcessGestureEvent(ui::ET_GESTURE_SCROLL_UPDATE, 1008);
116 ProcessGestureEvent(ui::ET_GESTURE_SCROLL_UPDATE, 1000); 123 ProcessGestureEvent(ui::ET_GESTURE_SCROLL_UPDATE, 1000);
117 EXPECT_EQ(3, GetProgressCountAndReset()); 124 EXPECT_EQ(3, GetProgressCountAndReset());
118 EXPECT_EQ(HomeCard::VISIBLE_MINIMIZED, last_from_state_); 125 EXPECT_EQ(HomeCard::VISIBLE_MINIMIZED, last_from_state_);
119 EXPECT_EQ(HomeCard::VISIBLE_BOTTOM, last_to_state_); 126 EXPECT_EQ(HomeCard::VISIBLE_BOTTOM, last_to_state_);
120 EXPECT_LT(progress_1010, last_progress_); 127 EXPECT_LT(progress_1010, last_progress_);
121 128
122 ProcessGestureEvent(ui::ET_GESTURE_SCROLL_UPDATE, 900); 129 ProcessGestureEvent(ui::ET_GESTURE_SCROLL_UPDATE, 900);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 EXPECT_EQ(0, GetProgressCountAndReset()); 181 EXPECT_EQ(0, GetProgressCountAndReset());
175 182
176 ProcessGestureEvent(ui::ET_GESTURE_SCROLL_UPDATE, 1010); 183 ProcessGestureEvent(ui::ET_GESTURE_SCROLL_UPDATE, 1010);
177 ProcessGestureEvent(ui::ET_GESTURE_SCROLL_UPDATE, 800); 184 ProcessGestureEvent(ui::ET_GESTURE_SCROLL_UPDATE, 800);
178 ProcessFlingGesture(-30.0f); 185 ProcessFlingGesture(-30.0f);
179 EXPECT_EQ(1, GetEndCountAndReset()); 186 EXPECT_EQ(1, GetEndCountAndReset());
180 EXPECT_EQ(HomeCard::VISIBLE_BOTTOM, final_state_); 187 EXPECT_EQ(HomeCard::VISIBLE_BOTTOM, final_state_);
181 } 188 }
182 189
183 } // namespace athena 190 } // namespace athena
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698