| 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/aura/wm_window_aura.h" | 7 #include "ash/aura/wm_window_aura.h" |
| 8 #include "ash/common/shelf/wm_shelf.h" | 8 #include "ash/common/shelf/wm_shelf.h" |
| 9 #include "ash/common/shell_window_ids.h" | 9 #include "ash/common/shell_window_ids.h" |
| 10 #include "ash/common/wm/panels/panel_layout_manager.h" | 10 #include "ash/common/wm/panels/panel_layout_manager.h" |
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 // Adds three windows in bottom display and tests layout after a drag. | 509 // Adds three windows in bottom display and tests layout after a drag. |
| 510 TEST_P(DockedWindowLayoutManagerTest, ThreeWindowsDraggingSecondScreen) { | 510 TEST_P(DockedWindowLayoutManagerTest, ThreeWindowsDraggingSecondScreen) { |
| 511 if (!SupportsMultipleDisplays()) | 511 if (!SupportsMultipleDisplays()) |
| 512 return; | 512 return; |
| 513 | 513 |
| 514 // Create two screen vertical layout. | 514 // Create two screen vertical layout. |
| 515 UpdateDisplay("600x1000,600x1000"); | 515 UpdateDisplay("600x1000,600x1000"); |
| 516 // Layout the secondary display to the bottom of the primary. | 516 // Layout the secondary display to the bottom of the primary. |
| 517 ASSERT_GT(display::Screen::GetScreen()->GetNumDisplays(), 1); | 517 ASSERT_GT(display::Screen::GetScreen()->GetNumDisplays(), 1); |
| 518 Shell::GetInstance()->display_manager()->SetLayoutForCurrentDisplays( | 518 Shell::GetInstance()->display_manager()->SetLayoutForCurrentDisplays( |
| 519 test::CreateDisplayLayout(display::DisplayPlacement::BOTTOM, 0)); | 519 test::CreateDisplayLayout(display_manager(), |
| 520 display::DisplayPlacement::BOTTOM, 0)); |
| 520 | 521 |
| 521 std::unique_ptr<aura::Window> w1( | 522 std::unique_ptr<aura::Window> w1( |
| 522 CreateTestWindow(gfx::Rect(0, 1000, 201, 310))); | 523 CreateTestWindow(gfx::Rect(0, 1000, 201, 310))); |
| 523 DragToVerticalPositionAndToEdge(DOCKED_EDGE_RIGHT, w1.get(), 1000 + 20); | 524 DragToVerticalPositionAndToEdge(DOCKED_EDGE_RIGHT, w1.get(), 1000 + 20); |
| 524 std::unique_ptr<aura::Window> w2( | 525 std::unique_ptr<aura::Window> w2( |
| 525 CreateTestWindow(gfx::Rect(0, 1000, 210, 310))); | 526 CreateTestWindow(gfx::Rect(0, 1000, 210, 310))); |
| 526 DragToVerticalPositionAndToEdge(DOCKED_EDGE_RIGHT, w2.get(), 1000 + 500); | 527 DragToVerticalPositionAndToEdge(DOCKED_EDGE_RIGHT, w2.get(), 1000 + 500); |
| 527 std::unique_ptr<aura::Window> w3( | 528 std::unique_ptr<aura::Window> w3( |
| 528 CreateTestWindow(gfx::Rect(0, 1000, 220, 310))); | 529 CreateTestWindow(gfx::Rect(0, 1000, 220, 310))); |
| 529 DragToVerticalPositionAndToEdge(DOCKED_EDGE_RIGHT, w3.get(), 1000 + 600); | 530 DragToVerticalPositionAndToEdge(DOCKED_EDGE_RIGHT, w3.get(), 1000 + 600); |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 808 EXPECT_EQ(work_area.height(), window->GetBoundsInScreen().height()); | 809 EXPECT_EQ(work_area.height(), window->GetBoundsInScreen().height()); |
| 809 } | 810 } |
| 810 | 811 |
| 811 // Tests run twice - on both panels and normal windows | 812 // Tests run twice - on both panels and normal windows |
| 812 INSTANTIATE_TEST_CASE_P(NormalOrPanel, | 813 INSTANTIATE_TEST_CASE_P(NormalOrPanel, |
| 813 DockedWindowLayoutManagerTest, | 814 DockedWindowLayoutManagerTest, |
| 814 testing::Values(ui::wm::WINDOW_TYPE_NORMAL, | 815 testing::Values(ui::wm::WINDOW_TYPE_NORMAL, |
| 815 ui::wm::WINDOW_TYPE_PANEL)); | 816 ui::wm::WINDOW_TYPE_PANEL)); |
| 816 | 817 |
| 817 } // namespace ash | 818 } // namespace ash |
| OLD | NEW |