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

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: Get workspace event handler from workspace controller. 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 4be464567b906f15ba5f803a969bc6b789c5f3fc..8f108d323bff2f73acc6a0df425a32bbd75a1d98 100644
--- a/ash/wm/panels/panel_window_resizer_unittest.cc
+++ b/ash/wm/panels/panel_window_resizer_unittest.cc
@@ -103,6 +103,7 @@ class PanelWindowResizerTest : public test::AshTestBase {
// dragging out by the vector (dx, dy).
void DetachReattachTest(int dx, int dy) {
EXPECT_TRUE(window_->GetProperty(kPanelAttachedKey));
+ EXPECT_EQ(internal::kShellWindowId_PanelContainer, window_->parent()->id());
DragStart();
gfx::Rect initial_bounds = window_->bounds();
@@ -120,6 +121,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();
// Drag the panel down.
@@ -131,6 +134,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());
}
aura::test::TestWindowDelegate delegate_;
@@ -177,5 +181,23 @@ TEST_F(PanelWindowResizerTest, PanelDetachReattachTop) {
DetachReattachTest(0, 1);
}
+TEST_F(PanelWindowResizerTest, DragMovesToPanelLayer) {
+ DragStart();
+ 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();
+ 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());
+}
+
} // namespace internal
} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698