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 9fae0c950b5ec02b1feb6efb66f0ee286cc665fb..566ffd63a0b49328234b36d77d9f88a8d6654938 100644 |
--- a/ash/wm/workspace/workspace_window_resizer_unittest.cc |
+++ b/ash/wm/workspace/workspace_window_resizer_unittest.cc |
@@ -420,6 +420,38 @@ TEST_F(WorkspaceWindowResizerTest, AttachedResize_BOTTOM_2) { |
EXPECT_EQ("0,250 200x100", window2_->bounds().ToString()); |
} |
+// Tests that resizing a window to maximized bounds (or even close to them with |
+// magnetism) maximizes the window. |
+TEST_F(WorkspaceWindowResizerTest, WindowResizedToMaximizedBoundsIsMaximized) { |
+ window_->SetBounds(gfx::Rect(100, 200, 20, 30)); |
+ window_->SetProperty(aura::client::kCanMaximizeKey, true); |
+ { |
oshima
2014/07/29 17:00:36
can you add comment what this is doing? (resize th
varkha
2014/07/29 22:19:43
Done.
|
+ scoped_ptr<WindowResizer> resizer(CreateResizerForTest( |
+ window_.get(), gfx::Point(), HTTOPLEFT)); |
+ ASSERT_TRUE(resizer.get()); |
+ resizer->Drag(CalculateDragPoint(*resizer, -100 + 2, -200 + 2), 0); |
+ resizer->CompleteDrag(); |
+ } |
+ gfx::Rect maximized_bounds = ScreenUtil::GetMaximizedWindowBoundsInParent( |
+ window_.get()); |
+ { |
+ scoped_ptr<WindowResizer> resizer(CreateResizerForTest( |
oshima
2014/07/29 17:00:36
and here.
varkha
2014/07/29 22:19:43
Done.
|
+ window_.get(), gfx::Point(), HTBOTTOMRIGHT)); |
+ ASSERT_TRUE(resizer.get()); |
+ gfx::Rect bounds = window_->bounds(); |
+ resizer->Drag( |
+ CalculateDragPoint(*resizer, |
+ maximized_bounds.right() - bounds.right() - 2, |
+ maximized_bounds.bottom() - bounds.bottom() - 2), 0); |
+ resizer->CompleteDrag(); |
+ } |
+ EXPECT_EQ(maximized_bounds.ToString(), window_->bounds().ToString()); |
+ wm::WindowState* window_state = wm::GetWindowState(window_.get()); |
+ EXPECT_TRUE(window_state->IsMaximized()); |
+ ASSERT_TRUE(window_state->HasRestoreBounds()); |
+ EXPECT_EQ("0,0 120x230", window_state->GetRestoreBoundsInScreen().ToString()); |
+} |
oshima
2014/07/29 17:00:36
can you also add the case where you create the win
varkha
2014/07/29 22:19:43
Done.
|
+ |
#if defined(OS_WIN) |
// RootWindow and Display can't resize on Windows Ash. http://crbug.com/165962 |
#define MAYBE_AttachedResize_BOTTOM_3 DISABLED_AttachedResize_BOTTOM_3 |