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 8459c54ef5f722b477b46a49b884fafba5f265f5..e10ed2fe0946ab50c44773ecec62495835d69c1a 100644 |
--- a/ash/wm/workspace/workspace_window_resizer_unittest.cc |
+++ b/ash/wm/workspace/workspace_window_resizer_unittest.cc |
@@ -545,13 +545,19 @@ TEST_F(WorkspaceWindowResizerTest, Edge) { |
ScreenAsh::GetDisplayWorkAreaBoundsInParent(window_.get()).bottom(); |
window_->SetBounds(gfx::Rect(20, 30, 50, 60)); |
{ |
+ // Construct a SnapSizer to get the expected bounds when snapped left. |
+ internal::SnapSizer sizer(window_.get(), |
+ gfx::Point(), |
+ internal::SnapSizer::LEFT_EDGE, |
+ internal::SnapSizer::STEP_NO); |
+ |
scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create( |
window_.get(), gfx::Point(), HTCAPTION, |
aura::client::WINDOW_MOVE_SOURCE_MOUSE, empty_windows())); |
ASSERT_TRUE(resizer.get()); |
resizer->Drag(CalculateDragPoint(*resizer, 0, 10), 0); |
resizer->CompleteDrag(0); |
- EXPECT_EQ("0,0 720x" + base::IntToString(bottom), |
+ EXPECT_EQ(sizer.target_bounds().ToString(), |
window_->bounds().ToString()); |
ASSERT_TRUE(GetRestoreBoundsInScreen(window_.get())); |
EXPECT_EQ("20,30 50x60", |
@@ -559,13 +565,19 @@ TEST_F(WorkspaceWindowResizerTest, Edge) { |
} |
// Try the same with the right side. |
{ |
+ // Construct a SnapSizer to get the expected bounds when snapped right. |
+ internal::SnapSizer sizer(window_.get(), |
+ gfx::Point(), |
+ internal::SnapSizer::RIGHT_EDGE, |
+ internal::SnapSizer::STEP_NO); |
+ |
scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create( |
window_.get(), gfx::Point(), HTCAPTION, |
aura::client::WINDOW_MOVE_SOURCE_MOUSE, empty_windows())); |
ASSERT_TRUE(resizer.get()); |
resizer->Drag(CalculateDragPoint(*resizer, 800, 10), 0); |
resizer->CompleteDrag(0); |
- EXPECT_EQ("80,0 720x" + base::IntToString(bottom), |
+ EXPECT_EQ(sizer.target_bounds().ToString(), |
window_->bounds().ToString()); |
ASSERT_TRUE(GetRestoreBoundsInScreen(window_.get())); |
EXPECT_EQ("20,30 50x60", |
@@ -1141,43 +1153,6 @@ TEST_F(WorkspaceWindowResizerTest, CtrlCompleteDragMoveToExactPosition) { |
EXPECT_EQ("106,124 320x160", window_->bounds().ToString()); |
} |
-// Check that only usable sizes get returned by the resizer. |
-TEST_F(WorkspaceWindowResizerTest, TestProperSizerResolutions) { |
- // Check that we have the correct work area resolution which fits our |
- // expected test result. |
- gfx::Rect work_area(ScreenAsh::GetDisplayWorkAreaBoundsInParent( |
- window_.get())); |
- EXPECT_EQ(800, work_area.width()); |
- |
- window_->SetBounds(gfx::Rect(96, 112, 320, 160)); |
- scoped_ptr<SnapSizer> resizer(new SnapSizer( |
- window_.get(), |
- gfx::Point(), |
- SnapSizer::LEFT_EDGE, |
- SnapSizer::OTHER_INPUT)); |
- ASSERT_TRUE(resizer.get()); |
- shelf_layout_manager()->SetAutoHideBehavior( |
- SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); |
- |
- // Check that the list is declining and contains elements of the |
- // ideal size list [1280, 1024, 768, 640] as well as 50% and 90% the work |
- // area. |
- gfx::Rect rect = resizer->GetTargetBoundsForSize(0); |
- EXPECT_EQ("0,0 720x597", rect.ToString()); |
- rect = resizer->GetTargetBoundsForSize(1); |
- EXPECT_EQ("0,0 640x597", rect.ToString()); |
- rect = resizer->GetTargetBoundsForSize(2); |
- EXPECT_EQ("0,0 400x597", rect.ToString()); |
- shelf_layout_manager()->SetAutoHideBehavior( |
- SHELF_AUTO_HIDE_BEHAVIOR_NEVER); |
- rect = resizer->GetTargetBoundsForSize(0); |
- EXPECT_EQ("0,0 720x552", rect.ToString()); |
- rect = resizer->GetTargetBoundsForSize(1); |
- EXPECT_EQ("0,0 640x552", rect.ToString()); |
- rect = resizer->GetTargetBoundsForSize(2); |
- EXPECT_EQ("0,0 400x552", rect.ToString()); |
-} |
- |
// Verifies that a dragged window will restore to its pre-maximized size. |
TEST_F(WorkspaceWindowResizerTest, RestoreToPreMaximizeCoordinates) { |
window_->SetBounds(gfx::Rect(0, 0, 1000, 1000)); |