| 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 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 // BackwardsCompat_vXX tests. | 366 // BackwardsCompat_vXX tests. |
| 367 return; | 367 return; |
| 368 | 368 |
| 369 ExplodedPageState state; | 369 ExplodedPageState state; |
| 370 PopulatePageStateForBackwardsCompatTest(&state); | 370 PopulatePageStateForBackwardsCompatTest(&state); |
| 371 | 371 |
| 372 std::string encoded; | 372 std::string encoded; |
| 373 EXPECT_TRUE(EncodePageState(state, &encoded)); | 373 EXPECT_TRUE(EncodePageState(state, &encoded)); |
| 374 | 374 |
| 375 std::string base64; | 375 std::string base64; |
| 376 EXPECT_TRUE(base::Base64Encode(encoded, &base64)); | 376 base::Base64Encode(encoded, &base64); |
| 377 | 377 |
| 378 base::FilePath path; | 378 base::FilePath path; |
| 379 PathService::Get(base::DIR_TEMP, &path); | 379 PathService::Get(base::DIR_TEMP, &path); |
| 380 path = path.AppendASCII("expected.dat"); | 380 path = path.AppendASCII("expected.dat"); |
| 381 | 381 |
| 382 FILE* fp = base::OpenFile(path, "wb"); | 382 FILE* fp = base::OpenFile(path, "wb"); |
| 383 ASSERT_TRUE(fp); | 383 ASSERT_TRUE(fp); |
| 384 | 384 |
| 385 const size_t kRowSize = 76; | 385 const size_t kRowSize = 76; |
| 386 for (size_t offset = 0; offset < base64.size(); offset += kRowSize) { | 386 for (size_t offset = 0; offset < base64.size(); offset += kRowSize) { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 416 TEST_F(PageStateSerializationTest, BackwardsCompat_v15) { | 416 TEST_F(PageStateSerializationTest, BackwardsCompat_v15) { |
| 417 TestBackwardsCompat(15); | 417 TestBackwardsCompat(15); |
| 418 } | 418 } |
| 419 | 419 |
| 420 TEST_F(PageStateSerializationTest, BackwardsCompat_v16) { | 420 TEST_F(PageStateSerializationTest, BackwardsCompat_v16) { |
| 421 TestBackwardsCompat(16); | 421 TestBackwardsCompat(16); |
| 422 } | 422 } |
| 423 | 423 |
| 424 } // namespace | 424 } // namespace |
| 425 } // namespace content | 425 } // namespace content |
| OLD | NEW |