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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/wm/workspace/workspace_window_resizer.h" 5 #include "ash/wm/workspace/workspace_window_resizer.h"
6 6
7 #include "ash/display/mouse_cursor_event_filter.h" 7 #include "ash/display/mouse_cursor_event_filter.h"
8 #include "ash/screen_ash.h" 8 #include "ash/screen_ash.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/shell_window_ids.h" 10 #include "ash/shell_window_ids.h"
(...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create( 897 scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create(
898 window_.get(), gfx::Point(), HTCAPTION, empty_windows())); 898 window_.get(), gfx::Point(), HTCAPTION, empty_windows()));
899 ASSERT_TRUE(resizer.get()); 899 ASSERT_TRUE(resizer.get());
900 // Ctrl + drag the window to new poistion by adding (10, 12) to its origin, 900 // Ctrl + drag the window to new poistion by adding (10, 12) to its origin,
901 // the window should move to the exact position. 901 // the window should move to the exact position.
902 resizer->Drag(CalculateDragPoint(*resizer, 10, 12), 0); 902 resizer->Drag(CalculateDragPoint(*resizer, 10, 12), 0);
903 resizer->CompleteDrag(ui::EF_CONTROL_DOWN); 903 resizer->CompleteDrag(ui::EF_CONTROL_DOWN);
904 EXPECT_EQ("106,124 320x160", window_->bounds().ToString()); 904 EXPECT_EQ("106,124 320x160", window_->bounds().ToString());
905 } 905 }
906 906
907 // Verifies that a dragged window will restore to its pre-maximized size.
908 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.
909 window_->SetBounds(gfx::Rect(0, 0, 1000, 1000));
910 SetRestoreBoundsInScreen(window_.get(), gfx::Rect(96, 112, 320, 160));
911 scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create(
912 window_.get(), gfx::Point(), HTCAPTION, empty_windows()));
913 SetGridSize(1);
914 ASSERT_TRUE(resizer.get());
915 // Drag the window to new poistion by adding (180, 12) to original point,
916 // the window should get restored and centered around cursor.
917 resizer->Drag(CalculateDragPoint(*resizer, 180, 12), 0);
918 resizer->CompleteDrag(0);
919 EXPECT_EQ("20,16 320x160", window_->bounds().ToString());
920 // The restore rectangle should get cleared as well.
921 EXPECT_EQ(NULL, GetRestoreBoundsInScreen(window_.get()));
922 }
923
907 } // namespace internal 924 } // namespace internal
908 } // namespace ash 925 } // namespace ash
OLDNEW
« 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