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

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

Issue 19052005: Move PathIsWritable, DirectoryExists, ContentsEqual, and TextContentsEqual to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
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 "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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/policy/cloud/resource_cache.cc ('k') | chrome/browser/profiles/profile_info_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698