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

Unified Diff: chrome/browser/chromeos/accessibility/accessibility_manager_browsertest.cc

Issue 136633005: Turn back spoken feedback setting into a system-wide (non-per-user) preference (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/accessibility/accessibility_manager_browsertest.cc
diff --git a/chrome/browser/chromeos/accessibility/accessibility_manager_browsertest.cc b/chrome/browser/chromeos/accessibility/accessibility_manager_browsertest.cc
index c7788f60b25ba6d192e7e79815221f8242d00da1..ee3b13f199248f5319e9f00e0fcebf965cee15c5 100644
--- a/chrome/browser/chromeos/accessibility/accessibility_manager_browsertest.cc
+++ b/chrome/browser/chromeos/accessibility/accessibility_manager_browsertest.cc
@@ -21,6 +21,7 @@
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/base/in_process_browser_test.h"
+#include "chrome/test/base/testing_browser_process.h"
#include "chrome/test/base/testing_profile.h"
#include "chromeos/chromeos_switches.h"
#include "content/public/browser/notification_service.h"
@@ -185,6 +186,10 @@ PrefService* GetPrefs() {
return GetProfile()->GetPrefs();
}
+PrefService* GetGlobalPrefs() {
+ return TestingBrowserProcess::GetGlobal()->local_state();
+}
+
void SetLargeCursorEnabledPref(bool enabled) {
GetPrefs()->SetBoolean(prefs::kLargeCursorEnabled, enabled);
}
@@ -194,7 +199,7 @@ void SetHighContrastEnabledPref(bool enabled) {
}
void SetSpokenFeedbackEnabledPref(bool enabled) {
- GetPrefs()->SetBoolean(prefs::kSpokenFeedbackEnabled, enabled);
+ GetGlobalPrefs()->SetBoolean(prefs::kSpokenFeedbackEnabled, enabled);
}
void SetAutoclickEnabledPref(bool enabled) {
@@ -214,7 +219,7 @@ bool GetHighContrastEnabledFromPref() {
}
bool GetSpokenFeedbackEnabledFromPref() {
- return GetPrefs()->GetBoolean(prefs::kSpokenFeedbackEnabled);
+ return GetGlobalPrefs()->GetBoolean(prefs::kSpokenFeedbackEnabled);
}
bool GetAutoclickEnabledFromPref() {
@@ -385,10 +390,6 @@ IN_PROC_BROWSER_TEST_F(AccessibilityManagerTest, ResumeSavedPref) {
SetLargeCursorEnabledPref(true);
EXPECT_FALSE(IsLargeCursorEnabled());
- // Sets the pref to enable spoken feedback before login.
- SetSpokenFeedbackEnabledPref(true);
- EXPECT_FALSE(IsSpokenFeedbackEnabled());
-
// Sets the pref to enable high contrast before login.
SetHighContrastEnabledPref(true);
EXPECT_FALSE(IsHighContrastEnabled());
@@ -402,15 +403,22 @@ IN_PROC_BROWSER_TEST_F(AccessibilityManagerTest, ResumeSavedPref) {
SetAutoclickDelayPref(kTestAutoclickDelayMs);
EXPECT_EQ(default_autoclick_delay(), GetAutoclickDelay());
+ // Sets the pref to enable spoken feedback before login.
+ SetSpokenFeedbackEnabledPref(true);
+ // Spoken feedback is enabled since it it the system-wide setting.
+ EXPECT_TRUE(IsSpokenFeedbackEnabled());
+
// Logs in.
UserManager::Get()->SessionStarted();
// Confirms that features are enabled by restring from pref just after login.
EXPECT_TRUE(IsLargeCursorEnabled());
- EXPECT_TRUE(IsSpokenFeedbackEnabled());
EXPECT_TRUE(IsHighContrastEnabled());
EXPECT_TRUE(IsAutoclickEnabled());
EXPECT_EQ(kTestAutoclickDelayMs, GetAutoclickDelay());
+
+ // Spoken feedback is still enabled since it it the system-wide setting.
+ EXPECT_TRUE(IsSpokenFeedbackEnabled());
}
IN_PROC_BROWSER_TEST_F(AccessibilityManagerTest,

Powered by Google App Engine
This is Rietveld 408576698