OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |