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

Unified Diff: ash/wm/workspace/workspace_window_resizer_unittest.cc

Issue 10918077: Adding proper dragging behavior for L/R maximized windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed. Created 8 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
« ash/wm/window_resizer.cc ('K') | « ash/wm/workspace/workspace_window_resizer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« ash/wm/window_resizer.cc ('K') | « ash/wm/workspace/workspace_window_resizer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698