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

Unified Diff: chrome/browser/prefs/pref_service_unittest.cc

Issue 7890060: This broke lots of layout tests on OSX. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 3 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
« no previous file with comments | « chrome/browser/autofill/autofill_regexes.cc ('k') | chrome/browser/themes/browser_theme_pack.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prefs/pref_service_unittest.cc
===================================================================
--- chrome/browser/prefs/pref_service_unittest.cc (revision 101223)
+++ chrome/browser/prefs/pref_service_unittest.cc (working copy)
@@ -27,6 +27,31 @@
using testing::_;
using testing::Mock;
+// TODO(port): port this test to POSIX.
+#if defined(OS_WIN)
+TEST(PrefServiceTest, LocalizedPrefs) {
+ TestingPrefService prefs;
+ const char kBoolean[] = "boolean";
+ const char kInteger[] = "integer";
+ const char kString[] = "string";
+ prefs.RegisterLocalizedBooleanPref(kBoolean, IDS_LOCALE_BOOL);
+ prefs.RegisterLocalizedIntegerPref(kInteger, IDS_LOCALE_INT);
+ prefs.RegisterLocalizedStringPref(kString, IDS_LOCALE_STRING);
+
+ // The locale default should take preference over the user default.
+ EXPECT_FALSE(prefs.GetBoolean(kBoolean));
+ EXPECT_EQ(1, prefs.GetInteger(kInteger));
+ EXPECT_EQ("hello", prefs.GetString(kString));
+
+ prefs.SetBoolean(kBoolean, true);
+ EXPECT_TRUE(prefs.GetBoolean(kBoolean));
+ prefs.SetInteger(kInteger, 5);
+ EXPECT_EQ(5, prefs.GetInteger(kInteger));
+ prefs.SetString(kString, "foo");
+ EXPECT_EQ("foo", prefs.GetString(kString));
+}
+#endif
+
TEST(PrefServiceTest, NoObserverFire) {
TestingPrefService prefs;
« no previous file with comments | « chrome/browser/autofill/autofill_regexes.cc ('k') | chrome/browser/themes/browser_theme_pack.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698