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

Unified Diff: ash/wm/panels/panel_window_resizer_unittest.cc

Issue 582803002: Don't minimize dragged window when shelf hidden. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge and add comments 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 | « ash/wm/panels/panel_layout_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/panels/panel_window_resizer_unittest.cc
diff --git a/ash/wm/panels/panel_window_resizer_unittest.cc b/ash/wm/panels/panel_window_resizer_unittest.cc
index 42abd7d792a86ba1e84d75540016500cf8c61fbb..2832d68d65f2cb07085ae69aaad7c417dd802553 100644
--- a/ash/wm/panels/panel_window_resizer_unittest.cc
+++ b/ash/wm/panels/panel_window_resizer_unittest.cc
@@ -273,6 +273,38 @@ TEST_F(PanelWindowResizerTest, PanelDetachReattachTop) {
DetachReattachTest(window.get(), 0, 1);
}
+// Tests that a drag continues when the shelf is hidden. This occurs as part of
+// the animation when switching profiles. http://crbug.com/393047.
+TEST_F(PanelWindowResizerTest, DetachThenHideShelf) {
+ if (!SupportsHostWindowResize())
+ return;
+ scoped_ptr<aura::Window> window(
+ CreatePanelWindow(gfx::Point(0, 0)));
+ wm::WindowState* state = wm::GetWindowState(window.get());
+ gfx::Rect expected_bounds = window->GetBoundsInScreen();
+ expected_bounds.set_y(expected_bounds.y() - 100);
+ DragStart(window.get());
+ DragMove(0, -100);
+ EXPECT_FALSE(state->IsMinimized());
+
+ // Hide the shelf. This minimizes all attached windows but should ignore
+ // the dragged window.
+ ShelfLayoutManager* shelf = RootWindowController::ForWindow(window.get())->
+ shelf()->shelf_layout_manager();
+ shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_ALWAYS_HIDDEN);
+ shelf->UpdateVisibilityState();
+ RunAllPendingInMessageLoop();
+ EXPECT_FALSE(state->IsMinimized());
+ EXPECT_EQ(kShellWindowId_PanelContainer, window->parent()->id());
+ DragEnd();
+
+ // When the drag ends the window should be detached and placed where it was
+ // dragged to.
+ EXPECT_EQ(kShellWindowId_DefaultContainer, window->parent()->id());
+ EXPECT_FALSE(state->IsMinimized());
+ EXPECT_EQ(expected_bounds.ToString(), window->GetBoundsInScreen().ToString());
+}
+
TEST_F(PanelWindowResizerTest, PanelDetachReattachMultipleDisplays) {
if (!SupportsMultipleDisplays())
return;
« no previous file with comments | « ash/wm/panels/panel_layout_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698