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

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

Issue 1412813003: This CL replaces user_manager::UserID with AccountId. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@468875--Chrome-OS-handles-deletion-of-Gmail-account-poorly--Create-AccountID-structure-part2--user_names
Patch Set: Fix Win GN build. Created 5 years, 1 month 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
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 "ash/test/shell_test_api.h" 10 #include "ash/test/shell_test_api.h"
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 } 265 }
266 266
267 policy::MockConfigurationPolicyProvider provider_; 267 policy::MockConfigurationPolicyProvider provider_;
268 MockBrailleController braille_controller_; 268 MockBrailleController braille_controller_;
269 }; 269 };
270 270
271 IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, LoginStatus) { 271 IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, LoginStatus) {
272 EXPECT_EQ(ash::user::LOGGED_IN_NONE, GetLoginStatus()); 272 EXPECT_EQ(ash::user::LOGGED_IN_NONE, GetLoginStatus());
273 273
274 user_manager::UserManager::Get()->UserLoggedIn( 274 user_manager::UserManager::Get()->UserLoggedIn(
275 "owner@invalid.domain", "owner@invalid.domain", true); 275 AccountId::FromUserEmail("owner@invalid.domain"), "owner@invalid.domain",
276 true);
276 user_manager::UserManager::Get()->SessionStarted(); 277 user_manager::UserManager::Get()->SessionStarted();
277 278
278 EXPECT_EQ(ash::user::LOGGED_IN_USER, GetLoginStatus()); 279 EXPECT_EQ(ash::user::LOGGED_IN_USER, GetLoginStatus());
279 } 280 }
280 281
281 IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowTrayIcon) { 282 IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowTrayIcon) {
282 SetLoginStatus(ash::user::LOGGED_IN_NONE); 283 SetLoginStatus(ash::user::LOGGED_IN_NONE);
283 284
284 // Confirms that the icon is invisible before login. 285 // Confirms that the icon is invisible before login.
285 EXPECT_FALSE(IsTrayIconVisible()); 286 EXPECT_FALSE(IsTrayIconVisible());
286 287
287 user_manager::UserManager::Get()->UserLoggedIn( 288 user_manager::UserManager::Get()->UserLoggedIn(
288 "owner@invalid.domain", "owner@invalid.domain", true); 289 AccountId::FromUserEmail("owner@invalid.domain"), "owner@invalid.domain",
290 true);
289 user_manager::UserManager::Get()->SessionStarted(); 291 user_manager::UserManager::Get()->SessionStarted();
290 292
291 // Confirms that the icon is invisible just after login. 293 // Confirms that the icon is invisible just after login.
292 EXPECT_FALSE(IsTrayIconVisible()); 294 EXPECT_FALSE(IsTrayIconVisible());
293 295
294 // Toggling spoken feedback changes the visibillity of the icon. 296 // Toggling spoken feedback changes the visibillity of the icon.
295 AccessibilityManager::Get()->EnableSpokenFeedback( 297 AccessibilityManager::Get()->EnableSpokenFeedback(
296 true, ui::A11Y_NOTIFICATION_NONE); 298 true, ui::A11Y_NOTIFICATION_NONE);
297 EXPECT_TRUE(IsTrayIconVisible()); 299 EXPECT_TRUE(IsTrayIconVisible());
298 AccessibilityManager::Get()->EnableSpokenFeedback( 300 AccessibilityManager::Get()->EnableSpokenFeedback(
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 SetShowAccessibilityOptionsInSystemTrayMenu(true); 345 SetShowAccessibilityOptionsInSystemTrayMenu(true);
344 AccessibilityManager::Get()->EnableHighContrast(true); 346 AccessibilityManager::Get()->EnableHighContrast(true);
345 EXPECT_TRUE(IsTrayIconVisible()); 347 EXPECT_TRUE(IsTrayIconVisible());
346 AccessibilityManager::Get()->EnableHighContrast(false); 348 AccessibilityManager::Get()->EnableHighContrast(false);
347 EXPECT_FALSE(IsTrayIconVisible()); 349 EXPECT_FALSE(IsTrayIconVisible());
348 } 350 }
349 351
350 IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowMenu) { 352 IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowMenu) {
351 // Login 353 // Login
352 user_manager::UserManager::Get()->UserLoggedIn( 354 user_manager::UserManager::Get()->UserLoggedIn(
353 "owner@invalid.domain", "owner@invalid.domain", true); 355 AccountId::FromUserEmail("owner@invalid.domain"), "owner@invalid.domain",
356 true);
354 user_manager::UserManager::Get()->SessionStarted(); 357 user_manager::UserManager::Get()->SessionStarted();
355 358
356 SetShowAccessibilityOptionsInSystemTrayMenu(false); 359 SetShowAccessibilityOptionsInSystemTrayMenu(false);
357 360
358 // Confirms that the menu is hidden. 361 // Confirms that the menu is hidden.
359 EXPECT_FALSE(CanCreateMenuItem()); 362 EXPECT_FALSE(CanCreateMenuItem());
360 363
361 // Toggling spoken feedback changes the visibillity of the menu. 364 // Toggling spoken feedback changes the visibillity of the menu.
362 AccessibilityManager::Get()->EnableSpokenFeedback( 365 AccessibilityManager::Get()->EnableSpokenFeedback(
363 true, ui::A11Y_NOTIFICATION_NONE); 366 true, ui::A11Y_NOTIFICATION_NONE);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 EXPECT_TRUE(CanCreateMenuItem()); 414 EXPECT_TRUE(CanCreateMenuItem());
412 AccessibilityManager::Get()->EnableHighContrast(false); 415 AccessibilityManager::Get()->EnableHighContrast(false);
413 EXPECT_TRUE(CanCreateMenuItem()); 416 EXPECT_TRUE(CanCreateMenuItem());
414 SetMagnifierEnabled(false); 417 SetMagnifierEnabled(false);
415 EXPECT_FALSE(CanCreateMenuItem()); 418 EXPECT_FALSE(CanCreateMenuItem());
416 } 419 }
417 420
418 IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowMenuWithShowMenuOption) { 421 IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowMenuWithShowMenuOption) {
419 // Login 422 // Login
420 user_manager::UserManager::Get()->UserLoggedIn( 423 user_manager::UserManager::Get()->UserLoggedIn(
421 "owner@invalid.domain", "owner@invalid.domain", true); 424 AccountId::FromUserEmail("owner@invalid.domain"), "owner@invalid.domain",
425 true);
422 user_manager::UserManager::Get()->SessionStarted(); 426 user_manager::UserManager::Get()->SessionStarted();
423 427
424 SetShowAccessibilityOptionsInSystemTrayMenu(true); 428 SetShowAccessibilityOptionsInSystemTrayMenu(true);
425 429
426 // Confirms that the menu is visible. 430 // Confirms that the menu is visible.
427 EXPECT_TRUE(CanCreateMenuItem()); 431 EXPECT_TRUE(CanCreateMenuItem());
428 432
429 // The menu remains visible regardless of toggling spoken feedback. 433 // The menu remains visible regardless of toggling spoken feedback.
430 AccessibilityManager::Get()->EnableSpokenFeedback( 434 AccessibilityManager::Get()->EnableSpokenFeedback(
431 true, ui::A11Y_NOTIFICATION_NONE); 435 true, ui::A11Y_NOTIFICATION_NONE);
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
901 EXPECT_FALSE(IsSettingsShownOnDetailMenu()); 905 EXPECT_FALSE(IsSettingsShownOnDetailMenu());
902 CloseDetailMenu(); 906 CloseDetailMenu();
903 } 907 }
904 908
905 INSTANTIATE_TEST_CASE_P(TrayAccessibilityTestInstance, 909 INSTANTIATE_TEST_CASE_P(TrayAccessibilityTestInstance,
906 TrayAccessibilityTest, 910 TrayAccessibilityTest,
907 testing::Values(PREF_SERVICE, 911 testing::Values(PREF_SERVICE,
908 POLICY)); 912 POLICY));
909 913
910 } // namespace chromeos 914 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698