| OLD | NEW |
| 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 }; | 114 }; |
| 115 | 115 |
| 116 // 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 |
| 117 // to a WebPreferences object. | 117 // to a WebPreferences object. |
| 118 TEST_F(ChromePrefServiceWebKitPrefs, PrefsCopied) { | 118 TEST_F(ChromePrefServiceWebKitPrefs, PrefsCopied) { |
| 119 WebPreferences webkit_prefs = | 119 WebPreferences webkit_prefs = |
| 120 RenderViewHostTester::For(rvh())->TestComputeWebkitPrefs(); | 120 RenderViewHostTester::For(rvh())->TestComputeWebkitPrefs(); |
| 121 | 121 |
| 122 // These values have been overridden by the profile preferences. | 122 // These values have been overridden by the profile preferences. |
| 123 EXPECT_EQ("UTF-8", webkit_prefs.default_encoding); | 123 EXPECT_EQ("UTF-8", webkit_prefs.default_encoding); |
| 124 #if !defined(OS_ANDROID) |
| 124 EXPECT_EQ(20, webkit_prefs.default_font_size); | 125 EXPECT_EQ(20, webkit_prefs.default_font_size); |
| 126 #else |
| 127 // This pref is not configurable on Android so the default of 16 is always |
| 128 // used. |
| 129 EXPECT_EQ(16, webkit_prefs.default_font_size); |
| 130 #endif |
| 125 EXPECT_FALSE(webkit_prefs.text_areas_are_resizable); | 131 EXPECT_FALSE(webkit_prefs.text_areas_are_resizable); |
| 126 | 132 |
| 127 // These should still be the default values. | 133 // These should still be the default values. |
| 128 #if defined(OS_MACOSX) | 134 #if defined(OS_MACOSX) |
| 129 const char kDefaultFont[] = "Times"; | 135 const char kDefaultFont[] = "Times"; |
| 130 #elif defined(OS_CHROMEOS) | 136 #elif defined(OS_CHROMEOS) |
| 131 const char kDefaultFont[] = "Tinos"; | 137 const char kDefaultFont[] = "Tinos"; |
| 132 #else | 138 #else |
| 133 const char kDefaultFont[] = "Times New Roman"; | 139 const char kDefaultFont[] = "Times New Roman"; |
| 134 #endif | 140 #endif |
| 135 EXPECT_EQ(base::ASCIIToUTF16(kDefaultFont), | 141 EXPECT_EQ(base::ASCIIToUTF16(kDefaultFont), |
| 136 webkit_prefs.standard_font_family_map[prefs::kWebKitCommonScript]); | 142 webkit_prefs.standard_font_family_map[prefs::kWebKitCommonScript]); |
| 137 EXPECT_TRUE(webkit_prefs.javascript_enabled); | 143 EXPECT_TRUE(webkit_prefs.javascript_enabled); |
| 138 } | 144 } |
| OLD | NEW |