Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1601)

Side by Side Diff: ash/display/unified_mouse_warp_controller_unittest.cc

Issue 1261693004: Allow dynamic enabling/disabling of unified desktop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/display/display_util_unittest.cc ('k') | ash/display/window_tree_host_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_manager.h"
7 #include "ash/display/mouse_cursor_event_filter.h" 8 #include "ash/display/mouse_cursor_event_filter.h"
8 #include "ash/shell.h" 9 #include "ash/shell.h"
9 #include "ash/test/ash_test_base.h" 10 #include "ash/test/ash_test_base.h"
10 #include "ash/test/display_manager_test_api.h" 11 #include "ash/test/display_manager_test_api.h"
11 #include "ui/aura/env.h" 12 #include "ui/aura/env.h"
12 #include "ui/events/test/event_generator.h" 13 #include "ui/events/test/event_generator.h"
13 #include "ui/gfx/display.h" 14 #include "ui/gfx/display.h"
14 #include "ui/gfx/screen.h" 15 #include "ui/gfx/screen.h"
15 16
16 namespace ash { 17 namespace ash {
17 18
18 class UnifiedMouseWarpControllerTest : public test::AshTestBase { 19 class UnifiedMouseWarpControllerTest : public test::AshTestBase {
19 public: 20 public:
20 UnifiedMouseWarpControllerTest() {} 21 UnifiedMouseWarpControllerTest() {}
21 ~UnifiedMouseWarpControllerTest() override {} 22 ~UnifiedMouseWarpControllerTest() override {}
22 23
23 void SetUp() override { 24 void SetUp() override {
24 test::AshTestBase::SetUp(); 25 test::AshTestBase::SetUp();
25 test::DisplayManagerTestApi::EnableUnifiedDesktopForTest(); 26 Shell::GetInstance()->display_manager()->SetUnifiedDesktopEnabled(true);
26 } 27 }
27 28
28 protected: 29 protected:
29 bool TestIfMouseWarpsAt(const gfx::Point& point_in_screen) { 30 bool TestIfMouseWarpsAt(const gfx::Point& point_in_screen) {
30 return test::DisplayManagerTestApi::TestIfMouseWarpsAt(GetEventGenerator(), 31 return test::DisplayManagerTestApi::TestIfMouseWarpsAt(GetEventGenerator(),
31 point_in_screen); 32 point_in_screen);
32 } 33 }
33 34
34 MouseCursorEventFilter* event_filter() { 35 MouseCursorEventFilter* event_filter() {
35 return Shell::GetInstance()->mouse_cursor_filter(); 36 return Shell::GetInstance()->mouse_cursor_filter();
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 EXPECT_FALSE(TestIfMouseWarpsAt(gfx::Point(11, 499))); 125 EXPECT_FALSE(TestIfMouseWarpsAt(gfx::Point(11, 499)));
125 // Touch the right edge of the second display. 126 // Touch the right edge of the second display.
126 EXPECT_FALSE(TestIfMouseWarpsAt(gfx::Point(999, 11))); 127 EXPECT_FALSE(TestIfMouseWarpsAt(gfx::Point(999, 11)));
127 // Touch the top edge of the second display. 128 // Touch the top edge of the second display.
128 EXPECT_FALSE(TestIfMouseWarpsAt(gfx::Point(11, 0))); 129 EXPECT_FALSE(TestIfMouseWarpsAt(gfx::Point(11, 0)));
129 // Touch the bottom edge of the second display. 130 // Touch the bottom edge of the second display.
130 EXPECT_FALSE(TestIfMouseWarpsAt(gfx::Point(11, 499))); 131 EXPECT_FALSE(TestIfMouseWarpsAt(gfx::Point(11, 499)));
131 } 132 }
132 133
133 } // namespace aura 134 } // namespace aura
OLDNEW
« no previous file with comments | « ash/display/display_util_unittest.cc ('k') | ash/display/window_tree_host_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698