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 test::DisplayManagerTestApi::EnableUnifiedDesktopForTest(); |
27 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); | 28 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); |
28 display_manager->SetDefaultMultiDisplayMode(DisplayManager::UNIFIED); | 29 display_manager->SetDefaultMultiDisplayMode(DisplayManager::UNIFIED); |
29 display_manager->SetMultiDisplayMode(DisplayManager::UNIFIED); | 30 display_manager->SetMultiDisplayMode(DisplayManager::UNIFIED); |
30 } | 31 } |
31 | 32 |
32 protected: | 33 protected: |
33 bool TestIfMouseWarpsAt(const gfx::Point& point_in_screen) { | 34 bool TestIfMouseWarpsAt(const gfx::Point& point_in_screen) { |
34 return test::DisplayManagerTestApi::TestIfMouseWarpsAt(GetEventGenerator(), | 35 return test::DisplayManagerTestApi::TestIfMouseWarpsAt(GetEventGenerator(), |
35 point_in_screen); | 36 point_in_screen); |
36 } | 37 } |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 EXPECT_FALSE(TestIfMouseWarpsAt(gfx::Point(11, 499))); | 96 EXPECT_FALSE(TestIfMouseWarpsAt(gfx::Point(11, 499))); |
96 // Touch the right edge of the second display. | 97 // Touch the right edge of the second display. |
97 EXPECT_FALSE(TestIfMouseWarpsAt(gfx::Point(999, 11))); | 98 EXPECT_FALSE(TestIfMouseWarpsAt(gfx::Point(999, 11))); |
98 // Touch the top edge of the second display. | 99 // Touch the top edge of the second display. |
99 EXPECT_FALSE(TestIfMouseWarpsAt(gfx::Point(11, 0))); | 100 EXPECT_FALSE(TestIfMouseWarpsAt(gfx::Point(11, 0))); |
100 // Touch the bottom edge of the second display. | 101 // Touch the bottom edge of the second display. |
101 EXPECT_FALSE(TestIfMouseWarpsAt(gfx::Point(11, 499))); | 102 EXPECT_FALSE(TestIfMouseWarpsAt(gfx::Point(11, 499))); |
102 } | 103 } |
103 | 104 |
104 } // namespace aura | 105 } // namespace aura |
OLD | NEW |