| 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/screen_ash.h" | 7 #include "ash/screen_ash.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/test/ash_test_base.h" | 9 #include "ash/test/ash_test_base.h" |
| 10 #include "ash/wm/property_util.h" | 10 #include "ash/wm/property_util.h" |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 // 100 up again. | 424 // 100 up again. |
| 425 resizer->Drag(CalculateDragPoint(*resizer, -10, -100), 0); | 425 resizer->Drag(CalculateDragPoint(*resizer, -10, -100), 0); |
| 426 EXPECT_EQ("0,0 200x100", window_->bounds().ToString()); | 426 EXPECT_EQ("0,0 200x100", window_->bounds().ToString()); |
| 427 EXPECT_EQ("10,100 200x270", window2_->bounds().ToString()); | 427 EXPECT_EQ("10,100 200x270", window2_->bounds().ToString()); |
| 428 EXPECT_EQ("20,370 100x130", window3_->bounds().ToString()); | 428 EXPECT_EQ("20,370 100x130", window3_->bounds().ToString()); |
| 429 } | 429 } |
| 430 | 430 |
| 431 // Assertions around dragging to the left/right edge of the screen. | 431 // Assertions around dragging to the left/right edge of the screen. |
| 432 TEST_F(WorkspaceWindowResizerTest, Edge) { | 432 TEST_F(WorkspaceWindowResizerTest, Edge) { |
| 433 int bottom = | 433 int bottom = |
| 434 ScreenAsh::GetUnmaximizedWorkAreaParentBounds(window_.get()).bottom(); | 434 ScreenAsh::GetUnmaximizedWorkAreaBoundsInParent(window_.get()).bottom(); |
| 435 window_->SetBounds(gfx::Rect(20, 30, 50, 60)); | 435 window_->SetBounds(gfx::Rect(20, 30, 50, 60)); |
| 436 { | 436 { |
| 437 SetGridSize(0); | 437 SetGridSize(0); |
| 438 scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create( | 438 scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create( |
| 439 window_.get(), gfx::Point(), HTCAPTION, empty_windows())); | 439 window_.get(), gfx::Point(), HTCAPTION, empty_windows())); |
| 440 ASSERT_TRUE(resizer.get()); | 440 ASSERT_TRUE(resizer.get()); |
| 441 resizer->Drag(CalculateDragPoint(*resizer, 0, 10), 0); | 441 resizer->Drag(CalculateDragPoint(*resizer, 0, 10), 0); |
| 442 resizer->CompleteDrag(0); | 442 resizer->CompleteDrag(0); |
| 443 EXPECT_EQ("0,0 400x" + base::IntToString(bottom), | 443 EXPECT_EQ("0,0 400x" + base::IntToString(bottom), |
| 444 window_->bounds().ToString()); | 444 window_->bounds().ToString()); |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 resizer->Drag(CalculateDragPoint(*resizer, 10, 12), 0); | 654 resizer->Drag(CalculateDragPoint(*resizer, 10, 12), 0); |
| 655 resizer->CompleteDrag(ui::EF_CONTROL_DOWN); | 655 resizer->CompleteDrag(ui::EF_CONTROL_DOWN); |
| 656 EXPECT_EQ("106,124 320x160", window_->bounds().ToString()); | 656 EXPECT_EQ("106,124 320x160", window_->bounds().ToString()); |
| 657 } | 657 } |
| 658 | 658 |
| 659 #endif | 659 #endif |
| 660 | 660 |
| 661 } // namespace | 661 } // namespace |
| 662 } // namespace test | 662 } // namespace test |
| 663 } // namespace ash | 663 } // namespace ash |
| OLD | NEW |