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

Side by Side Diff: chrome/browser/prefs/chrome_pref_service_unittest.cc

Issue 2293373002: Remove unused prefs/api/resource for setPageEncoding (Closed)
Patch Set: reverted TextResourceDecoder Created 4 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 unified diff | Download patch
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 <memory> 5 #include <memory>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/files/scoped_temp_dir.h" 9 #include "base/files/scoped_temp_dir.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 101
102 // Set some (WebKit) user preferences. 102 // Set some (WebKit) user preferences.
103 syncable_prefs::TestingPrefServiceSyncable* pref_services = 103 syncable_prefs::TestingPrefServiceSyncable* pref_services =
104 profile()->GetTestingPrefService(); 104 profile()->GetTestingPrefService();
105 pref_services->SetUserPref(prefs::kDefaultCharset, 105 pref_services->SetUserPref(prefs::kDefaultCharset,
106 new base::StringValue("utf8")); 106 new base::StringValue("utf8"));
107 pref_services->SetUserPref(prefs::kWebKitDefaultFontSize, 107 pref_services->SetUserPref(prefs::kWebKitDefaultFontSize,
108 new base::FundamentalValue(20)); 108 new base::FundamentalValue(20));
109 pref_services->SetUserPref(prefs::kWebKitTextAreasAreResizable, 109 pref_services->SetUserPref(prefs::kWebKitTextAreasAreResizable,
110 new base::FundamentalValue(false)); 110 new base::FundamentalValue(false));
111 pref_services->SetUserPref(prefs::kWebKitUsesUniversalDetector,
112 new base::FundamentalValue(true));
113 pref_services->SetUserPref("webkit.webprefs.foo", 111 pref_services->SetUserPref("webkit.webprefs.foo",
114 new base::StringValue("bar")); 112 new base::StringValue("bar"));
115 } 113 }
116 }; 114 };
117 115
118 // Tests to see that webkit preferences are properly loaded and copied over 116 // Tests to see that webkit preferences are properly loaded and copied over
119 // to a WebPreferences object. 117 // to a WebPreferences object.
120 TEST_F(ChromePrefServiceWebKitPrefs, PrefsCopied) { 118 TEST_F(ChromePrefServiceWebKitPrefs, PrefsCopied) {
121 WebPreferences webkit_prefs = 119 WebPreferences webkit_prefs =
122 RenderViewHostTester::For(rvh())->TestComputeWebkitPrefs(); 120 RenderViewHostTester::For(rvh())->TestComputeWebkitPrefs();
123 121
124 // These values have been overridden by the profile preferences. 122 // These values have been overridden by the profile preferences.
125 EXPECT_EQ("UTF-8", webkit_prefs.default_encoding); 123 EXPECT_EQ("UTF-8", webkit_prefs.default_encoding);
126 EXPECT_EQ(20, webkit_prefs.default_font_size); 124 EXPECT_EQ(20, webkit_prefs.default_font_size);
127 EXPECT_FALSE(webkit_prefs.text_areas_are_resizable); 125 EXPECT_FALSE(webkit_prefs.text_areas_are_resizable);
128 EXPECT_TRUE(webkit_prefs.uses_universal_detector);
129 126
130 // These should still be the default values. 127 // These should still be the default values.
131 #if defined(OS_MACOSX) 128 #if defined(OS_MACOSX)
132 const char kDefaultFont[] = "Times"; 129 const char kDefaultFont[] = "Times";
133 #elif defined(OS_CHROMEOS) 130 #elif defined(OS_CHROMEOS)
134 const char kDefaultFont[] = "Tinos"; 131 const char kDefaultFont[] = "Tinos";
135 #else 132 #else
136 const char kDefaultFont[] = "Times New Roman"; 133 const char kDefaultFont[] = "Times New Roman";
137 #endif 134 #endif
138 EXPECT_EQ(base::ASCIIToUTF16(kDefaultFont), 135 EXPECT_EQ(base::ASCIIToUTF16(kDefaultFont),
139 webkit_prefs.standard_font_family_map[prefs::kWebKitCommonScript]); 136 webkit_prefs.standard_font_family_map[prefs::kWebKitCommonScript]);
140 EXPECT_TRUE(webkit_prefs.javascript_enabled); 137 EXPECT_TRUE(webkit_prefs.javascript_enabled);
141 } 138 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698