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

Side by Side Diff: content/common/page_state_serialization_unittest.cc

Issue 19579005: Move ReadFileToString to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 <math.h> 5 #include <math.h>
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/pickle.h" 10 #include "base/pickle.h"
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 if (version == 11) 209 if (version == 11)
210 suffix = "_android"; 210 suffix = "_android";
211 #endif 211 #endif
212 212
213 base::FilePath path; 213 base::FilePath path;
214 PathService::Get(content::DIR_TEST_DATA, &path); 214 PathService::Get(content::DIR_TEST_DATA, &path);
215 path = path.AppendASCII("page_state").AppendASCII( 215 path = path.AppendASCII("page_state").AppendASCII(
216 base::StringPrintf("serialized_v%d%s.dat", version, suffix)); 216 base::StringPrintf("serialized_v%d%s.dat", version, suffix));
217 217
218 std::string file_contents; 218 std::string file_contents;
219 if (!file_util::ReadFileToString(path, &file_contents)) { 219 if (!base::ReadFileToString(path, &file_contents)) {
220 ADD_FAILURE() << "File not found: " << path.value(); 220 ADD_FAILURE() << "File not found: " << path.value();
221 return; 221 return;
222 } 222 }
223 223
224 std::string trimmed_contents; 224 std::string trimmed_contents;
225 EXPECT_TRUE(RemoveChars(file_contents, "\r\n", &trimmed_contents)); 225 EXPECT_TRUE(RemoveChars(file_contents, "\r\n", &trimmed_contents));
226 226
227 std::string encoded; 227 std::string encoded;
228 EXPECT_TRUE(base::Base64Decode(trimmed_contents, &encoded)); 228 EXPECT_TRUE(base::Base64Decode(trimmed_contents, &encoded));
229 229
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 TEST_F(PageStateSerializationTest, BackwardsCompat_v13) { 422 TEST_F(PageStateSerializationTest, BackwardsCompat_v13) {
423 TestBackwardsCompat(13); 423 TestBackwardsCompat(13);
424 } 424 }
425 425
426 TEST_F(PageStateSerializationTest, BackwardsCompat_v14) { 426 TEST_F(PageStateSerializationTest, BackwardsCompat_v14) {
427 TestBackwardsCompat(14); 427 TestBackwardsCompat(14);
428 } 428 }
429 429
430 } // namespace 430 } // namespace
431 } // namespace content 431 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/media/video_decode_accelerator_unittest.cc ('k') | content/common/plugin_list_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698