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 <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
(...skipping 1253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1264 | 1264 |
1265 // Check by initializing empty address. | 1265 // Check by initializing empty address. |
1266 IPAddress initial_address; | 1266 IPAddress initial_address; |
1267 impl_.InitializeSupportsQuic(&initial_address); | 1267 impl_.InitializeSupportsQuic(&initial_address); |
1268 | 1268 |
1269 IPAddress address; | 1269 IPAddress address; |
1270 EXPECT_FALSE(impl_.GetSupportsQuic(&address)); | 1270 EXPECT_FALSE(impl_.GetSupportsQuic(&address)); |
1271 EXPECT_TRUE(address.empty()); | 1271 EXPECT_TRUE(address.empty()); |
1272 | 1272 |
1273 // Check by initializing with a valid address. | 1273 // Check by initializing with a valid address. |
1274 CHECK(initial_address.AssignFromIPLiteral("127.0.0.1")); | 1274 initial_address = IPAddress::IPv4Localhost(); |
1275 impl_.InitializeSupportsQuic(&initial_address); | 1275 impl_.InitializeSupportsQuic(&initial_address); |
1276 | 1276 |
1277 EXPECT_TRUE(impl_.GetSupportsQuic(&address)); | 1277 EXPECT_TRUE(impl_.GetSupportsQuic(&address)); |
1278 EXPECT_EQ(initial_address, address); | 1278 EXPECT_EQ(initial_address, address); |
1279 } | 1279 } |
1280 | 1280 |
1281 TEST_F(SupportsQuicServerPropertiesTest, SetSupportsQuic) { | 1281 TEST_F(SupportsQuicServerPropertiesTest, SetSupportsQuic) { |
1282 IPAddress address; | 1282 IPAddress address; |
1283 EXPECT_FALSE(impl_.GetSupportsQuic(&address)); | 1283 EXPECT_FALSE(impl_.GetSupportsQuic(&address)); |
1284 EXPECT_TRUE(address.empty()); | 1284 EXPECT_TRUE(address.empty()); |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1483 EXPECT_EQ(quic_server_info1, *(impl_.GetQuicServerInfo(quic_server_id))); | 1483 EXPECT_EQ(quic_server_info1, *(impl_.GetQuicServerInfo(quic_server_id))); |
1484 | 1484 |
1485 impl_.Clear(); | 1485 impl_.Clear(); |
1486 EXPECT_EQ(0u, impl_.quic_server_info_map().size()); | 1486 EXPECT_EQ(0u, impl_.quic_server_info_map().size()); |
1487 EXPECT_EQ(nullptr, impl_.GetQuicServerInfo(quic_server_id)); | 1487 EXPECT_EQ(nullptr, impl_.GetQuicServerInfo(quic_server_id)); |
1488 } | 1488 } |
1489 | 1489 |
1490 } // namespace | 1490 } // namespace |
1491 | 1491 |
1492 } // namespace net | 1492 } // namespace net |
OLD | NEW |