Index: ash/wm/workspace/workspace_window_resizer_unittest.cc |
diff --git a/ash/wm/workspace/workspace_window_resizer_unittest.cc b/ash/wm/workspace/workspace_window_resizer_unittest.cc |
index c831d12e11bbb38e4e9a8d5f75a4d2f5cf4098e0..ea631fbb4e1ac87d458536f94e6ab4f7afd61a4b 100644 |
--- a/ash/wm/workspace/workspace_window_resizer_unittest.cc |
+++ b/ash/wm/workspace/workspace_window_resizer_unittest.cc |
@@ -904,5 +904,22 @@ TEST_F(WorkspaceWindowResizerTest, CtrlCompleteDragMoveToExactPosition) { |
EXPECT_EQ("106,124 320x160", window_->bounds().ToString()); |
} |
+// Verifies that a dragged window will restore to its pre-maximized size. |
+TEST_F(WorkspaceWindowResizerTest, RestoreToPreMaximizeCoordinates) { |
sky
2012/09/07 02:43:30
Add coverage of the revert case
Mr4D (OOO till 08-26)
2012/09/08 01:17:41
Done.
|
+ window_->SetBounds(gfx::Rect(0, 0, 1000, 1000)); |
+ SetRestoreBoundsInScreen(window_.get(), gfx::Rect(96, 112, 320, 160)); |
+ scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create( |
+ window_.get(), gfx::Point(), HTCAPTION, empty_windows())); |
+ SetGridSize(1); |
+ ASSERT_TRUE(resizer.get()); |
+ // Drag the window to new poistion by adding (180, 12) to original point, |
+ // the window should get restored and centered around cursor. |
+ resizer->Drag(CalculateDragPoint(*resizer, 180, 12), 0); |
+ resizer->CompleteDrag(0); |
+ EXPECT_EQ("20,16 320x160", window_->bounds().ToString()); |
+ // The restore rectangle should get cleared as well. |
+ EXPECT_EQ(NULL, GetRestoreBoundsInScreen(window_.get())); |
+} |
+ |
} // namespace internal |
} // namespace ash |