| Index: ash/wm/dock/docked_window_layout_manager_unittest.cc
|
| diff --git a/ash/wm/dock/docked_window_layout_manager_unittest.cc b/ash/wm/dock/docked_window_layout_manager_unittest.cc
|
| index b2f6ffd9cf4ef48cb3db3e8eb4a89a65555c3d14..ad234094434a92a9a9c7df00be22bddadb957d65 100644
|
| --- a/ash/wm/dock/docked_window_layout_manager_unittest.cc
|
| +++ b/ash/wm/dock/docked_window_layout_manager_unittest.cc
|
| @@ -97,16 +97,11 @@ class DockedWindowLayoutManagerTest
|
| }
|
|
|
| void DragStart(aura::Window* window) {
|
| - initial_location_in_parent_ = window->bounds().origin();
|
| - resizer_.reset(CreateSomeWindowResizer(window,
|
| - initial_location_in_parent_,
|
| - HTCAPTION));
|
| - ASSERT_TRUE(resizer_.get());
|
| + DragStartAtOffsetFromwindowOrigin(window, 0, 0);
|
| }
|
|
|
| void DragStartAtOffsetFromwindowOrigin(aura::Window* window,
|
| - int dx,
|
| - int dy) {
|
| + int dx, int dy) {
|
| initial_location_in_parent_ =
|
| window->bounds().origin() + gfx::Vector2d(dx, dy);
|
| resizer_.reset(CreateSomeWindowResizer(window,
|
| @@ -169,13 +164,12 @@ class DockedWindowLayoutManagerTest
|
| // horizontally to the edge with an added offset from the edge of |dx|.
|
| void DragVerticallyAndRelativeToEdge(DockedEdge edge,
|
| aura::Window* window,
|
| - int dx,
|
| - int dy) {
|
| + int dx, int dy) {
|
| aura::RootWindow* root_window = window->GetRootWindow();
|
| gfx::Rect initial_bounds = window->GetBoundsInScreen();
|
|
|
| if (window_type_ == aura::client::WINDOW_TYPE_PANEL) {
|
| - ASSERT_NO_FATAL_FAILURE(DragStart(window));
|
| + ASSERT_NO_FATAL_FAILURE(DragStartAtOffsetFromwindowOrigin(window, 25, 5));
|
| EXPECT_TRUE(window->GetProperty(kPanelAttachedKey));
|
|
|
| // Drag enough to detach since our tests assume panels to be initially
|
| @@ -197,11 +191,13 @@ class DockedWindowLayoutManagerTest
|
| // avoid snap by clicking away from the border
|
| ASSERT_NO_FATAL_FAILURE(DragStartAtOffsetFromwindowOrigin(window, 25, 5));
|
|
|
| + gfx::Rect work_area =
|
| + Shell::GetScreen()->GetDisplayNearestWindow(window).work_area();
|
| // Drag the window left or right to the edge (or almost to it).
|
| if (edge == DOCKED_EDGE_LEFT)
|
| - dx += window->GetRootWindow()->bounds().x() - initial_bounds.x();
|
| + dx += work_area.x() - initial_location_in_parent_.x();
|
| else if (edge == DOCKED_EDGE_RIGHT)
|
| - dx += window->GetRootWindow()->bounds().right() - initial_bounds.right();
|
| + dx += work_area.right() - 1 - initial_location_in_parent_.x();
|
| DragMove(dx, window_type_ == aura::client::WINDOW_TYPE_PANEL ? 0 : dy);
|
| EXPECT_EQ(CorrectContainerIdDuringDrag(), window->parent()->id());
|
| // Release the mouse and the panel should be attached to the dock.
|
| @@ -209,8 +205,10 @@ class DockedWindowLayoutManagerTest
|
|
|
| // x-coordinate can get adjusted by snapping or sticking.
|
| // y-coordinate could be changed by possible automatic layout if docked.
|
| - if (window->parent()->id() != internal::kShellWindowId_DockedContainer)
|
| + if (window->parent()->id() != internal::kShellWindowId_DockedContainer &&
|
| + GetRestoreBoundsInScreen(window) == NULL) {
|
| EXPECT_EQ(initial_bounds.y() + dy, window->GetBoundsInScreen().y());
|
| + }
|
| }
|
|
|
| private:
|
| @@ -288,7 +286,7 @@ TEST_P(DockedWindowLayoutManagerTest, TwoWindowsDragging) {
|
|
|
| // Drag w2 above w1.
|
| ASSERT_NO_FATAL_FAILURE(DragStartAtOffsetFromwindowOrigin(w2.get(), 0, 20));
|
| - DragMove(0, w1->bounds().y() - w2->bounds().y() - 20);
|
| + DragMove(0, w1->bounds().y() - w2->bounds().y() + 20);
|
| DragEnd();
|
|
|
| // Test the new windows order and that the gaps differ at most by a pixel.
|
|
|