OLD | NEW |
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/ash_constants.h" | 7 #include "ash/ash_constants.h" |
8 #include "ash/ash_switches.h" | 8 #include "ash/ash_switches.h" |
9 #include "ash/display/display_controller.h" | 9 #include "ash/display/display_controller.h" |
10 #include "ash/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
(...skipping 1153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1164 // area. | 1164 // area. |
1165 gfx::Rect rect = resizer->GetTargetBoundsForSize(0); | 1165 gfx::Rect rect = resizer->GetTargetBoundsForSize(0); |
1166 EXPECT_EQ("0,0 720x597", rect.ToString()); | 1166 EXPECT_EQ("0,0 720x597", rect.ToString()); |
1167 rect = resizer->GetTargetBoundsForSize(1); | 1167 rect = resizer->GetTargetBoundsForSize(1); |
1168 EXPECT_EQ("0,0 640x597", rect.ToString()); | 1168 EXPECT_EQ("0,0 640x597", rect.ToString()); |
1169 rect = resizer->GetTargetBoundsForSize(2); | 1169 rect = resizer->GetTargetBoundsForSize(2); |
1170 EXPECT_EQ("0,0 400x597", rect.ToString()); | 1170 EXPECT_EQ("0,0 400x597", rect.ToString()); |
1171 shelf_layout_manager()->SetAutoHideBehavior( | 1171 shelf_layout_manager()->SetAutoHideBehavior( |
1172 SHELF_AUTO_HIDE_BEHAVIOR_NEVER); | 1172 SHELF_AUTO_HIDE_BEHAVIOR_NEVER); |
1173 rect = resizer->GetTargetBoundsForSize(0); | 1173 rect = resizer->GetTargetBoundsForSize(0); |
1174 EXPECT_EQ("0,0 720x552", rect.ToString()); | 1174 EXPECT_EQ("0,0 720x553", rect.ToString()); |
1175 rect = resizer->GetTargetBoundsForSize(1); | 1175 rect = resizer->GetTargetBoundsForSize(1); |
1176 EXPECT_EQ("0,0 640x552", rect.ToString()); | 1176 EXPECT_EQ("0,0 640x553", rect.ToString()); |
1177 rect = resizer->GetTargetBoundsForSize(2); | 1177 rect = resizer->GetTargetBoundsForSize(2); |
1178 EXPECT_EQ("0,0 400x552", rect.ToString()); | 1178 EXPECT_EQ("0,0 400x553", rect.ToString()); |
1179 } | 1179 } |
1180 | 1180 |
1181 // Verifies that a dragged window will restore to its pre-maximized size. | 1181 // Verifies that a dragged window will restore to its pre-maximized size. |
1182 TEST_F(WorkspaceWindowResizerTest, RestoreToPreMaximizeCoordinates) { | 1182 TEST_F(WorkspaceWindowResizerTest, RestoreToPreMaximizeCoordinates) { |
1183 window_->SetBounds(gfx::Rect(0, 0, 1000, 1000)); | 1183 window_->SetBounds(gfx::Rect(0, 0, 1000, 1000)); |
1184 SetRestoreBoundsInScreen(window_.get(), gfx::Rect(96, 112, 320, 160)); | 1184 SetRestoreBoundsInScreen(window_.get(), gfx::Rect(96, 112, 320, 160)); |
1185 scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create( | 1185 scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create( |
1186 window_.get(), gfx::Point(), HTCAPTION, | 1186 window_.get(), gfx::Point(), HTCAPTION, |
1187 aura::client::WINDOW_MOVE_SOURCE_MOUSE, empty_windows())); | 1187 aura::client::WINDOW_MOVE_SOURCE_MOUSE, empty_windows())); |
1188 ASSERT_TRUE(resizer.get()); | 1188 ASSERT_TRUE(resizer.get()); |
(...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1969 RunAnimationTillComplete(phantom_controller->animation_.get()); | 1969 RunAnimationTillComplete(phantom_controller->animation_.get()); |
1970 | 1970 |
1971 // Hide phantom controller. Both widgets should close. | 1971 // Hide phantom controller. Both widgets should close. |
1972 phantom_controller->Hide(); | 1972 phantom_controller->Hide(); |
1973 EXPECT_FALSE(phantom_controller->phantom_widget_); | 1973 EXPECT_FALSE(phantom_controller->phantom_widget_); |
1974 EXPECT_FALSE(phantom_controller->phantom_widget_start_); | 1974 EXPECT_FALSE(phantom_controller->phantom_widget_start_); |
1975 } | 1975 } |
1976 | 1976 |
1977 } // namespace internal | 1977 } // namespace internal |
1978 } // namespace ash | 1978 } // namespace ash |
OLD | NEW |