| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_server_properties_impl.h" | 5 #include "net/http/http_server_properties_impl.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 namespace { | 60 namespace { |
| 61 | 61 |
| 62 const int kMaxSupportsSpdyServerHosts = 500; | 62 const int kMaxSupportsSpdyServerHosts = 500; |
| 63 | 63 |
| 64 class HttpServerPropertiesImplTest : public testing::Test { | 64 class HttpServerPropertiesImplTest : public testing::Test { |
| 65 protected: | 65 protected: |
| 66 HttpServerPropertiesImplTest() | 66 HttpServerPropertiesImplTest() |
| 67 : test_task_runner_(new base::TestMockTimeTaskRunner()), | 67 : test_task_runner_(new base::TestMockTimeTaskRunner()), |
| 68 broken_services_clock_(test_task_runner_->GetMockTickClock()), | 68 broken_services_clock_(test_task_runner_->GetMockTickClock()) { |
| 69 impl_(broken_services_clock_.get()) {} | 69 impl_.SetBrokenAlternativeServicesTickClockForTesting( |
| 70 broken_services_clock_.get()); |
| 71 } |
| 70 | 72 |
| 71 bool HasAlternativeService(const url::SchemeHostPort& origin) { | 73 bool HasAlternativeService(const url::SchemeHostPort& origin) { |
| 72 const AlternativeServiceInfoVector alternative_service_info_vector = | 74 const AlternativeServiceInfoVector alternative_service_info_vector = |
| 73 impl_.GetAlternativeServiceInfos(origin); | 75 impl_.GetAlternativeServiceInfos(origin); |
| 74 return !alternative_service_info_vector.empty(); | 76 return !alternative_service_info_vector.empty(); |
| 75 } | 77 } |
| 76 | 78 |
| 77 bool SetAlternativeService(const url::SchemeHostPort& origin, | 79 bool SetAlternativeService(const url::SchemeHostPort& origin, |
| 78 const AlternativeService& alternative_service) { | 80 const AlternativeService& alternative_service) { |
| 79 const base::Time expiration = | 81 const base::Time expiration = |
| (...skipping 1248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1328 EXPECT_EQ(quic_server_info1, *(impl_.GetQuicServerInfo(quic_server_id))); | 1330 EXPECT_EQ(quic_server_info1, *(impl_.GetQuicServerInfo(quic_server_id))); |
| 1329 | 1331 |
| 1330 impl_.Clear(); | 1332 impl_.Clear(); |
| 1331 EXPECT_EQ(0u, impl_.quic_server_info_map().size()); | 1333 EXPECT_EQ(0u, impl_.quic_server_info_map().size()); |
| 1332 EXPECT_EQ(nullptr, impl_.GetQuicServerInfo(quic_server_id)); | 1334 EXPECT_EQ(nullptr, impl_.GetQuicServerInfo(quic_server_id)); |
| 1333 } | 1335 } |
| 1334 | 1336 |
| 1335 } // namespace | 1337 } // namespace |
| 1336 | 1338 |
| 1337 } // namespace net | 1339 } // namespace net |
| OLD | NEW |