OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/dock/docked_window_layout_manager.h" | 5 #include "ash/wm/dock/docked_window_layout_manager.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
9 #include "ash/shelf/shelf.h" | 9 #include "ash/shelf/shelf.h" |
10 #include "ash/shelf/shelf_layout_manager.h" | 10 #include "ash/shelf/shelf_layout_manager.h" |
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
703 // The last two windows should be attached and snapped to the right edge. | 703 // The last two windows should be attached and snapped to the right edge. |
704 EXPECT_EQ(w2->GetRootWindow()->bounds().right(), | 704 EXPECT_EQ(w2->GetRootWindow()->bounds().right(), |
705 w2->GetBoundsInScreen().right()); | 705 w2->GetBoundsInScreen().right()); |
706 EXPECT_EQ(internal::kShellWindowId_DockedContainer, w2->parent()->id()); | 706 EXPECT_EQ(internal::kShellWindowId_DockedContainer, w2->parent()->id()); |
707 EXPECT_EQ(w3->GetRootWindow()->bounds().right(), | 707 EXPECT_EQ(w3->GetRootWindow()->bounds().right(), |
708 w3->GetBoundsInScreen().right()); | 708 w3->GetBoundsInScreen().right()); |
709 EXPECT_EQ(internal::kShellWindowId_DockedContainer, w3->parent()->id()); | 709 EXPECT_EQ(internal::kShellWindowId_DockedContainer, w3->parent()->id()); |
710 | 710 |
711 // The first window should get minimized but parented by the dock container. | 711 // The first window should get minimized but parented by the dock container. |
712 EXPECT_TRUE(wm::GetWindowState(w1.get())->IsMinimized()); | 712 EXPECT_TRUE(wm::GetWindowState(w1.get())->IsMinimized()); |
713 EXPECT_TRUE(wm::GetWindowState(w2.get())->IsNormalShowState()); | 713 EXPECT_TRUE(wm::GetWindowState(w2.get())->IsNormalShowType()); |
714 EXPECT_TRUE(wm::GetWindowState(w3.get())->IsNormalShowState()); | 714 EXPECT_TRUE(wm::GetWindowState(w3.get())->IsNormalShowType()); |
715 EXPECT_EQ(internal::kShellWindowId_DockedContainer, w1->parent()->id()); | 715 EXPECT_EQ(internal::kShellWindowId_DockedContainer, w1->parent()->id()); |
716 } | 716 } |
717 | 717 |
718 // Docks up to three windows and tests that they split vertical space. | 718 // Docks up to three windows and tests that they split vertical space. |
719 TEST_P(DockedWindowLayoutManagerTest, ThreeWindowsSplitHeightEvenly) { | 719 TEST_P(DockedWindowLayoutManagerTest, ThreeWindowsSplitHeightEvenly) { |
720 if (!SupportsHostWindowResize()) | 720 if (!SupportsHostWindowResize()) |
721 return; | 721 return; |
722 | 722 |
723 UpdateDisplay("600x1000"); | 723 UpdateDisplay("600x1000"); |
724 scoped_ptr<aura::Window> w1(CreateTestWindow(gfx::Rect(0, 0, 201, 201))); | 724 scoped_ptr<aura::Window> w1(CreateTestWindow(gfx::Rect(0, 0, 201, 201))); |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
831 EXPECT_EQ(work_area.height(), window->GetBoundsInScreen().height()); | 831 EXPECT_EQ(work_area.height(), window->GetBoundsInScreen().height()); |
832 } | 832 } |
833 | 833 |
834 // Tests run twice - on both panels and normal windows | 834 // Tests run twice - on both panels and normal windows |
835 INSTANTIATE_TEST_CASE_P(NormalOrPanel, | 835 INSTANTIATE_TEST_CASE_P(NormalOrPanel, |
836 DockedWindowLayoutManagerTest, | 836 DockedWindowLayoutManagerTest, |
837 testing::Values(ui::wm::WINDOW_TYPE_NORMAL, | 837 testing::Values(ui::wm::WINDOW_TYPE_NORMAL, |
838 ui::wm::WINDOW_TYPE_PANEL)); | 838 ui::wm::WINDOW_TYPE_PANEL)); |
839 } // namespace internal | 839 } // namespace internal |
840 } // namespace ash | 840 } // namespace ash |
OLD | NEW |