| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/toplevel_window_event_handler.h" | 5 #include "ash/wm/toplevel_window_event_handler.h" |
| 6 | 6 |
| 7 #include "ash/public/cpp/shell_window_ids.h" | 7 #include "ash/public/cpp/shell_window_ids.h" |
| 8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/shell_port.h" |
| 10 #include "ash/test/ash_test_base.h" | 11 #include "ash/test/ash_test_base.h" |
| 11 #include "ash/wm/resize_shadow.h" | 12 #include "ash/wm/resize_shadow.h" |
| 12 #include "ash/wm/resize_shadow_controller.h" | 13 #include "ash/wm/resize_shadow_controller.h" |
| 13 #include "ash/wm/window_state.h" | 14 #include "ash/wm/window_state.h" |
| 14 #include "ash/wm/window_state_aura.h" | 15 #include "ash/wm/window_state_aura.h" |
| 15 #include "ash/wm/window_util.h" | 16 #include "ash/wm/window_util.h" |
| 16 #include "ash/wm/wm_event.h" | 17 #include "ash/wm/wm_event.h" |
| 17 #include "ash/wm/workspace_controller.h" | 18 #include "ash/wm/workspace_controller.h" |
| 18 #include "ash/wm_shell.h" | |
| 19 #include "base/compiler_specific.h" | 19 #include "base/compiler_specific.h" |
| 20 #include "base/threading/thread_task_runner_handle.h" | 20 #include "base/threading/thread_task_runner_handle.h" |
| 21 #include "services/ui/public/interfaces/window_manager_constants.mojom.h" | 21 #include "services/ui/public/interfaces/window_manager_constants.mojom.h" |
| 22 #include "testing/gtest/include/gtest/gtest.h" | 22 #include "testing/gtest/include/gtest/gtest.h" |
| 23 #include "ui/aura/client/aura_constants.h" | 23 #include "ui/aura/client/aura_constants.h" |
| 24 #include "ui/aura/client/capture_client.h" | 24 #include "ui/aura/client/capture_client.h" |
| 25 #include "ui/aura/test/aura_test_base.h" | 25 #include "ui/aura/test/aura_test_base.h" |
| 26 #include "ui/aura/test/test_window_delegate.h" | 26 #include "ui/aura/test/test_window_delegate.h" |
| 27 #include "ui/aura/window_event_dispatcher.h" | 27 #include "ui/aura/window_event_dispatcher.h" |
| 28 #include "ui/base/hit_test.h" | 28 #include "ui/base/hit_test.h" |
| (...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 779 EXPECT_EQ(aura::client::MOVE_SUCCESSFUL, | 779 EXPECT_EQ(aura::client::MOVE_SUCCESSFUL, |
| 780 move_client->RunMoveLoop(window.get(), gfx::Vector2d(), | 780 move_client->RunMoveLoop(window.get(), gfx::Vector2d(), |
| 781 aura::client::WINDOW_MOVE_SOURCE_TOUCH)); | 781 aura::client::WINDOW_MOVE_SOURCE_TOUCH)); |
| 782 } | 782 } |
| 783 | 783 |
| 784 // Tests that dragging a snapped window to another display updates the window's | 784 // Tests that dragging a snapped window to another display updates the window's |
| 785 // bounds correctly. | 785 // bounds correctly. |
| 786 TEST_F(ToplevelWindowEventHandlerTest, DragSnappedWindowToExternalDisplay) { | 786 TEST_F(ToplevelWindowEventHandlerTest, DragSnappedWindowToExternalDisplay) { |
| 787 // TODO: SetLayoutForCurrentDisplays() needs to ported to mash. | 787 // TODO: SetLayoutForCurrentDisplays() needs to ported to mash. |
| 788 // http://crbug.com/698043. | 788 // http://crbug.com/698043. |
| 789 if (WmShell::Get()->IsRunningInMash()) | 789 if (ShellPort::Get()->IsRunningInMash()) |
| 790 return; | 790 return; |
| 791 | 791 |
| 792 UpdateDisplay("940x550,940x550"); | 792 UpdateDisplay("940x550,940x550"); |
| 793 int64_t primary_id = display::Screen::GetScreen()->GetPrimaryDisplay().id(); | 793 int64_t primary_id = display::Screen::GetScreen()->GetPrimaryDisplay().id(); |
| 794 int64_t secondary_id = display_manager()->GetSecondaryDisplay().id(); | 794 int64_t secondary_id = display_manager()->GetSecondaryDisplay().id(); |
| 795 display::DisplayLayoutBuilder builder(primary_id); | 795 display::DisplayLayoutBuilder builder(primary_id); |
| 796 builder.SetSecondaryPlacement(secondary_id, display::DisplayPlacement::TOP, | 796 builder.SetSecondaryPlacement(secondary_id, display::DisplayPlacement::TOP, |
| 797 0); | 797 0); |
| 798 display_manager()->SetLayoutForCurrentDisplays(builder.Build()); | 798 display_manager()->SetLayoutForCurrentDisplays(builder.Build()); |
| 799 | 799 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 821 // The window is now fully contained in the secondary display. | 821 // The window is now fully contained in the secondary display. |
| 822 EXPECT_TRUE(display_manager()->GetSecondaryDisplay().bounds().Contains( | 822 EXPECT_TRUE(display_manager()->GetSecondaryDisplay().bounds().Contains( |
| 823 w1->GetBoundsInScreen())); | 823 w1->GetBoundsInScreen())); |
| 824 } | 824 } |
| 825 | 825 |
| 826 // Showing the resize shadows when the mouse is over the window edges is tested | 826 // Showing the resize shadows when the mouse is over the window edges is tested |
| 827 // in resize_shadow_and_cursor_test.cc | 827 // in resize_shadow_and_cursor_test.cc |
| 828 | 828 |
| 829 } // namespace test | 829 } // namespace test |
| 830 } // namespace ash | 830 } // namespace ash |
| OLD | NEW |