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

Unified Diff: ash/app_list/app_list_presenter_delegate_unittest.cc

Issue 2982453002: New AppListView Scroll Behavior. (Closed)
Patch Set: Removed unintended edit. Created 3 years, 5 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 | « no previous file | ui/app_list/pagination_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/app_list/app_list_presenter_delegate_unittest.cc
diff --git a/ash/app_list/app_list_presenter_delegate_unittest.cc b/ash/app_list/app_list_presenter_delegate_unittest.cc
index 10c6b451e352758ea1c30255dc1b89bbd859bd0c..6d886c65baf5b700089d7a0837552fe09ef688b2 100644
--- a/ash/app_list/app_list_presenter_delegate_unittest.cc
+++ b/ash/app_list/app_list_presenter_delegate_unittest.cc
@@ -750,4 +750,41 @@ TEST_F(FullscreenAppListPresenterDelegateTest,
EXPECT_FALSE(app_list_presenter_impl()->IsVisible());
}
+// Tests that the app list transitions on mousewheel and gesture scroll events.
+TEST_P(FullscreenAppListPresenterDelegateTest,
+ MouseWheelAndGestureScrollTransition) {
+ const bool test_mouse_event = GetParam();
+ app_list_presenter_impl()->Show(GetPrimaryDisplayId());
+ app_list::AppListView* view = app_list_presenter_impl()->GetView();
+ ui::test::EventGenerator& generator = GetEventGenerator();
+ EXPECT_EQ(view->app_list_state(), app_list::AppListView::PEEKING);
+
+ // Move mouse to over the searchbox, mousewheel scroll up.
+ generator.MoveMouseTo(GetPointInsideSearchbox());
+ if (test_mouse_event) {
+ generator.MoveMouseWheel(0, -30);
+ } else {
+ generator.ScrollSequence(GetPointInsideSearchbox(),
+ base::TimeDelta::FromMilliseconds(5), 0, -300, 2,
+ 2);
+ }
+ EXPECT_EQ(view->app_list_state(), app_list::AppListView::FULLSCREEN_ALL_APPS);
+
+ // Swipe down, the app list should return to peeking mode.
+ generator.GestureScrollSequence(gfx::Point(0, 0), gfx::Point(0, 720),
+ base::TimeDelta::FromMilliseconds(100), 10);
+ EXPECT_EQ(view->app_list_state(), app_list::AppListView::PEEKING);
+
+ // Move mouse away from the searchbox, mousewheel scroll up.
+ generator.MoveMouseTo(GetPointOutsideSearchbox());
+ if (test_mouse_event) {
+ generator.MoveMouseWheel(0, -30);
+ } else {
+ generator.ScrollSequence(GetPointOutsideSearchbox(),
+ base::TimeDelta::FromMilliseconds(5), 0, -300, 2,
+ 2);
+ }
+ EXPECT_EQ(view->app_list_state(), app_list::AppListView::FULLSCREEN_ALL_APPS);
+}
+
} // namespace ash
« no previous file with comments | « no previous file | ui/app_list/pagination_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698