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

Unified Diff: ash/wm/workspace_controller_unittest.cc

Issue 23591049: Do not show auto-hidden shelf when dragging a window (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@issue_275801
Patch Set: Do not show auto-hidden shelf when dragging a window (test) Created 6 years, 11 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/wm/mru_window_tracker.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/workspace_controller_unittest.cc
diff --git a/ash/wm/workspace_controller_unittest.cc b/ash/wm/workspace_controller_unittest.cc
index 4b5fd92675f4f21cff2c13341112719aff87914e..897595d4be5f8937dd255eac81b2f3a7c9b50e78 100644
--- a/ash/wm/workspace_controller_unittest.cc
+++ b/ash/wm/workspace_controller_unittest.cc
@@ -1280,7 +1280,7 @@ TEST_P(WorkspaceControllerTestDragging, DragWindowOverlapShelf) {
ShelfLayoutManager* shelf = shelf_layout_manager();
shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER);
- // Drag near the shelf
+ // Drag near the shelf.
aura::test::EventGenerator generator(
Shell::GetPrimaryRootWindow(), gfx::Point());
generator.MoveMouseTo(10, 10);
@@ -1298,6 +1298,32 @@ TEST_P(WorkspaceControllerTestDragging, DragWindowOverlapShelf) {
EXPECT_TRUE(GetWindowOverlapsShelf());
}
+// Verifies that when dragging a window autohidden shelf stays hidden during
+// and after the drag.
+TEST_P(WorkspaceControllerTestDragging, DragWindowKeepsShelfAutohidden) {
+ aura::test::TestWindowDelegate delegate;
+ delegate.set_window_component(HTCAPTION);
+ scoped_ptr<Window> w1(aura::test::CreateTestWindowWithDelegate(
+ &delegate, ui::wm::WINDOW_TYPE_NORMAL, gfx::Rect(5, 5, 100, 50), NULL));
+ ParentWindowInPrimaryRootWindow(w1.get());
+
+ ShelfLayoutManager* shelf = shelf_layout_manager();
+ shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
+ EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state());
+
+ // Drag very little.
+ aura::test::EventGenerator generator(
+ Shell::GetPrimaryRootWindow(), gfx::Point());
+ generator.MoveMouseTo(10, 10);
+ generator.PressLeftButton();
+ generator.MoveMouseTo(12, 12);
+
+ // Shelf should be hidden during and after the drag.
+ EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state());
+ generator.ReleaseLeftButton();
+ EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state());
+}
+
INSTANTIATE_TEST_CASE_P(DockedOrNot, WorkspaceControllerTestDragging,
::testing::Bool());
« no previous file with comments | « ash/wm/mru_window_tracker.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698