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

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

Issue 477823003: Clear restore bounds for user resize/drag actions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Created 6 years, 4 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
« no previous file with comments | « 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 49af2b7db2fdacb642e845d1394c5f9a37178a8d..9b10e16473f070a8906e3ecefb01fcc062b90c79 100644
--- a/ash/wm/workspace/workspace_window_resizer_unittest.cc
+++ b/ash/wm/workspace/workspace_window_resizer_unittest.cc
@@ -1181,6 +1181,22 @@ TEST_F(WorkspaceWindowResizerTest, CtrlDragResizeToExactPosition) {
EXPECT_EQ("96,112 330x172", window_->bounds().ToString());
}
+// Verifies that a dragged, non-snapped window will clear restore bounds.
+TEST_F(WorkspaceWindowResizerTest, RestoreClearedOnResize) {
+ window_->SetBounds(gfx::Rect(10, 10, 100, 100));
+ wm::WindowState* window_state = wm::GetWindowState(window_.get());
+ window_state->SetRestoreBoundsInScreen(gfx::Rect(50, 50, 50, 50));
+ scoped_ptr<WindowResizer> resizer(CreateResizerForTest(
+ window_.get(), gfx::Point(), HTBOTTOMRIGHT));
+ ASSERT_TRUE(resizer.get());
+ // Drag the window to new position by adding (20, 30) to original point,
+ // the original restore bound should be cleared.
+ resizer->Drag(CalculateDragPoint(*resizer, 20, 30), 0);
+ resizer->CompleteDrag();
+ EXPECT_EQ("10,10 120x130", window_->bounds().ToString());
+ EXPECT_FALSE(window_state->HasRestoreBounds());
+}
+
// Verifies that a dragged window will restore to its pre-maximized size.
TEST_F(WorkspaceWindowResizerTest, RestoreToPreMaximizeCoordinates) {
window_->SetBounds(gfx::Rect(0, 0, 1000, 1000));
« no previous file with comments | « 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