| 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/common/wm/dock/docked_window_layout_manager.h" | 5 #include "ash/common/wm/dock/docked_window_layout_manager.h" |
| 6 | 6 |
| 7 #include "ash/common/ash_switches.h" | 7 #include "ash/common/ash_switches.h" |
| 8 #include "ash/common/shelf/wm_shelf.h" | 8 #include "ash/common/shelf/wm_shelf.h" |
| 9 #include "ash/common/test/test_shelf_delegate.h" | 9 #include "ash/common/test/test_shelf_delegate.h" |
| 10 #include "ash/common/wm/panels/panel_layout_manager.h" | 10 #include "ash/common/wm/panels/panel_layout_manager.h" |
| (...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 676 w3->GetBoundsInScreen().right()); | 676 w3->GetBoundsInScreen().right()); |
| 677 EXPECT_EQ(kShellWindowId_DockedContainer, w3->parent()->id()); | 677 EXPECT_EQ(kShellWindowId_DockedContainer, w3->parent()->id()); |
| 678 | 678 |
| 679 // The first window should get hidden but parented by the dock container. | 679 // The first window should get hidden but parented by the dock container. |
| 680 EXPECT_TRUE(wm::GetWindowState(w1.get())->IsMinimized()); | 680 EXPECT_TRUE(wm::GetWindowState(w1.get())->IsMinimized()); |
| 681 EXPECT_TRUE(wm::GetWindowState(w1.get())->IsDocked()); | 681 EXPECT_TRUE(wm::GetWindowState(w1.get())->IsDocked()); |
| 682 EXPECT_FALSE(w1->IsVisible()); | 682 EXPECT_FALSE(w1->IsVisible()); |
| 683 EXPECT_EQ(ui::SHOW_STATE_MINIMIZED, | 683 EXPECT_EQ(ui::SHOW_STATE_MINIMIZED, |
| 684 w1->GetProperty(aura::client::kShowStateKey)); | 684 w1->GetProperty(aura::client::kShowStateKey)); |
| 685 EXPECT_EQ(ui::SHOW_STATE_DOCKED, | 685 EXPECT_EQ(ui::SHOW_STATE_DOCKED, |
| 686 w1->GetProperty(aura::client::kRestoreShowStateKey)); | 686 w1->GetProperty(aura::client::kPreMinimizedShowStateKey)); |
| 687 // The other two windows should be still docked. | 687 // The other two windows should be still docked. |
| 688 EXPECT_FALSE(wm::GetWindowState(w2.get())->IsMinimized()); | 688 EXPECT_FALSE(wm::GetWindowState(w2.get())->IsMinimized()); |
| 689 EXPECT_TRUE(wm::GetWindowState(w2.get())->IsDocked()); | 689 EXPECT_TRUE(wm::GetWindowState(w2.get())->IsDocked()); |
| 690 EXPECT_FALSE(wm::GetWindowState(w3.get())->IsMinimized()); | 690 EXPECT_FALSE(wm::GetWindowState(w3.get())->IsMinimized()); |
| 691 EXPECT_TRUE(wm::GetWindowState(w3.get())->IsDocked()); | 691 EXPECT_TRUE(wm::GetWindowState(w3.get())->IsDocked()); |
| 692 EXPECT_EQ(kShellWindowId_DockedContainer, w1->parent()->id()); | 692 EXPECT_EQ(kShellWindowId_DockedContainer, w1->parent()->id()); |
| 693 } | 693 } |
| 694 | 694 |
| 695 // Docks up to three windows and tests that they split vertical space. | 695 // Docks up to three windows and tests that they split vertical space. |
| 696 TEST_P(DockedWindowLayoutManagerTest, ThreeWindowsSplitHeightEvenly) { | 696 TEST_P(DockedWindowLayoutManagerTest, ThreeWindowsSplitHeightEvenly) { |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 802 EXPECT_EQ(work_area.height(), window->GetBoundsInScreen().height()); | 802 EXPECT_EQ(work_area.height(), window->GetBoundsInScreen().height()); |
| 803 } | 803 } |
| 804 | 804 |
| 805 // Tests run twice - on both panels and normal windows | 805 // Tests run twice - on both panels and normal windows |
| 806 INSTANTIATE_TEST_CASE_P(NormalOrPanel, | 806 INSTANTIATE_TEST_CASE_P(NormalOrPanel, |
| 807 DockedWindowLayoutManagerTest, | 807 DockedWindowLayoutManagerTest, |
| 808 testing::Values(ui::wm::WINDOW_TYPE_NORMAL, | 808 testing::Values(ui::wm::WINDOW_TYPE_NORMAL, |
| 809 ui::wm::WINDOW_TYPE_PANEL)); | 809 ui::wm::WINDOW_TYPE_PANEL)); |
| 810 | 810 |
| 811 } // namespace ash | 811 } // namespace ash |
| OLD | NEW |