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

Side by Side Diff: chrome/browser/chromeos/accessibility/accessibility_manager_browsertest.cc

Issue 2468483002: session_manager: Tracks user sessions (Closed)
Patch Set: replace func overload with better names Created 4 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/accessibility/magnification_manager_browsertest.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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "chrome/browser/chromeos/accessibility/accessibility_manager.h" 5 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
6 6
7 #include "ash/common/accessibility_types.h" 7 #include "ash/common/accessibility_types.h"
8 #include "ash/magnifier/magnification_controller.h" 8 #include "ash/magnifier/magnification_controller.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 11 matching lines...) Expand all
22 #include "chrome/browser/profiles/profile_manager.h" 22 #include "chrome/browser/profiles/profile_manager.h"
23 #include "chrome/common/extensions/extension_constants.h" 23 #include "chrome/common/extensions/extension_constants.h"
24 #include "chrome/common/pref_names.h" 24 #include "chrome/common/pref_names.h"
25 #include "chrome/test/base/in_process_browser_test.h" 25 #include "chrome/test/base/in_process_browser_test.h"
26 #include "chrome/test/base/testing_profile.h" 26 #include "chrome/test/base/testing_profile.h"
27 #include "chromeos/chromeos_switches.h" 27 #include "chromeos/chromeos_switches.h"
28 #include "components/prefs/pref_service.h" 28 #include "components/prefs/pref_service.h"
29 #include "components/session_manager/core/session_manager.h" 29 #include "components/session_manager/core/session_manager.h"
30 #include "components/signin/core/account_id/account_id.h" 30 #include "components/signin/core/account_id/account_id.h"
31 #include "components/sync_preferences/pref_service_syncable.h" 31 #include "components/sync_preferences/pref_service_syncable.h"
32 #include "components/user_manager/user_manager.h"
33 #include "components/user_manager/user_names.h" 32 #include "components/user_manager/user_names.h"
34 #include "content/public/browser/notification_service.h" 33 #include "content/public/browser/notification_service.h"
35 #include "content/public/test/test_utils.h" 34 #include "content/public/test/test_utils.h"
36 #include "testing/gtest/include/gtest/gtest.h" 35 #include "testing/gtest/include/gtest/gtest.h"
37 #include "ui/base/ime/chromeos/component_extension_ime_manager.h" 36 #include "ui/base/ime/chromeos/component_extension_ime_manager.h"
38 #include "ui/base/ime/chromeos/input_method_manager.h" 37 #include "ui/base/ime/chromeos/input_method_manager.h"
39 38
40 using chromeos::input_method::InputMethodManager; 39 using chromeos::input_method::InputMethodManager;
41 using chromeos::input_method::InputMethodUtil; 40 using chromeos::input_method::InputMethodUtil;
42 using chromeos::input_method::InputMethodDescriptors; 41 using chromeos::input_method::InputMethodDescriptors;
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 // Confirms that a11y features are disabled on the login screen. 289 // Confirms that a11y features are disabled on the login screen.
291 EXPECT_FALSE(IsLargeCursorEnabled()); 290 EXPECT_FALSE(IsLargeCursorEnabled());
292 EXPECT_FALSE(IsSpokenFeedbackEnabled()); 291 EXPECT_FALSE(IsSpokenFeedbackEnabled());
293 EXPECT_FALSE(IsHighContrastEnabled()); 292 EXPECT_FALSE(IsHighContrastEnabled());
294 EXPECT_FALSE(IsAutoclickEnabled()); 293 EXPECT_FALSE(IsAutoclickEnabled());
295 EXPECT_FALSE(IsVirtualKeyboardEnabled()); 294 EXPECT_FALSE(IsVirtualKeyboardEnabled());
296 EXPECT_FALSE(IsMonoAudioEnabled()); 295 EXPECT_FALSE(IsMonoAudioEnabled());
297 EXPECT_EQ(default_autoclick_delay(), GetAutoclickDelay()); 296 EXPECT_EQ(default_autoclick_delay(), GetAutoclickDelay());
298 297
299 // Logs in. 298 // Logs in.
300 user_manager::UserManager::Get()->UserLoggedIn(test_account_id_, 299 auto* session_manager = session_manager::SessionManager::Get();
301 kTestUserName, true); 300 session_manager->CreateSession(test_account_id_, kTestUserName);
302 301
303 // Confirms that the features still disabled just after login. 302 // Confirms that the features still disabled just after login.
304 EXPECT_FALSE(IsLargeCursorEnabled()); 303 EXPECT_FALSE(IsLargeCursorEnabled());
305 EXPECT_FALSE(IsSpokenFeedbackEnabled()); 304 EXPECT_FALSE(IsSpokenFeedbackEnabled());
306 EXPECT_FALSE(IsHighContrastEnabled()); 305 EXPECT_FALSE(IsHighContrastEnabled());
307 EXPECT_FALSE(IsAutoclickEnabled()); 306 EXPECT_FALSE(IsAutoclickEnabled());
308 EXPECT_FALSE(IsVirtualKeyboardEnabled()); 307 EXPECT_FALSE(IsVirtualKeyboardEnabled());
309 EXPECT_FALSE(IsMonoAudioEnabled()); 308 EXPECT_FALSE(IsMonoAudioEnabled());
310 EXPECT_EQ(default_autoclick_delay(), GetAutoclickDelay()); 309 EXPECT_EQ(default_autoclick_delay(), GetAutoclickDelay());
311 310
312 session_manager::SessionManager::Get()->SessionStarted(); 311 session_manager->SessionStarted();
313 312
314 // Confirms that the features are still disabled just after login. 313 // Confirms that the features are still disabled just after login.
315 EXPECT_FALSE(IsLargeCursorEnabled()); 314 EXPECT_FALSE(IsLargeCursorEnabled());
316 EXPECT_FALSE(IsSpokenFeedbackEnabled()); 315 EXPECT_FALSE(IsSpokenFeedbackEnabled());
317 EXPECT_FALSE(IsHighContrastEnabled()); 316 EXPECT_FALSE(IsHighContrastEnabled());
318 EXPECT_FALSE(IsAutoclickEnabled()); 317 EXPECT_FALSE(IsAutoclickEnabled());
319 EXPECT_FALSE(IsVirtualKeyboardEnabled()); 318 EXPECT_FALSE(IsVirtualKeyboardEnabled());
320 EXPECT_FALSE(IsMonoAudioEnabled()); 319 EXPECT_FALSE(IsMonoAudioEnabled());
321 EXPECT_EQ(default_autoclick_delay(), GetAutoclickDelay()); 320 EXPECT_EQ(default_autoclick_delay(), GetAutoclickDelay());
322 321
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 EXPECT_FALSE(IsSpokenFeedbackEnabled()); 358 EXPECT_FALSE(IsSpokenFeedbackEnabled());
360 359
361 // Signal the accessibility manager that a braille display was connected. 360 // Signal the accessibility manager that a braille display was connected.
362 SetBrailleDisplayAvailability(true); 361 SetBrailleDisplayAvailability(true);
363 // Confirms that the spoken feedback is enabled. 362 // Confirms that the spoken feedback is enabled.
364 EXPECT_TRUE(IsSpokenFeedbackEnabled()); 363 EXPECT_TRUE(IsSpokenFeedbackEnabled());
365 } 364 }
366 365
367 IN_PROC_BROWSER_TEST_F(AccessibilityManagerTest, TypePref) { 366 IN_PROC_BROWSER_TEST_F(AccessibilityManagerTest, TypePref) {
368 // Logs in. 367 // Logs in.
369 user_manager::UserManager::Get()->UserLoggedIn(test_account_id_, 368 auto* session_manager = session_manager::SessionManager::Get();
370 kTestUserName, true); 369 session_manager->CreateSession(test_account_id_, kTestUserName);
371 session_manager::SessionManager::Get()->SessionStarted(); 370 session_manager->SessionStarted();
372 371
373 // Confirms that the features are disabled just after login. 372 // Confirms that the features are disabled just after login.
374 EXPECT_FALSE(IsLargeCursorEnabled()); 373 EXPECT_FALSE(IsLargeCursorEnabled());
375 EXPECT_FALSE(IsSpokenFeedbackEnabled()); 374 EXPECT_FALSE(IsSpokenFeedbackEnabled());
376 EXPECT_FALSE(IsHighContrastEnabled()); 375 EXPECT_FALSE(IsHighContrastEnabled());
377 EXPECT_FALSE(IsAutoclickEnabled()); 376 EXPECT_FALSE(IsAutoclickEnabled());
378 EXPECT_EQ(default_autoclick_delay(), GetAutoclickDelay()); 377 EXPECT_EQ(default_autoclick_delay(), GetAutoclickDelay());
379 EXPECT_FALSE(IsVirtualKeyboardEnabled()); 378 EXPECT_FALSE(IsVirtualKeyboardEnabled());
380 EXPECT_FALSE(IsMonoAudioEnabled()); 379 EXPECT_FALSE(IsMonoAudioEnabled());
381 380
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 427
429 SetVirtualKeyboardEnabledPref(false); 428 SetVirtualKeyboardEnabledPref(false);
430 EXPECT_FALSE(IsVirtualKeyboardEnabled()); 429 EXPECT_FALSE(IsVirtualKeyboardEnabled());
431 430
432 SetMonoAudioEnabledPref(false); 431 SetMonoAudioEnabledPref(false);
433 EXPECT_FALSE(IsMonoAudioEnabled()); 432 EXPECT_FALSE(IsMonoAudioEnabled());
434 } 433 }
435 434
436 IN_PROC_BROWSER_TEST_F(AccessibilityManagerTest, ResumeSavedPref) { 435 IN_PROC_BROWSER_TEST_F(AccessibilityManagerTest, ResumeSavedPref) {
437 // Loads the profile of the user. 436 // Loads the profile of the user.
438 user_manager::UserManager::Get()->UserLoggedIn(test_account_id_, 437 auto* session_manager = session_manager::SessionManager::Get();
439 kTestUserName, true); 438 session_manager->CreateSession(test_account_id_, kTestUserName);
440 439
441 // Sets the pref to enable large cursor before login. 440 // Sets the pref to enable large cursor before login.
442 SetLargeCursorEnabledPref(true); 441 SetLargeCursorEnabledPref(true);
443 EXPECT_FALSE(IsLargeCursorEnabled()); 442 EXPECT_FALSE(IsLargeCursorEnabled());
444 443
445 // Sets the pref to enable spoken feedback before login. 444 // Sets the pref to enable spoken feedback before login.
446 SetSpokenFeedbackEnabledPref(true); 445 SetSpokenFeedbackEnabledPref(true);
447 EXPECT_FALSE(IsSpokenFeedbackEnabled()); 446 EXPECT_FALSE(IsSpokenFeedbackEnabled());
448 447
449 // Sets the pref to enable high contrast before login. 448 // Sets the pref to enable high contrast before login.
(...skipping 11 matching lines...) Expand all
461 460
462 // Sets the pref to enable the on-screen keyboard before login. 461 // Sets the pref to enable the on-screen keyboard before login.
463 SetVirtualKeyboardEnabledPref(true); 462 SetVirtualKeyboardEnabledPref(true);
464 EXPECT_FALSE(IsVirtualKeyboardEnabled()); 463 EXPECT_FALSE(IsVirtualKeyboardEnabled());
465 464
466 // Sets the pref to enable mono audio output before login. 465 // Sets the pref to enable mono audio output before login.
467 SetMonoAudioEnabledPref(true); 466 SetMonoAudioEnabledPref(true);
468 EXPECT_FALSE(IsMonoAudioEnabled()); 467 EXPECT_FALSE(IsMonoAudioEnabled());
469 468
470 // Logs in. 469 // Logs in.
471 session_manager::SessionManager::Get()->SessionStarted(); 470 session_manager->SessionStarted();
472 471
473 // Confirms that features are enabled by restoring from pref just after login. 472 // Confirms that features are enabled by restoring from pref just after login.
474 EXPECT_TRUE(IsLargeCursorEnabled()); 473 EXPECT_TRUE(IsLargeCursorEnabled());
475 EXPECT_TRUE(IsSpokenFeedbackEnabled()); 474 EXPECT_TRUE(IsSpokenFeedbackEnabled());
476 EXPECT_TRUE(IsHighContrastEnabled()); 475 EXPECT_TRUE(IsHighContrastEnabled());
477 EXPECT_TRUE(IsAutoclickEnabled()); 476 EXPECT_TRUE(IsAutoclickEnabled());
478 EXPECT_EQ(kTestAutoclickDelayMs, GetAutoclickDelay()); 477 EXPECT_EQ(kTestAutoclickDelayMs, GetAutoclickDelay());
479 EXPECT_TRUE(IsVirtualKeyboardEnabled()); 478 EXPECT_TRUE(IsVirtualKeyboardEnabled());
480 EXPECT_TRUE(IsMonoAudioEnabled()); 479 EXPECT_TRUE(IsMonoAudioEnabled());
481 } 480 }
482 481
483 IN_PROC_BROWSER_TEST_F(AccessibilityManagerTest, 482 IN_PROC_BROWSER_TEST_F(AccessibilityManagerTest,
484 ChangingTypeInvokesNotification) { 483 ChangingTypeInvokesNotification) {
485 MockAccessibilityObserver observer; 484 MockAccessibilityObserver observer;
486 485
487 // Logs in. 486 // Logs in.
488 user_manager::UserManager::Get()->UserLoggedIn(test_account_id_, 487 auto* session_manager = session_manager::SessionManager::Get();
489 kTestUserName, true); 488 session_manager->CreateSession(test_account_id_, kTestUserName);
490 session_manager::SessionManager::Get()->SessionStarted(); 489 session_manager->SessionStarted();
491 490
492 EXPECT_FALSE(observer.observed()); 491 EXPECT_FALSE(observer.observed());
493 observer.reset(); 492 observer.reset();
494 493
495 SetSpokenFeedbackEnabled(true); 494 SetSpokenFeedbackEnabled(true);
496 EXPECT_TRUE(observer.observed()); 495 EXPECT_TRUE(observer.observed());
497 EXPECT_TRUE(observer.observed_enabled()); 496 EXPECT_TRUE(observer.observed_enabled());
498 EXPECT_EQ(observer.observed_type(), 497 EXPECT_EQ(observer.observed_type(),
499 ACCESSIBILITY_TOGGLE_SPOKEN_FEEDBACK); 498 ACCESSIBILITY_TOGGLE_SPOKEN_FEEDBACK);
500 EXPECT_TRUE(IsSpokenFeedbackEnabled()); 499 EXPECT_TRUE(IsSpokenFeedbackEnabled());
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 EXPECT_EQ(observer.observed_type(), 553 EXPECT_EQ(observer.observed_type(),
555 ACCESSIBILITY_TOGGLE_MONO_AUDIO); 554 ACCESSIBILITY_TOGGLE_MONO_AUDIO);
556 EXPECT_FALSE(IsMonoAudioEnabled()); 555 EXPECT_FALSE(IsMonoAudioEnabled());
557 } 556 }
558 557
559 IN_PROC_BROWSER_TEST_F(AccessibilityManagerTest, 558 IN_PROC_BROWSER_TEST_F(AccessibilityManagerTest,
560 ChangingTypePrefInvokesNotification) { 559 ChangingTypePrefInvokesNotification) {
561 MockAccessibilityObserver observer; 560 MockAccessibilityObserver observer;
562 561
563 // Logs in. 562 // Logs in.
564 user_manager::UserManager::Get()->UserLoggedIn(test_account_id_, 563 auto* session_manager = session_manager::SessionManager::Get();
565 kTestUserName, true); 564 session_manager->CreateSession(test_account_id_, kTestUserName);
566 session_manager::SessionManager::Get()->SessionStarted(); 565 session_manager->SessionStarted();
567 566
568 EXPECT_FALSE(observer.observed()); 567 EXPECT_FALSE(observer.observed());
569 observer.reset(); 568 observer.reset();
570 569
571 SetSpokenFeedbackEnabledPref(true); 570 SetSpokenFeedbackEnabledPref(true);
572 EXPECT_TRUE(observer.observed()); 571 EXPECT_TRUE(observer.observed());
573 EXPECT_TRUE(observer.observed_enabled()); 572 EXPECT_TRUE(observer.observed_enabled());
574 EXPECT_EQ(observer.observed_type(), 573 EXPECT_EQ(observer.observed_type(),
575 ACCESSIBILITY_TOGGLE_SPOKEN_FEEDBACK); 574 ACCESSIBILITY_TOGGLE_SPOKEN_FEEDBACK);
576 EXPECT_TRUE(IsSpokenFeedbackEnabled()); 575 EXPECT_TRUE(IsSpokenFeedbackEnabled());
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 EXPECT_TRUE(IsAutoclickEnabled()); 665 EXPECT_TRUE(IsAutoclickEnabled());
667 // Set autoclick delay. 666 // Set autoclick delay.
668 SetAutoclickDelay(kTestAutoclickDelayMs); 667 SetAutoclickDelay(kTestAutoclickDelayMs);
669 EXPECT_EQ(kTestAutoclickDelayMs, GetAutoclickDelay()); 668 EXPECT_EQ(kTestAutoclickDelayMs, GetAutoclickDelay());
670 // Enables mono audio output. 669 // Enables mono audio output.
671 SetMonoAudioEnabled(true); 670 SetMonoAudioEnabled(true);
672 EXPECT_TRUE(IsMonoAudioEnabled()); 671 EXPECT_TRUE(IsMonoAudioEnabled());
673 672
674 // Logs in. 673 // Logs in.
675 const AccountId account_id = AccountId::FromUserEmail(GetParam()); 674 const AccountId account_id = AccountId::FromUserEmail(GetParam());
676 user_manager::UserManager::Get()->UserLoggedIn( 675 auto* session_manager = session_manager::SessionManager::Get();
677 account_id, account_id.GetUserEmail(), true); 676 session_manager->CreateSession(account_id, account_id.GetUserEmail());
678 677
679 // Confirms that the features are still enabled just after login. 678 // Confirms that the features are still enabled just after login.
680 EXPECT_TRUE(IsLargeCursorEnabled()); 679 EXPECT_TRUE(IsLargeCursorEnabled());
681 EXPECT_TRUE(IsSpokenFeedbackEnabled()); 680 EXPECT_TRUE(IsSpokenFeedbackEnabled());
682 EXPECT_TRUE(IsHighContrastEnabled()); 681 EXPECT_TRUE(IsHighContrastEnabled());
683 EXPECT_TRUE(IsAutoclickEnabled()); 682 EXPECT_TRUE(IsAutoclickEnabled());
684 EXPECT_EQ(kTestAutoclickDelayMs, GetAutoclickDelay()); 683 EXPECT_EQ(kTestAutoclickDelayMs, GetAutoclickDelay());
685 EXPECT_TRUE(IsMonoAudioEnabled()); 684 EXPECT_TRUE(IsMonoAudioEnabled());
686 685
687 session_manager::SessionManager::Get()->SessionStarted(); 686 session_manager->SessionStarted();
688 687
689 // Confirms that the features keep enabled after session starts. 688 // Confirms that the features keep enabled after session starts.
690 EXPECT_TRUE(IsLargeCursorEnabled()); 689 EXPECT_TRUE(IsLargeCursorEnabled());
691 EXPECT_TRUE(IsSpokenFeedbackEnabled()); 690 EXPECT_TRUE(IsSpokenFeedbackEnabled());
692 EXPECT_TRUE(IsHighContrastEnabled()); 691 EXPECT_TRUE(IsHighContrastEnabled());
693 EXPECT_TRUE(IsAutoclickEnabled()); 692 EXPECT_TRUE(IsAutoclickEnabled());
694 EXPECT_EQ(kTestAutoclickDelayMs, GetAutoclickDelay()); 693 EXPECT_EQ(kTestAutoclickDelayMs, GetAutoclickDelay());
695 EXPECT_TRUE(IsMonoAudioEnabled()); 694 EXPECT_TRUE(IsMonoAudioEnabled());
696 695
697 // Confirms that the prefs have been copied to the user's profile. 696 // Confirms that the prefs have been copied to the user's profile.
698 EXPECT_TRUE(GetLargeCursorEnabledFromPref()); 697 EXPECT_TRUE(GetLargeCursorEnabledFromPref());
699 EXPECT_TRUE(GetSpokenFeedbackEnabledFromPref()); 698 EXPECT_TRUE(GetSpokenFeedbackEnabledFromPref());
700 EXPECT_TRUE(GetHighContrastEnabledFromPref()); 699 EXPECT_TRUE(GetHighContrastEnabledFromPref());
701 EXPECT_TRUE(GetAutoclickEnabledFromPref()); 700 EXPECT_TRUE(GetAutoclickEnabledFromPref());
702 EXPECT_EQ(kTestAutoclickDelayMs, GetAutoclickDelayFromPref()); 701 EXPECT_EQ(kTestAutoclickDelayMs, GetAutoclickDelayFromPref());
703 EXPECT_TRUE(GetMonoAudioEnabledFromPref()); 702 EXPECT_TRUE(GetMonoAudioEnabledFromPref());
704 } 703 }
705 704
706 IN_PROC_BROWSER_TEST_P(AccessibilityManagerUserTypeTest, BrailleWhenLoggedIn) { 705 IN_PROC_BROWSER_TEST_P(AccessibilityManagerUserTypeTest, BrailleWhenLoggedIn) {
707 // Logs in. 706 // Logs in.
708 const AccountId account_id = AccountId::FromUserEmail(GetParam()); 707 const AccountId account_id = AccountId::FromUserEmail(GetParam());
709 user_manager::UserManager::Get()->UserLoggedIn( 708 auto* session_manager = session_manager::SessionManager::Get();
710 account_id, account_id.GetUserEmail(), true); 709 session_manager->CreateSession(account_id, account_id.GetUserEmail());
711 session_manager::SessionManager::Get()->SessionStarted(); 710 session_manager->SessionStarted();
712 // This object watches for IME preference changes and reflects those in 711 // This object watches for IME preference changes and reflects those in
713 // the IME framework state. 712 // the IME framework state.
714 chromeos::Preferences prefs; 713 chromeos::Preferences prefs;
715 prefs.InitUserPrefsForTesting( 714 prefs.InitUserPrefsForTesting(
716 PrefServiceSyncableFromProfile(GetProfile()), 715 PrefServiceSyncableFromProfile(GetProfile()),
717 user_manager::UserManager::Get()->GetActiveUser(), 716 user_manager::UserManager::Get()->GetActiveUser(),
718 UserSessionManager::GetInstance()->GetDefaultIMEState(GetProfile())); 717 UserSessionManager::GetInstance()->GetDefaultIMEState(GetProfile()));
719 718
720 // Make sure we start in the expected state. 719 // Make sure we start in the expected state.
721 EXPECT_FALSE(IsBrailleImeActive()); 720 EXPECT_FALSE(IsBrailleImeActive());
(...skipping 23 matching lines...) Expand all
745 744
746 // Plugging in a display while spoken feedback is enabled should activate 745 // Plugging in a display while spoken feedback is enabled should activate
747 // the Braille IME. 746 // the Braille IME.
748 SetBrailleDisplayAvailability(true); 747 SetBrailleDisplayAvailability(true);
749 EXPECT_TRUE(IsSpokenFeedbackEnabled()); 748 EXPECT_TRUE(IsSpokenFeedbackEnabled());
750 EXPECT_TRUE(IsBrailleImeActive()); 749 EXPECT_TRUE(IsBrailleImeActive());
751 } 750 }
752 751
753 IN_PROC_BROWSER_TEST_F(AccessibilityManagerTest, AccessibilityMenuVisibility) { 752 IN_PROC_BROWSER_TEST_F(AccessibilityManagerTest, AccessibilityMenuVisibility) {
754 // Log in. 753 // Log in.
755 user_manager::UserManager::Get()->UserLoggedIn(test_account_id_, 754 auto* session_manager = session_manager::SessionManager::Get();
756 kTestUserName, true); 755 session_manager->CreateSession(test_account_id_, kTestUserName);
757 session_manager::SessionManager::Get()->SessionStarted(); 756 session_manager->SessionStarted();
758 757
759 // Confirms that the features are disabled. 758 // Confirms that the features are disabled.
760 EXPECT_FALSE(IsLargeCursorEnabled()); 759 EXPECT_FALSE(IsLargeCursorEnabled());
761 EXPECT_FALSE(IsSpokenFeedbackEnabled()); 760 EXPECT_FALSE(IsSpokenFeedbackEnabled());
762 EXPECT_FALSE(IsHighContrastEnabled()); 761 EXPECT_FALSE(IsHighContrastEnabled());
763 EXPECT_FALSE(IsAutoclickEnabled()); 762 EXPECT_FALSE(IsAutoclickEnabled());
764 EXPECT_FALSE(ShouldShowAccessibilityMenu()); 763 EXPECT_FALSE(ShouldShowAccessibilityMenu());
765 EXPECT_FALSE(IsVirtualKeyboardEnabled()); 764 EXPECT_FALSE(IsVirtualKeyboardEnabled());
766 EXPECT_FALSE(IsMonoAudioEnabled()); 765 EXPECT_FALSE(IsMonoAudioEnabled());
767 766
(...skipping 28 matching lines...) Expand all
796 EXPECT_FALSE(ShouldShowAccessibilityMenu()); 795 EXPECT_FALSE(ShouldShowAccessibilityMenu());
797 796
798 // Check mono audio output. 797 // Check mono audio output.
799 SetMonoAudioEnabled(true); 798 SetMonoAudioEnabled(true);
800 EXPECT_TRUE(ShouldShowAccessibilityMenu()); 799 EXPECT_TRUE(ShouldShowAccessibilityMenu());
801 SetMonoAudioEnabled(false); 800 SetMonoAudioEnabled(false);
802 EXPECT_FALSE(ShouldShowAccessibilityMenu()); 801 EXPECT_FALSE(ShouldShowAccessibilityMenu());
803 } 802 }
804 803
805 } // namespace chromeos 804 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/accessibility/magnification_manager_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698