| 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 <cmath> |
| 6 | 6 |
| 7 #include "base/base64.h" | 7 #include "base/base64.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/float_util.h" | |
| 10 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 11 #include "base/pickle.h" | 10 #include "base/pickle.h" |
| 12 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
| 13 #include "base/strings/stringprintf.h" | 12 #include "base/strings/stringprintf.h" |
| 14 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
| 15 #include "content/common/page_state_serialization.h" | 14 #include "content/common/page_state_serialization.h" |
| 16 #include "content/public/common/content_paths.h" | 15 #include "content/public/common/content_paths.h" |
| 17 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 18 | 17 |
| 19 namespace content { | 18 namespace content { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 40 | 39 |
| 41 template <> | 40 template <> |
| 42 void ExpectEquality(const ExplodedHttpBodyElement& a, | 41 void ExpectEquality(const ExplodedHttpBodyElement& a, |
| 43 const ExplodedHttpBodyElement& b) { | 42 const ExplodedHttpBodyElement& b) { |
| 44 EXPECT_EQ(a.type, b.type); | 43 EXPECT_EQ(a.type, b.type); |
| 45 EXPECT_EQ(a.data, b.data); | 44 EXPECT_EQ(a.data, b.data); |
| 46 EXPECT_EQ(a.file_path, b.file_path); | 45 EXPECT_EQ(a.file_path, b.file_path); |
| 47 EXPECT_EQ(a.filesystem_url, b.filesystem_url); | 46 EXPECT_EQ(a.filesystem_url, b.filesystem_url); |
| 48 EXPECT_EQ(a.file_start, b.file_start); | 47 EXPECT_EQ(a.file_start, b.file_start); |
| 49 EXPECT_EQ(a.file_length, b.file_length); | 48 EXPECT_EQ(a.file_length, b.file_length); |
| 50 if (!(base::IsNaN(a.file_modification_time) && | 49 if (!(std::isnan(a.file_modification_time) && |
| 51 base::IsNaN(b.file_modification_time))) { | 50 std::isnan(b.file_modification_time))) { |
| 52 EXPECT_DOUBLE_EQ(a.file_modification_time, b.file_modification_time); | 51 EXPECT_DOUBLE_EQ(a.file_modification_time, b.file_modification_time); |
| 53 } | 52 } |
| 54 EXPECT_EQ(a.blob_uuid, b.blob_uuid); | 53 EXPECT_EQ(a.blob_uuid, b.blob_uuid); |
| 55 } | 54 } |
| 56 | 55 |
| 57 template <> | 56 template <> |
| 58 void ExpectEquality(const ExplodedHttpBody& a, const ExplodedHttpBody& b) { | 57 void ExpectEquality(const ExplodedHttpBody& a, const ExplodedHttpBody& b) { |
| 59 EXPECT_EQ(a.http_content_type, b.http_content_type); | 58 EXPECT_EQ(a.http_content_type, b.http_content_type); |
| 60 EXPECT_EQ(a.identifier, b.identifier); | 59 EXPECT_EQ(a.identifier, b.identifier); |
| 61 EXPECT_EQ(a.contains_passwords, b.contains_passwords); | 60 EXPECT_EQ(a.contains_passwords, b.contains_passwords); |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 TEST_F(PageStateSerializationTest, BackwardsCompat_v18) { | 423 TEST_F(PageStateSerializationTest, BackwardsCompat_v18) { |
| 425 TestBackwardsCompat(18); | 424 TestBackwardsCompat(18); |
| 426 } | 425 } |
| 427 | 426 |
| 428 TEST_F(PageStateSerializationTest, BackwardsCompat_v20) { | 427 TEST_F(PageStateSerializationTest, BackwardsCompat_v20) { |
| 429 TestBackwardsCompat(20); | 428 TestBackwardsCompat(20); |
| 430 } | 429 } |
| 431 | 430 |
| 432 } // namespace | 431 } // namespace |
| 433 } // namespace content | 432 } // namespace content |
| OLD | NEW |