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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/prefs/pref_registry_simple.h" | 10 #include "base/prefs/pref_registry_simple.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 ClearDictionaryValue(prefs.get(), "dict_needs_empty_value"); | 131 ClearDictionaryValue(prefs.get(), "dict_needs_empty_value"); |
132 | 132 |
133 // Write to file. | 133 // Write to file. |
134 prefs->CommitPendingWrite(); | 134 prefs->CommitPendingWrite(); |
135 message_loop_.RunUntilIdle(); | 135 message_loop_.RunUntilIdle(); |
136 | 136 |
137 // Compare to expected output. | 137 // Compare to expected output. |
138 base::FilePath golden_output_file = | 138 base::FilePath golden_output_file = |
139 data_dir_.AppendASCII("write.golden.need_empty_value.json"); | 139 data_dir_.AppendASCII("write.golden.need_empty_value.json"); |
140 ASSERT_TRUE(base::PathExists(golden_output_file)); | 140 ASSERT_TRUE(base::PathExists(golden_output_file)); |
141 EXPECT_TRUE(file_util::TextContentsEqual(golden_output_file, pref_file)); | 141 EXPECT_TRUE(base::TextContentsEqual(golden_output_file, pref_file)); |
142 } | 142 } |
143 | 143 |
144 class ChromePrefServiceWebKitPrefs : public ChromeRenderViewHostTestHarness { | 144 class ChromePrefServiceWebKitPrefs : public ChromeRenderViewHostTestHarness { |
145 protected: | 145 protected: |
146 virtual void SetUp() { | 146 virtual void SetUp() { |
147 ChromeRenderViewHostTestHarness::SetUp(); | 147 ChromeRenderViewHostTestHarness::SetUp(); |
148 | 148 |
149 // Supply our own profile so we use the correct profile data. The test | 149 // Supply our own profile so we use the correct profile data. The test |
150 // harness is not supposed to overwrite a profile if it's already created. | 150 // harness is not supposed to overwrite a profile if it's already created. |
151 | 151 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 const char kDefaultFont[] = "Times"; | 186 const char kDefaultFont[] = "Times"; |
187 #elif defined(OS_CHROMEOS) | 187 #elif defined(OS_CHROMEOS) |
188 const char kDefaultFont[] = "Tinos"; | 188 const char kDefaultFont[] = "Tinos"; |
189 #else | 189 #else |
190 const char kDefaultFont[] = "Times New Roman"; | 190 const char kDefaultFont[] = "Times New Roman"; |
191 #endif | 191 #endif |
192 EXPECT_EQ(ASCIIToUTF16(kDefaultFont), | 192 EXPECT_EQ(ASCIIToUTF16(kDefaultFont), |
193 webkit_prefs.standard_font_family_map[prefs::kWebKitCommonScript]); | 193 webkit_prefs.standard_font_family_map[prefs::kWebKitCommonScript]); |
194 EXPECT_TRUE(webkit_prefs.javascript_enabled); | 194 EXPECT_TRUE(webkit_prefs.javascript_enabled); |
195 } | 195 } |
OLD | NEW |