| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/display/unified_mouse_warp_controller.h" | 5 #include "ash/display/unified_mouse_warp_controller.h" |
| 6 | 6 |
| 7 #include "ash/display/display_layout_store.h" | 7 #include "ash/display/display_layout_store.h" |
| 8 #include "ash/display/display_manager.h" | 8 #include "ash/display/display_manager.h" |
| 9 #include "ash/display/mouse_cursor_event_filter.h" | 9 #include "ash/display/mouse_cursor_event_filter.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| 11 #include "ash/test/ash_test_base.h" | 11 #include "ash/test/ash_test_base.h" |
| 12 #include "ash/test/display_manager_test_api.h" | 12 #include "ash/test/display_manager_test_api.h" |
| 13 #include "ui/aura/env.h" | 13 #include "ui/aura/env.h" |
| 14 #include "ui/events/test/event_generator.h" | 14 #include "ui/events/test/event_generator.h" |
| 15 #include "ui/gfx/display.h" | 15 #include "ui/gfx/display.h" |
| 16 #include "ui/gfx/screen.h" | 16 #include "ui/gfx/screen.h" |
| 17 | 17 |
| 18 namespace ash { | 18 namespace ash { |
| 19 | 19 |
| 20 class UnifiedMouseWarpControllerTest : public test::AshTestBase { | 20 class UnifiedMouseWarpControllerTest : public test::AshTestBase { |
| 21 public: | 21 public: |
| 22 UnifiedMouseWarpControllerTest() {} | 22 UnifiedMouseWarpControllerTest() {} |
| 23 ~UnifiedMouseWarpControllerTest() override {} | 23 ~UnifiedMouseWarpControllerTest() override {} |
| 24 | 24 |
| 25 void SetUp() override { | 25 void SetUp() override { |
| 26 test::AshTestBase::SetUp(); | 26 test::AshTestBase::SetUp(); |
| 27 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); | 27 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); |
| 28 test::DisplayManagerTestApi test_api(display_manager); | 28 display_manager->SetDefaultMultiDisplayMode(DisplayManager::UNIFIED); |
| 29 test_api.SetDefaultMultiDisplayMode(DisplayManager::UNIFIED); | |
| 30 display_manager->SetMultiDisplayMode(DisplayManager::UNIFIED); | 29 display_manager->SetMultiDisplayMode(DisplayManager::UNIFIED); |
| 31 } | 30 } |
| 32 | 31 |
| 33 protected: | 32 protected: |
| 34 bool TestIfMouseWarpsAt(const gfx::Point& point_in_screen) { | 33 bool TestIfMouseWarpsAt(const gfx::Point& point_in_screen) { |
| 35 return test::DisplayManagerTestApi::TestIfMouseWarpsAt(GetEventGenerator(), | 34 return test::DisplayManagerTestApi::TestIfMouseWarpsAt(GetEventGenerator(), |
| 36 point_in_screen); | 35 point_in_screen); |
| 37 } | 36 } |
| 38 | 37 |
| 39 MouseCursorEventFilter* event_filter() { | 38 MouseCursorEventFilter* event_filter() { |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 EXPECT_FALSE(TestIfMouseWarpsAt(gfx::Point(11, 499))); | 95 EXPECT_FALSE(TestIfMouseWarpsAt(gfx::Point(11, 499))); |
| 97 // Touch the right edge of the second display. | 96 // Touch the right edge of the second display. |
| 98 EXPECT_FALSE(TestIfMouseWarpsAt(gfx::Point(999, 11))); | 97 EXPECT_FALSE(TestIfMouseWarpsAt(gfx::Point(999, 11))); |
| 99 // Touch the top edge of the second display. | 98 // Touch the top edge of the second display. |
| 100 EXPECT_FALSE(TestIfMouseWarpsAt(gfx::Point(11, 0))); | 99 EXPECT_FALSE(TestIfMouseWarpsAt(gfx::Point(11, 0))); |
| 101 // Touch the bottom edge of the second display. | 100 // Touch the bottom edge of the second display. |
| 102 EXPECT_FALSE(TestIfMouseWarpsAt(gfx::Point(11, 499))); | 101 EXPECT_FALSE(TestIfMouseWarpsAt(gfx::Point(11, 499))); |
| 103 } | 102 } |
| 104 | 103 |
| 105 } // namespace aura | 104 } // namespace aura |
| OLD | NEW |