| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "net/http/http_response_info.h" | 5 #include "net/http/http_response_info.h" |
| 6 | 6 |
| 7 #include "base/pickle.h" | 7 #include "base/pickle.h" |
| 8 #include "net/http/http_response_headers.h" | 8 #include "net/http/http_response_headers.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 EXPECT_FALSE(restored_response_info.unused_since_prefetch); | 45 EXPECT_FALSE(restored_response_info.unused_since_prefetch); |
| 46 } | 46 } |
| 47 | 47 |
| 48 TEST_F(HttpResponseInfoTest, UnusedSincePrefetchPersistTrue) { | 48 TEST_F(HttpResponseInfoTest, UnusedSincePrefetchPersistTrue) { |
| 49 response_info_.unused_since_prefetch = true; | 49 response_info_.unused_since_prefetch = true; |
| 50 HttpResponseInfo restored_response_info; | 50 HttpResponseInfo restored_response_info; |
| 51 PickleAndRestore(response_info_, &restored_response_info); | 51 PickleAndRestore(response_info_, &restored_response_info); |
| 52 EXPECT_TRUE(restored_response_info.unused_since_prefetch); | 52 EXPECT_TRUE(restored_response_info.unused_since_prefetch); |
| 53 } | 53 } |
| 54 | 54 |
| 55 TEST_F(HttpResponseInfoTest, PKPBypassPersistTrue) { |
| 56 response_info_.ssl_info.pkp_bypassed = true; |
| 57 HttpResponseInfo restored_response_info; |
| 58 PickleAndRestore(response_info_, &restored_response_info); |
| 59 EXPECT_TRUE(restored_response_info.ssl_info.pkp_bypassed); |
| 60 } |
| 61 |
| 62 TEST_F(HttpResponseInfoTest, PKPBypassPersistFalse) { |
| 63 response_info_.ssl_info.pkp_bypassed = false; |
| 64 HttpResponseInfo restored_response_info; |
| 65 PickleAndRestore(response_info_, &restored_response_info); |
| 66 EXPECT_FALSE(restored_response_info.ssl_info.pkp_bypassed); |
| 67 } |
| 68 |
| 55 TEST_F(HttpResponseInfoTest, AsyncRevalidationRequiredDefault) { | 69 TEST_F(HttpResponseInfoTest, AsyncRevalidationRequiredDefault) { |
| 56 EXPECT_FALSE(response_info_.async_revalidation_required); | 70 EXPECT_FALSE(response_info_.async_revalidation_required); |
| 57 } | 71 } |
| 58 | 72 |
| 59 TEST_F(HttpResponseInfoTest, AsyncRevalidationRequiredCopy) { | 73 TEST_F(HttpResponseInfoTest, AsyncRevalidationRequiredCopy) { |
| 60 response_info_.async_revalidation_required = true; | 74 response_info_.async_revalidation_required = true; |
| 61 net::HttpResponseInfo response_info_clone(response_info_); | 75 net::HttpResponseInfo response_info_clone(response_info_); |
| 62 EXPECT_TRUE(response_info_clone.async_revalidation_required); | 76 EXPECT_TRUE(response_info_clone.async_revalidation_required); |
| 63 } | 77 } |
| 64 | 78 |
| 65 TEST_F(HttpResponseInfoTest, AsyncRevalidationRequiredAssign) { | 79 TEST_F(HttpResponseInfoTest, AsyncRevalidationRequiredAssign) { |
| 66 response_info_.async_revalidation_required = true; | 80 response_info_.async_revalidation_required = true; |
| 67 net::HttpResponseInfo response_info_clone; | 81 net::HttpResponseInfo response_info_clone; |
| 68 response_info_clone = response_info_; | 82 response_info_clone = response_info_; |
| 69 EXPECT_TRUE(response_info_clone.async_revalidation_required); | 83 EXPECT_TRUE(response_info_clone.async_revalidation_required); |
| 70 } | 84 } |
| 71 | 85 |
| 72 TEST_F(HttpResponseInfoTest, AsyncRevalidationRequiredNotPersisted) { | 86 TEST_F(HttpResponseInfoTest, AsyncRevalidationRequiredNotPersisted) { |
| 73 response_info_.async_revalidation_required = true; | 87 response_info_.async_revalidation_required = true; |
| 74 net::HttpResponseInfo restored_response_info; | 88 net::HttpResponseInfo restored_response_info; |
| 75 PickleAndRestore(response_info_, &restored_response_info); | 89 PickleAndRestore(response_info_, &restored_response_info); |
| 76 EXPECT_FALSE(restored_response_info.async_revalidation_required); | 90 EXPECT_FALSE(restored_response_info.async_revalidation_required); |
| 77 } | 91 } |
| 78 | 92 |
| 79 } // namespace | 93 } // namespace |
| 80 | 94 |
| 81 } // namespace net | 95 } // namespace net |
| OLD | NEW |