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

Unified Diff: ash/shelf/shelf_layout_manager_unittest.cc

Issue 2224653002: mash: Remove ash::ShelfGestureHandler and ui::ET_GESTURE_WIN8_EDGE_SWIPE (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 4 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 | « ash/shelf/shelf_layout_manager.cc ('k') | ash/shelf/shelf_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_layout_manager_unittest.cc
diff --git a/ash/shelf/shelf_layout_manager_unittest.cc b/ash/shelf/shelf_layout_manager_unittest.cc
index 9f37d72b9ce69f9fe7651decffe945f3da76a24d..0c867b7847f31473dd3ca52452df751a5fb2278b 100644
--- a/ash/shelf/shelf_layout_manager_unittest.cc
+++ b/ash/shelf/shelf_layout_manager_unittest.cc
@@ -1501,108 +1501,6 @@ TEST_F(ShelfLayoutManagerTest, SetAlignment) {
display.bounds().right() - display.work_area().right());
}
-TEST_F(ShelfLayoutManagerTest, GestureEdgeSwipe) {
- Shelf* shelf = GetShelf();
- ShelfLayoutManager* layout_manager = GetShelfLayoutManager();
- shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER);
- views::Widget* widget = CreateTestWidget();
- widget->Maximize();
-
- ui::test::EventGenerator& generator(GetEventGenerator());
-
- aura::Window* window = widget->GetNativeWindow();
- layout_manager->LayoutShelf();
-
- // Edge swipe when SHELF_VISIBLE should not change visibility state.
- EXPECT_EQ(SHELF_VISIBLE, shelf->GetVisibilityState());
- generator.GestureEdgeSwipe();
- EXPECT_EQ(SHELF_VISIBLE, shelf->GetVisibilityState());
-
- // Edge swipe when AUTO_HIDE_HIDDEN should change to AUTO_HIDE_SHOWN.
- shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
- layout_manager->LayoutShelf();
- EXPECT_EQ(SHELF_AUTO_HIDE, shelf->GetVisibilityState());
- EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->GetAutoHideState());
- generator.GestureEdgeSwipe();
- EXPECT_EQ(SHELF_AUTO_HIDE, shelf->GetVisibilityState());
- EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf->GetAutoHideState());
-
- widget->SetFullscreen(true);
- wm::GetWindowState(window)->set_hide_shelf_when_fullscreen(false);
- layout_manager->UpdateVisibilityState();
-
- // Edge swipe in fullscreen + AUTO_HIDE_HIDDEN should show the shelf and
- // remain fullscreen.
- EXPECT_TRUE(widget->IsFullscreen());
- EXPECT_EQ(SHELF_AUTO_HIDE, shelf->GetVisibilityState());
- EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->GetAutoHideState());
- generator.GestureEdgeSwipe();
- EXPECT_EQ(SHELF_AUTO_HIDE, shelf->GetVisibilityState());
- EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf->GetAutoHideState());
- EXPECT_TRUE(widget->IsFullscreen());
-}
-
-// Tests that gesture edge swipe events are forwarded to the right shelf on the
-// right monitor (crbug.com/449851).
-TEST_F(ShelfLayoutManagerTest, GestureEdgeSwipeMultiMonitor) {
- if (!SupportsMultipleDisplays())
- return;
-
- // Create two displays.
- UpdateDisplay("200x200,100x100");
- auto root_window_controllers = Shell::GetAllRootWindowControllers();
- ASSERT_EQ(2U, root_window_controllers.size());
- Shelf* shelf_1 = root_window_controllers[0]->GetShelf();
- Shelf* shelf_2 = root_window_controllers[1]->GetShelf();
-
- // Create two maximized windows, one in each display.
- aura::Window* window_1 =
- CreateTestWindowInParent(root_window_controllers[0]->GetRootWindow());
- window_1->SetBounds(gfx::Rect(0, 0, 100, 100));
- window_1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED);
- window_1->Show();
- aura::Window* window_2 =
- CreateTestWindowInParent(root_window_controllers[1]->GetRootWindow());
- window_2->SetBounds(gfx::Rect(201, 0, 100, 100));
- window_2->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED);
- window_2->Show();
-
- // Make sure both are set to auto-hide and both are hidden.
- shelf_1->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
- shelf_2->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
- shelf_1->shelf_layout_manager()->LayoutShelf();
- shelf_2->shelf_layout_manager()->LayoutShelf();
- EXPECT_EQ(SHELF_AUTO_HIDE, shelf_1->GetVisibilityState());
- EXPECT_EQ(SHELF_AUTO_HIDE, shelf_2->GetVisibilityState());
- EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf_1->GetAutoHideState());
- EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf_2->GetAutoHideState());
-
- ui::test::EventGenerator monitor_1_generator(
- root_window_controllers[0]->GetRootWindow());
- ui::test::EventGenerator monitor_2_generator(
- root_window_controllers[1]->GetRootWindow());
-
- // An edge swipe in one display should only affect the shelf in that display.
- monitor_1_generator.GestureEdgeSwipe();
- EXPECT_EQ(SHELF_AUTO_HIDE, shelf_1->GetVisibilityState());
- EXPECT_EQ(SHELF_AUTO_HIDE, shelf_2->GetVisibilityState());
- EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf_1->GetAutoHideState());
- EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf_2->GetAutoHideState());
-
- // Back to normal after an update.
- Shell::GetInstance()->UpdateShelfVisibility();
- EXPECT_EQ(SHELF_AUTO_HIDE, shelf_1->GetVisibilityState());
- EXPECT_EQ(SHELF_AUTO_HIDE, shelf_2->GetVisibilityState());
- EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf_1->GetAutoHideState());
- EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf_2->GetAutoHideState());
-
- monitor_2_generator.GestureEdgeSwipe();
- EXPECT_EQ(SHELF_AUTO_HIDE, shelf_1->GetVisibilityState());
- EXPECT_EQ(SHELF_AUTO_HIDE, shelf_2->GetVisibilityState());
- EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf_1->GetAutoHideState());
- EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf_2->GetAutoHideState());
-}
-
TEST_F(ShelfLayoutManagerTest, GestureDrag) {
// Slop is an implementation detail of gesture recognition, and complicates
// these tests. Ignore it.
« no previous file with comments | « ash/shelf/shelf_layout_manager.cc ('k') | ash/shelf/shelf_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698