| 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 "chrome/browser/ui/window_sizer/window_sizer_common_unittest.h" | 5 #include "chrome/browser/ui/window_sizer/window_sizer_common_unittest.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/test/ash_test_base.h" | 8 #include "ash/test/ash_test_base.h" |
| 9 #include "ash/test/test_shell_delegate.h" | 9 #include "ash/test/test_shell_delegate.h" |
| 10 #include "ash/wm/window_resizer.h" | 10 #include "ash/wm/window_resizer.h" |
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 scoped_ptr<Browser> panel_owning_browser(new Browser(panel_params)); | 488 scoped_ptr<Browser> panel_owning_browser(new Browser(panel_params)); |
| 489 | 489 |
| 490 window->Show(); | 490 window->Show(); |
| 491 { // With a shown window it's size should get returned. | 491 { // With a shown window it's size should get returned. |
| 492 gfx::Rect window_bounds; | 492 gfx::Rect window_bounds; |
| 493 GetWindowBounds(tentwentyfour, tentwentyfour, gfx::Rect(), | 493 GetWindowBounds(tentwentyfour, tentwentyfour, gfx::Rect(), |
| 494 gfx::Rect(50, 100, 300, 150), bottom_nonprimary, | 494 gfx::Rect(50, 100, 300, 150), bottom_nonprimary, |
| 495 PERSISTED, browser.get(), gfx::Rect(), &window_bounds); | 495 PERSISTED, browser.get(), gfx::Rect(), &window_bounds); |
| 496 // The position should be right flush. | 496 // The position should be right flush. |
| 497 EXPECT_EQ("384,32 640x320", window_bounds.ToString()); | 497 EXPECT_EQ("384,32 640x320", window_bounds.ToString()); |
| 498 // In addition the other window should have moved left flush. |
| 499 EXPECT_EQ("0,32 640x320", window->bounds().ToString()); |
| 498 } | 500 } |
| 499 | 501 |
| 500 { // With the window shown - but more on the right side then on the left | 502 { // With the window shown - but more on the right side then on the left |
| 501 // side (and partially out of the screen), it should default to the other | 503 // side (and partially out of the screen), it should default to the other |
| 502 // side and inside the screen. | 504 // side and inside the screen. |
| 503 window->SetBounds(gfx::Rect(350, 600, 640, 320)); | 505 window->SetBounds(gfx::Rect(350, 600, 640, 320)); |
| 504 gfx::Rect window_bounds; | 506 gfx::Rect window_bounds; |
| 505 GetWindowBounds(tentwentyfour, tentwentyfour, gfx::Rect(), | 507 GetWindowBounds(tentwentyfour, tentwentyfour, gfx::Rect(), |
| 506 gfx::Rect(50, 100, 300, 150), bottom_nonprimary, | 508 gfx::Rect(50, 100, 300, 150), bottom_nonprimary, |
| 507 PERSISTED, browser.get(), gfx::Rect(), &window_bounds); | 509 PERSISTED, browser.get(), gfx::Rect(), &window_bounds); |
| 508 // The position should be left & bottom flush. | 510 // The position should be left & bottom flush. |
| 509 EXPECT_EQ("0,448 640x320", window_bounds.ToString()); | 511 EXPECT_EQ("0,448 640x320", window_bounds.ToString()); |
| 512 // In addition the other window should have moved right flush. |
| 513 EXPECT_EQ("384,600 640x320", window->bounds().ToString()); |
| 510 } | 514 } |
| 511 | 515 |
| 512 { // If the second windows right side is already over the right side of the | 516 { // If the second windows right side is already over the right side of the |
| 513 // screen, it will not move back into the screen. | 517 // screen, it will not move back into the screen. |
| 514 window->SetBounds(gfx::Rect(1000, 600, 640, 320)); | 518 window->SetBounds(gfx::Rect(1000, 600, 640, 320)); |
| 515 gfx::Rect window_bounds; | 519 gfx::Rect window_bounds; |
| 516 GetWindowBounds(tentwentyfour, tentwentyfour, gfx::Rect(), | 520 GetWindowBounds(tentwentyfour, tentwentyfour, gfx::Rect(), |
| 517 gfx::Rect(50, 100, 300, 150), bottom_nonprimary, | 521 gfx::Rect(50, 100, 300, 150), bottom_nonprimary, |
| 518 PERSISTED, browser.get(), gfx::Rect(), &window_bounds); | 522 PERSISTED, browser.get(), gfx::Rect(), &window_bounds); |
| 519 // The position should be left & bottom flush. | 523 // The position should be left & bottom flush. |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 690 ui::SHOW_STATE_NORMAL, | 694 ui::SHOW_STATE_NORMAL, |
| 691 BOTH, | 695 BOTH, |
| 692 browser.get()), ui::SHOW_STATE_MAXIMIZED); | 696 browser.get()), ui::SHOW_STATE_MAXIMIZED); |
| 693 | 697 |
| 694 // The popup should favor the initial show state over the command line. | 698 // The popup should favor the initial show state over the command line. |
| 695 EXPECT_EQ(GetWindowShowState(ui::SHOW_STATE_NORMAL, | 699 EXPECT_EQ(GetWindowShowState(ui::SHOW_STATE_NORMAL, |
| 696 ui::SHOW_STATE_NORMAL, | 700 ui::SHOW_STATE_NORMAL, |
| 697 BOTH, | 701 BOTH, |
| 698 popup_browser.get()), ui::SHOW_STATE_NORMAL); | 702 popup_browser.get()), ui::SHOW_STATE_NORMAL); |
| 699 } | 703 } |
| OLD | NEW |