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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 EXPECT_EQ("100,300 300x300", window_->bounds().ToString()); | 206 EXPECT_EQ("100,300 300x300", window_->bounds().ToString()); |
207 EXPECT_EQ("400,300 150x200", window2_->bounds().ToString()); | 207 EXPECT_EQ("400,300 150x200", window2_->bounds().ToString()); |
208 EXPECT_EQ("550,300 100x200", window3_->bounds().ToString()); | 208 EXPECT_EQ("550,300 100x200", window3_->bounds().ToString()); |
209 | 209 |
210 // Move it 296, which should now snap to grid and things should compress. | 210 // Move it 296, which should now snap to grid and things should compress. |
211 resizer->Drag(CalculateDragPoint(*resizer, 296, -10)); | 211 resizer->Drag(CalculateDragPoint(*resizer, 296, -10)); |
212 EXPECT_EQ("100,300 500x300", window_->bounds().ToString()); | 212 EXPECT_EQ("100,300 500x300", window_->bounds().ToString()); |
213 EXPECT_EQ("600,300 120x200", window2_->bounds().ToString()); | 213 EXPECT_EQ("600,300 120x200", window2_->bounds().ToString()); |
214 EXPECT_EQ("720,300 80x200", window3_->bounds().ToString()); | 214 EXPECT_EQ("720,300 80x200", window3_->bounds().ToString()); |
215 | 215 |
216 // Move it so much everything ends up at it's min. | 216 // Move it so much everything ends up at its min. |
217 resizer->Drag(CalculateDragPoint(*resizer, 798, 50)); | 217 resizer->Drag(CalculateDragPoint(*resizer, 798, 50)); |
218 EXPECT_EQ("100,300 600x300", window_->bounds().ToString()); | 218 EXPECT_EQ("100,300 600x300", window_->bounds().ToString()); |
219 EXPECT_EQ("700,300 60x200", window2_->bounds().ToString()); | 219 EXPECT_EQ("700,300 60x200", window2_->bounds().ToString()); |
220 EXPECT_EQ("760,300 40x200", window3_->bounds().ToString()); | 220 EXPECT_EQ("760,300 40x200", window3_->bounds().ToString()); |
221 | 221 |
222 // Revert and make sure everything moves back. | 222 // Revert and make sure everything moves back. |
223 resizer->RevertDrag(); | 223 resizer->RevertDrag(); |
224 EXPECT_EQ("100,300 200x300", window_->bounds().ToString()); | 224 EXPECT_EQ("100,300 200x300", window_->bounds().ToString()); |
225 EXPECT_EQ("300,300 150x200", window2_->bounds().ToString()); | 225 EXPECT_EQ("300,300 150x200", window2_->bounds().ToString()); |
226 EXPECT_EQ("450,300 100x200", window3_->bounds().ToString()); | 226 EXPECT_EQ("450,300 100x200", window3_->bounds().ToString()); |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 EXPECT_EQ("300,100 300x300", window_->bounds().ToString()); | 350 EXPECT_EQ("300,100 300x300", window_->bounds().ToString()); |
351 EXPECT_EQ("300,400 200x150", window2_->bounds().ToString()); | 351 EXPECT_EQ("300,400 200x150", window2_->bounds().ToString()); |
352 EXPECT_EQ("300,550 200x100", window3_->bounds().ToString()); | 352 EXPECT_EQ("300,550 200x100", window3_->bounds().ToString()); |
353 | 353 |
354 // Move it 296, which should now snap to grid and things should compress. | 354 // Move it 296, which should now snap to grid and things should compress. |
355 resizer->Drag(CalculateDragPoint(*resizer, -10, 296)); | 355 resizer->Drag(CalculateDragPoint(*resizer, -10, 296)); |
356 EXPECT_EQ("300,100 300x500", window_->bounds().ToString()); | 356 EXPECT_EQ("300,100 300x500", window_->bounds().ToString()); |
357 EXPECT_EQ("300,600 200x120", window2_->bounds().ToString()); | 357 EXPECT_EQ("300,600 200x120", window2_->bounds().ToString()); |
358 EXPECT_EQ("300,720 200x80", window3_->bounds().ToString()); | 358 EXPECT_EQ("300,720 200x80", window3_->bounds().ToString()); |
359 | 359 |
360 // Move it so much everything ends up at it's min. | 360 // Move it so much everything ends up at its min. |
361 resizer->Drag(CalculateDragPoint(*resizer, 50, 798)); | 361 resizer->Drag(CalculateDragPoint(*resizer, 50, 798)); |
362 EXPECT_EQ("300,100 300x600", window_->bounds().ToString()); | 362 EXPECT_EQ("300,100 300x600", window_->bounds().ToString()); |
363 EXPECT_EQ("300,700 200x60", window2_->bounds().ToString()); | 363 EXPECT_EQ("300,700 200x60", window2_->bounds().ToString()); |
364 EXPECT_EQ("300,760 200x40", window3_->bounds().ToString()); | 364 EXPECT_EQ("300,760 200x40", window3_->bounds().ToString()); |
365 | 365 |
366 // Revert and make sure everything moves back. | 366 // Revert and make sure everything moves back. |
367 resizer->RevertDrag(); | 367 resizer->RevertDrag(); |
368 EXPECT_EQ("300,100 300x200", window_->bounds().ToString()); | 368 EXPECT_EQ("300,100 300x200", window_->bounds().ToString()); |
369 EXPECT_EQ("300,300 200x150", window2_->bounds().ToString()); | 369 EXPECT_EQ("300,300 200x150", window2_->bounds().ToString()); |
370 EXPECT_EQ("300,450 200x100", window3_->bounds().ToString()); | 370 EXPECT_EQ("300,450 200x100", window3_->bounds().ToString()); |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create( | 487 scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create( |
488 window_.get(), gfx::Point(), HTCAPTION, 0, empty_windows())); | 488 window_.get(), gfx::Point(), HTCAPTION, 0, empty_windows())); |
489 ASSERT_TRUE(resizer.get()); | 489 ASSERT_TRUE(resizer.get()); |
490 resizer->Drag(CalculateDragPoint(*resizer, 0, -600)); | 490 resizer->Drag(CalculateDragPoint(*resizer, 0, -600)); |
491 EXPECT_EQ("100,10 300x400", window_->bounds().ToString()); | 491 EXPECT_EQ("100,10 300x400", window_->bounds().ToString()); |
492 } | 492 } |
493 | 493 |
494 } // namespace | 494 } // namespace |
495 } // namespace test | 495 } // namespace test |
496 } // namespace ash | 496 } // namespace ash |
OLD | NEW |