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_resizer.h" | 5 #include "ash/wm/dock/docked_window_resizer.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/launcher/launcher.h" | 8 #include "ash/launcher/launcher.h" |
9 #include "ash/launcher/launcher_model.h" | 9 #include "ash/launcher/launcher_model.h" |
10 #include "ash/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 DragRevert(); | 603 DragRevert(); |
604 EXPECT_EQ(previous_container_id, window->parent()->id()); | 604 EXPECT_EQ(previous_container_id, window->parent()->id()); |
605 } | 605 } |
606 | 606 |
607 // Move a docked window to the second display | 607 // Move a docked window to the second display |
608 TEST_P(DockedWindowResizerTest, DragAcrossDisplays) { | 608 TEST_P(DockedWindowResizerTest, DragAcrossDisplays) { |
609 if (!SupportsMultipleDisplays()) | 609 if (!SupportsMultipleDisplays()) |
610 return; | 610 return; |
611 | 611 |
612 UpdateDisplay("800x800,800x800"); | 612 UpdateDisplay("800x800,800x800"); |
613 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); | 613 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); |
614 EXPECT_EQ(2, static_cast<int>(root_windows.size())); | 614 EXPECT_EQ(2, static_cast<int>(root_windows.size())); |
615 scoped_ptr<aura::Window> window(CreateTestWindow(gfx::Rect(0, 0, 201, 201))); | 615 scoped_ptr<aura::Window> window(CreateTestWindow(gfx::Rect(0, 0, 201, 201))); |
616 gfx::Rect initial_bounds = window->GetBoundsInScreen(); | 616 gfx::Rect initial_bounds = window->GetBoundsInScreen(); |
617 EXPECT_EQ(root_windows[0], window->GetRootWindow()); | 617 EXPECT_EQ(root_windows[0], window->GetRootWindow()); |
618 | 618 |
619 DragRelativeToEdge(DOCKED_EDGE_RIGHT, window.get(), 0); | 619 DragRelativeToEdge(DOCKED_EDGE_RIGHT, window.get(), 0); |
620 // The window should be attached and snapped to the right edge. | 620 // The window should be attached and snapped to the right edge. |
621 EXPECT_EQ(window->GetRootWindow()->bounds().right(), | 621 EXPECT_EQ(window->GetRootWindow()->bounds().right(), |
622 window->GetBoundsInScreen().right()); | 622 window->GetBoundsInScreen().right()); |
623 EXPECT_EQ(internal::kShellWindowId_DockedContainer, window->parent()->id()); | 623 EXPECT_EQ(internal::kShellWindowId_DockedContainer, window->parent()->id()); |
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1167 child->GetBoundsInScreen().origin().ToString()); | 1167 child->GetBoundsInScreen().origin().ToString()); |
1168 } | 1168 } |
1169 | 1169 |
1170 // Tests run twice - on both panels and normal windows | 1170 // Tests run twice - on both panels and normal windows |
1171 INSTANTIATE_TEST_CASE_P(NormalOrPanel, | 1171 INSTANTIATE_TEST_CASE_P(NormalOrPanel, |
1172 DockedWindowResizerTest, | 1172 DockedWindowResizerTest, |
1173 testing::Values(aura::client::WINDOW_TYPE_NORMAL, | 1173 testing::Values(aura::client::WINDOW_TYPE_NORMAL, |
1174 aura::client::WINDOW_TYPE_PANEL)); | 1174 aura::client::WINDOW_TYPE_PANEL)); |
1175 } // namespace internal | 1175 } // namespace internal |
1176 } // namespace ash | 1176 } // namespace ash |
OLD | NEW |