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

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: 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..a8422f68a5b61d1e14132f620dd4f0d69cdb8244 100644
--- a/ash/wm/panels/panel_window_resizer_unittest.cc
+++ b/ash/wm/panels/panel_window_resizer_unittest.cc
@@ -273,6 +273,36 @@ TEST_F(PanelWindowResizerTest, PanelDetachReattachTop) {
DetachReattachTest(window.get(), 0, 1);
}
Mr4D (OOO till 08-26) 2014/09/18 23:39:00 Could you please add a comment for this test? You
flackr 2014/09/19 14:17:06 Done.
+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 where it was dragged
+ // to.
Mr4D (OOO till 08-26) 2014/09/18 23:39:00 This sentence is odd. When the drag ends, the win
flackr 2014/09/19 14:17:06 Done.
+ 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