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

Side by Side Diff: ash/wm/cursor_manager_unittest.cc

Issue 11419274: Remove CursorManager::cursor_visible(), which is no longer necessary. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 | Annotate | Revision Log
« no previous file with comments | « ash/wm/cursor_manager.h ('k') | ash/wm/power_button_controller_unittest.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 (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/cursor_manager.h" 5 #include "ash/wm/cursor_manager.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/test/ash_test_base.h" 8 #include "ash/test/ash_test_base.h"
9 #include "ash/test/cursor_manager_test_api.h" 9 #include "ash/test/cursor_manager_test_api.h"
10 #include "ash/wm/image_cursors.h" 10 #include "ash/wm/image_cursors.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 } 57 }
58 58
59 TEST_F(CursorManagerTest, ShowCursor) { 59 TEST_F(CursorManagerTest, ShowCursor) {
60 CursorManager* cursor_manager = Shell::GetInstance()->cursor_manager(); 60 CursorManager* cursor_manager = Shell::GetInstance()->cursor_manager();
61 CursorManagerTestApi test_api(cursor_manager); 61 CursorManagerTestApi test_api(cursor_manager);
62 62
63 cursor_manager->SetCursor(ui::kCursorCopy); 63 cursor_manager->SetCursor(ui::kCursorCopy);
64 EXPECT_EQ(ui::kCursorCopy, test_api.GetCurrentCursor().native_type()); 64 EXPECT_EQ(ui::kCursorCopy, test_api.GetCurrentCursor().native_type());
65 65
66 cursor_manager->ShowCursor(true); 66 cursor_manager->ShowCursor(true);
67 EXPECT_TRUE(cursor_manager->cursor_visible()); 67 EXPECT_TRUE(cursor_manager->IsCursorVisible());
68 cursor_manager->ShowCursor(false); 68 cursor_manager->ShowCursor(false);
69 EXPECT_FALSE(cursor_manager->cursor_visible()); 69 EXPECT_FALSE(cursor_manager->IsCursorVisible());
70 // The current cursor does not change even when the cursor is not shown. 70 // The current cursor does not change even when the cursor is not shown.
71 EXPECT_EQ(ui::kCursorCopy, test_api.GetCurrentCursor().native_type()); 71 EXPECT_EQ(ui::kCursorCopy, test_api.GetCurrentCursor().native_type());
72 72
73 // Check if cursor visibility is locked. 73 // Check if cursor visibility is locked.
74 cursor_manager->LockCursor(); 74 cursor_manager->LockCursor();
75 EXPECT_FALSE(cursor_manager->cursor_visible()); 75 EXPECT_FALSE(cursor_manager->IsCursorVisible());
76 cursor_manager->ShowCursor(true); 76 cursor_manager->ShowCursor(true);
77 EXPECT_FALSE(cursor_manager->cursor_visible()); 77 EXPECT_FALSE(cursor_manager->IsCursorVisible());
78 cursor_manager->UnlockCursor(); 78 cursor_manager->UnlockCursor();
79 EXPECT_TRUE(cursor_manager->cursor_visible()); 79 EXPECT_TRUE(cursor_manager->IsCursorVisible());
80 80
81 cursor_manager->LockCursor(); 81 cursor_manager->LockCursor();
82 EXPECT_TRUE(cursor_manager->cursor_visible()); 82 EXPECT_TRUE(cursor_manager->IsCursorVisible());
83 cursor_manager->ShowCursor(false); 83 cursor_manager->ShowCursor(false);
84 EXPECT_TRUE(cursor_manager->cursor_visible()); 84 EXPECT_TRUE(cursor_manager->IsCursorVisible());
85 cursor_manager->UnlockCursor(); 85 cursor_manager->UnlockCursor();
86 EXPECT_FALSE(cursor_manager->cursor_visible()); 86 EXPECT_FALSE(cursor_manager->IsCursorVisible());
87 87
88 // Checks setting visiblity while cursor is locked does not affect the 88 // Checks setting visiblity while cursor is locked does not affect the
89 // subsequent uses of UnlockCursor. 89 // subsequent uses of UnlockCursor.
90 cursor_manager->LockCursor(); 90 cursor_manager->LockCursor();
91 cursor_manager->ShowCursor(false); 91 cursor_manager->ShowCursor(false);
92 cursor_manager->UnlockCursor(); 92 cursor_manager->UnlockCursor();
93 EXPECT_FALSE(cursor_manager->cursor_visible()); 93 EXPECT_FALSE(cursor_manager->IsCursorVisible());
94 94
95 cursor_manager->ShowCursor(true); 95 cursor_manager->ShowCursor(true);
96 cursor_manager->LockCursor(); 96 cursor_manager->LockCursor();
97 cursor_manager->UnlockCursor(); 97 cursor_manager->UnlockCursor();
98 EXPECT_TRUE(cursor_manager->cursor_visible()); 98 EXPECT_TRUE(cursor_manager->IsCursorVisible());
99 99
100 cursor_manager->LockCursor(); 100 cursor_manager->LockCursor();
101 cursor_manager->ShowCursor(true); 101 cursor_manager->ShowCursor(true);
102 cursor_manager->UnlockCursor(); 102 cursor_manager->UnlockCursor();
103 EXPECT_TRUE(cursor_manager->cursor_visible()); 103 EXPECT_TRUE(cursor_manager->IsCursorVisible());
104 104
105 cursor_manager->ShowCursor(false); 105 cursor_manager->ShowCursor(false);
106 cursor_manager->LockCursor(); 106 cursor_manager->LockCursor();
107 cursor_manager->UnlockCursor(); 107 cursor_manager->UnlockCursor();
108 EXPECT_FALSE(cursor_manager->cursor_visible()); 108 EXPECT_FALSE(cursor_manager->IsCursorVisible());
109 } 109 }
110 110
111 TEST_F(CursorManagerTest, SetDeviceScaleFactor) { 111 TEST_F(CursorManagerTest, SetDeviceScaleFactor) {
112 CursorManager* cursor_manager = Shell::GetInstance()->cursor_manager(); 112 CursorManager* cursor_manager = Shell::GetInstance()->cursor_manager();
113 CursorManagerTestApi test_api(cursor_manager); 113 CursorManagerTestApi test_api(cursor_manager);
114 114
115 cursor_manager->SetDeviceScaleFactor(2.0f); 115 cursor_manager->SetDeviceScaleFactor(2.0f);
116 EXPECT_EQ(2.0f, test_api.GetDeviceScaleFactor()); 116 EXPECT_EQ(2.0f, test_api.GetDeviceScaleFactor());
117 cursor_manager->SetDeviceScaleFactor(1.0f); 117 cursor_manager->SetDeviceScaleFactor(1.0f);
118 EXPECT_EQ(1.0f, test_api.GetDeviceScaleFactor()); 118 EXPECT_EQ(1.0f, test_api.GetDeviceScaleFactor());
119 } 119 }
120 120
121 } // namespace test 121 } // namespace test
122 } // namespace ash 122 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/cursor_manager.h ('k') | ash/wm/power_button_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698