| 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_resizer.h" | 5 #include "ash/common/wm/dock/docked_window_resizer.h" |
| 6 | 6 |
| 7 #include "ash/common/ash_switches.h" | 7 #include "ash/common/ash_switches.h" |
| 8 #include "ash/common/shelf/shelf_widget.h" | 8 #include "ash/common/shelf/shelf_widget.h" |
| 9 #include "ash/common/shelf/wm_shelf.h" | 9 #include "ash/common/shelf/wm_shelf.h" |
| 10 #include "ash/common/test/test_shelf_delegate.h" | 10 #include "ash/common/test/test_shelf_delegate.h" |
| (...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 DragMove(-10, 10); | 646 DragMove(-10, 10); |
| 647 DragRevert(); | 647 DragRevert(); |
| 648 // The window should be in default container and not docked. | 648 // The window should be in default container and not docked. |
| 649 EXPECT_EQ(kShellWindowId_DefaultContainer, window->parent()->id()); | 649 EXPECT_EQ(kShellWindowId_DefaultContainer, window->parent()->id()); |
| 650 // Docked area alignment should be cleared. | 650 // Docked area alignment should be cleared. |
| 651 EXPECT_EQ(DOCKED_ALIGNMENT_NONE, docked_alignment(manager)); | 651 EXPECT_EQ(DOCKED_ALIGNMENT_NONE, docked_alignment(manager)); |
| 652 } | 652 } |
| 653 | 653 |
| 654 // Move a docked window to the second display | 654 // Move a docked window to the second display |
| 655 TEST_P(DockedWindowResizerTest, DragAcrossDisplays) { | 655 TEST_P(DockedWindowResizerTest, DragAcrossDisplays) { |
| 656 if (!SupportsMultipleDisplays()) | |
| 657 return; | |
| 658 | |
| 659 UpdateDisplay("800x800,800x800"); | 656 UpdateDisplay("800x800,800x800"); |
| 660 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); | 657 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); |
| 661 EXPECT_EQ(2, static_cast<int>(root_windows.size())); | 658 EXPECT_EQ(2, static_cast<int>(root_windows.size())); |
| 662 std::unique_ptr<aura::Window> window( | 659 std::unique_ptr<aura::Window> window( |
| 663 CreateTestWindow(gfx::Rect(0, 0, 201, 201))); | 660 CreateTestWindow(gfx::Rect(0, 0, 201, 201))); |
| 664 EXPECT_EQ(root_windows[0], window->GetRootWindow()); | 661 EXPECT_EQ(root_windows[0], window->GetRootWindow()); |
| 665 | 662 |
| 666 DragRelativeToEdge(DOCKED_EDGE_RIGHT, window.get(), 0); | 663 DragRelativeToEdge(DOCKED_EDGE_RIGHT, window.get(), 0); |
| 667 // The window should be docked at the right edge. | 664 // The window should be docked at the right edge. |
| 668 EXPECT_EQ(window->GetRootWindow()->GetBoundsInScreen().right(), | 665 EXPECT_EQ(window->GetRootWindow()->GetBoundsInScreen().right(), |
| (...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1495 EXPECT_TRUE(window_state->IsMaximized()); | 1492 EXPECT_TRUE(window_state->IsMaximized()); |
| 1496 } | 1493 } |
| 1497 | 1494 |
| 1498 // Tests run twice - on both panels and normal windows | 1495 // Tests run twice - on both panels and normal windows |
| 1499 INSTANTIATE_TEST_CASE_P(NormalOrPanel, | 1496 INSTANTIATE_TEST_CASE_P(NormalOrPanel, |
| 1500 DockedWindowResizerTest, | 1497 DockedWindowResizerTest, |
| 1501 testing::Values(ui::wm::WINDOW_TYPE_NORMAL, | 1498 testing::Values(ui::wm::WINDOW_TYPE_NORMAL, |
| 1502 ui::wm::WINDOW_TYPE_PANEL)); | 1499 ui::wm::WINDOW_TYPE_PANEL)); |
| 1503 | 1500 |
| 1504 } // namespace ash | 1501 } // namespace ash |
| OLD | NEW |