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

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

Issue 12441010: Attach panel while dragging to bring it in front of other panels. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix merge. Created 7 years, 9 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
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 785254d27029c2bb2cca9457b1c82cd13f5ae383..829516e71afe2faeaa36cdf8b9cdddc1fbcf4f90 100644
--- a/ash/wm/panels/panel_window_resizer_unittest.cc
+++ b/ash/wm/panels/panel_window_resizer_unittest.cc
@@ -105,6 +105,7 @@ class PanelWindowResizerTest : public test::AshTestBase {
scoped_ptr<aura::Window> window(
CreatePanelWindow(gfx::Rect(0, 0, 201, 201)));
EXPECT_TRUE(window->GetProperty(kPanelAttachedKey));
+ EXPECT_EQ(internal::kShellWindowId_PanelContainer, window->parent()->id());
DragStart(window.get());
gfx::Rect initial_bounds = window->bounds();
@@ -122,6 +123,8 @@ class PanelWindowResizerTest : public test::AshTestBase {
// The panel should be detached when the drag completes.
DragEnd();
EXPECT_FALSE(window->GetProperty(kPanelAttachedKey));
+ EXPECT_EQ(internal::kShellWindowId_WorkspaceContainer,
+ window->parent()->id());
DragStart(window.get());
// Drag the panel down.
@@ -133,6 +136,7 @@ class PanelWindowResizerTest : public test::AshTestBase {
EXPECT_TRUE(window->GetProperty(kPanelAttachedKey));
EXPECT_EQ(initial_bounds.x(), window->bounds().x());
EXPECT_EQ(initial_bounds.y(), window->bounds().y());
+ EXPECT_EQ(internal::kShellWindowId_PanelContainer, window->parent()->id());
}
void TestWindowOrder(const std::vector<aura::Window*>& window_order) {
@@ -221,6 +225,25 @@ TEST_F(PanelWindowResizerTest, PanelDetachReattachTop) {
DetachReattachTest(0, 1);
}
+TEST_F(PanelWindowResizerTest, DragMovesToPanelLayer) {
+ scoped_ptr<aura::Window> window(CreatePanelWindow(gfx::Rect(0, 0, 201, 201)));
+ DragStart(window.get());
+ DragMove(0, -100);
+ DragEnd();
+ EXPECT_EQ(internal::kShellWindowId_WorkspaceContainer,
+ window->parent()->id());
+
+ // While moving the panel window should be moved to the panel container.
+ DragStart(window.get());
+ DragMove(20, 0);
+ EXPECT_EQ(internal::kShellWindowId_PanelContainer, window->parent()->id());
+ DragEnd();
+
+ // When dropped it should return to the default container.
+ EXPECT_EQ(internal::kShellWindowId_WorkspaceContainer,
+ window->parent()->id());
+}
+
TEST_F(PanelWindowResizerTest, DragReordersPanelsHorizontal) {
DragAlongShelfReorder(-1, 0);
}

Powered by Google App Engine
This is Rietveld 408576698