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

Side by Side Diff: chrome/browser/chromeos/system/tray_accessibility_browsertest.cc

Issue 375413002: Replace chromeos::UserManager::Get() with chromeos::GetUserManager(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 5 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 | Annotate | Revision Log
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/magnifier/magnification_controller.h" 5 #include "ash/magnifier/magnification_controller.h"
6 #include "ash/shell.h" 6 #include "ash/shell.h"
7 #include "ash/system/tray/system_tray.h" 7 #include "ash/system/tray/system_tray.h"
8 #include "ash/system/tray_accessibility.h" 8 #include "ash/system/tray_accessibility.h"
9 #include "ash/system/user/login_status.h" 9 #include "ash/system/user/login_status.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 *braille_controller_.GetDisplayState()); 255 *braille_controller_.GetDisplayState());
256 } 256 }
257 257
258 policy::MockConfigurationPolicyProvider provider_; 258 policy::MockConfigurationPolicyProvider provider_;
259 MockBrailleController braille_controller_; 259 MockBrailleController braille_controller_;
260 }; 260 };
261 261
262 IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, LoginStatus) { 262 IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, LoginStatus) {
263 EXPECT_EQ(ash::user::LOGGED_IN_NONE, GetLoginStatus()); 263 EXPECT_EQ(ash::user::LOGGED_IN_NONE, GetLoginStatus());
264 264
265 UserManager::Get()->UserLoggedIn( 265 GetUserManager()->UserLoggedIn(
266 "owner@invalid.domain", "owner@invalid.domain", true); 266 "owner@invalid.domain", "owner@invalid.domain", true);
267 UserManager::Get()->SessionStarted(); 267 GetUserManager()->SessionStarted();
268 268
269 EXPECT_EQ(ash::user::LOGGED_IN_USER, GetLoginStatus()); 269 EXPECT_EQ(ash::user::LOGGED_IN_USER, GetLoginStatus());
270 } 270 }
271 271
272 IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowTrayIcon) { 272 IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowTrayIcon) {
273 SetLoginStatus(ash::user::LOGGED_IN_NONE); 273 SetLoginStatus(ash::user::LOGGED_IN_NONE);
274 274
275 // Confirms that the icon is invisible before login. 275 // Confirms that the icon is invisible before login.
276 EXPECT_FALSE(IsTrayIconVisible()); 276 EXPECT_FALSE(IsTrayIconVisible());
277 277
278 UserManager::Get()->UserLoggedIn( 278 GetUserManager()->UserLoggedIn(
279 "owner@invalid.domain", "owner@invalid.domain", true); 279 "owner@invalid.domain", "owner@invalid.domain", true);
280 UserManager::Get()->SessionStarted(); 280 GetUserManager()->SessionStarted();
281 281
282 // Confirms that the icon is invisible just after login. 282 // Confirms that the icon is invisible just after login.
283 EXPECT_FALSE(IsTrayIconVisible()); 283 EXPECT_FALSE(IsTrayIconVisible());
284 284
285 // Toggling spoken feedback changes the visibillity of the icon. 285 // Toggling spoken feedback changes the visibillity of the icon.
286 AccessibilityManager::Get()->EnableSpokenFeedback( 286 AccessibilityManager::Get()->EnableSpokenFeedback(
287 true, ash::A11Y_NOTIFICATION_NONE); 287 true, ash::A11Y_NOTIFICATION_NONE);
288 EXPECT_TRUE(IsTrayIconVisible()); 288 EXPECT_TRUE(IsTrayIconVisible());
289 AccessibilityManager::Get()->EnableSpokenFeedback( 289 AccessibilityManager::Get()->EnableSpokenFeedback(
290 false, ash::A11Y_NOTIFICATION_NONE); 290 false, ash::A11Y_NOTIFICATION_NONE);
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 // the icon on the tray. 333 // the icon on the tray.
334 SetShowAccessibilityOptionsInSystemTrayMenu(true); 334 SetShowAccessibilityOptionsInSystemTrayMenu(true);
335 AccessibilityManager::Get()->EnableHighContrast(true); 335 AccessibilityManager::Get()->EnableHighContrast(true);
336 EXPECT_TRUE(IsTrayIconVisible()); 336 EXPECT_TRUE(IsTrayIconVisible());
337 AccessibilityManager::Get()->EnableHighContrast(false); 337 AccessibilityManager::Get()->EnableHighContrast(false);
338 EXPECT_FALSE(IsTrayIconVisible()); 338 EXPECT_FALSE(IsTrayIconVisible());
339 } 339 }
340 340
341 IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowMenu) { 341 IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowMenu) {
342 // Login 342 // Login
343 UserManager::Get()->UserLoggedIn( 343 GetUserManager()->UserLoggedIn(
344 "owner@invalid.domain", "owner@invalid.domain", true); 344 "owner@invalid.domain", "owner@invalid.domain", true);
345 UserManager::Get()->SessionStarted(); 345 GetUserManager()->SessionStarted();
346 346
347 SetShowAccessibilityOptionsInSystemTrayMenu(false); 347 SetShowAccessibilityOptionsInSystemTrayMenu(false);
348 348
349 // Confirms that the menu is hidden. 349 // Confirms that the menu is hidden.
350 EXPECT_FALSE(CanCreateMenuItem()); 350 EXPECT_FALSE(CanCreateMenuItem());
351 351
352 // Toggling spoken feedback changes the visibillity of the menu. 352 // Toggling spoken feedback changes the visibillity of the menu.
353 AccessibilityManager::Get()->EnableSpokenFeedback( 353 AccessibilityManager::Get()->EnableSpokenFeedback(
354 true, ash::A11Y_NOTIFICATION_NONE); 354 true, ash::A11Y_NOTIFICATION_NONE);
355 EXPECT_TRUE(CanCreateMenuItem()); 355 EXPECT_TRUE(CanCreateMenuItem());
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 false, ash::A11Y_NOTIFICATION_NONE); 401 false, ash::A11Y_NOTIFICATION_NONE);
402 EXPECT_TRUE(CanCreateMenuItem()); 402 EXPECT_TRUE(CanCreateMenuItem());
403 AccessibilityManager::Get()->EnableHighContrast(false); 403 AccessibilityManager::Get()->EnableHighContrast(false);
404 EXPECT_TRUE(CanCreateMenuItem()); 404 EXPECT_TRUE(CanCreateMenuItem());
405 SetMagnifierEnabled(false); 405 SetMagnifierEnabled(false);
406 EXPECT_FALSE(CanCreateMenuItem()); 406 EXPECT_FALSE(CanCreateMenuItem());
407 } 407 }
408 408
409 IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowMenuWithShowMenuOption) { 409 IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowMenuWithShowMenuOption) {
410 // Login 410 // Login
411 UserManager::Get()->UserLoggedIn( 411 GetUserManager()->UserLoggedIn(
412 "owner@invalid.domain", "owner@invalid.domain", true); 412 "owner@invalid.domain", "owner@invalid.domain", true);
413 UserManager::Get()->SessionStarted(); 413 GetUserManager()->SessionStarted();
414 414
415 SetShowAccessibilityOptionsInSystemTrayMenu(true); 415 SetShowAccessibilityOptionsInSystemTrayMenu(true);
416 416
417 // Confirms that the menu is visible. 417 // Confirms that the menu is visible.
418 EXPECT_TRUE(CanCreateMenuItem()); 418 EXPECT_TRUE(CanCreateMenuItem());
419 419
420 // The menu remains visible regardless of toggling spoken feedback. 420 // The menu remains visible regardless of toggling spoken feedback.
421 AccessibilityManager::Get()->EnableSpokenFeedback( 421 AccessibilityManager::Get()->EnableSpokenFeedback(
422 true, ash::A11Y_NOTIFICATION_NONE); 422 true, ash::A11Y_NOTIFICATION_NONE);
423 EXPECT_TRUE(CanCreateMenuItem()); 423 EXPECT_TRUE(CanCreateMenuItem());
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
873 EXPECT_TRUE(IsVirtualKeyboardMenuShownOnDetailMenu()); 873 EXPECT_TRUE(IsVirtualKeyboardMenuShownOnDetailMenu());
874 CloseDetailMenu(); 874 CloseDetailMenu();
875 } 875 }
876 876
877 INSTANTIATE_TEST_CASE_P(TrayAccessibilityTestInstance, 877 INSTANTIATE_TEST_CASE_P(TrayAccessibilityTestInstance,
878 TrayAccessibilityTest, 878 TrayAccessibilityTest,
879 testing::Values(PREF_SERVICE, 879 testing::Values(PREF_SERVICE,
880 POLICY)); 880 POLICY));
881 881
882 } // namespace chromeos 882 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698