| 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/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 | 408 |
| 409 impl_.SetAlternateProtocol(canonical_port_pair, | 409 impl_.SetAlternateProtocol(canonical_port_pair, |
| 410 canonical_protocol.port, | 410 canonical_protocol.port, |
| 411 canonical_protocol.protocol); | 411 canonical_protocol.protocol); |
| 412 // Verify the forced protocol. | 412 // Verify the forced protocol. |
| 413 ASSERT_TRUE(impl_.HasAlternateProtocol(test_host_port_pair)); | 413 ASSERT_TRUE(impl_.HasAlternateProtocol(test_host_port_pair)); |
| 414 PortAlternateProtocolPair alternate = | 414 PortAlternateProtocolPair alternate = |
| 415 impl_.GetAlternateProtocol(test_host_port_pair); | 415 impl_.GetAlternateProtocol(test_host_port_pair); |
| 416 EXPECT_EQ(canonical_protocol.port, alternate.port); | 416 EXPECT_EQ(canonical_protocol.port, alternate.port); |
| 417 EXPECT_EQ(canonical_protocol.protocol, alternate.protocol); | 417 EXPECT_EQ(canonical_protocol.protocol, alternate.protocol); |
| 418 |
| 419 // Verify the canonical suffix. |
| 420 EXPECT_EQ(".c.youtube.com", impl_.GetCanonicalSuffix(test_host_port_pair)); |
| 421 EXPECT_EQ(".c.youtube.com", impl_.GetCanonicalSuffix(canonical_port_pair)); |
| 418 } | 422 } |
| 419 | 423 |
| 420 typedef HttpServerPropertiesImplTest SpdySettingsServerPropertiesTest; | 424 typedef HttpServerPropertiesImplTest SpdySettingsServerPropertiesTest; |
| 421 | 425 |
| 422 TEST_F(SpdySettingsServerPropertiesTest, Initialize) { | 426 TEST_F(SpdySettingsServerPropertiesTest, Initialize) { |
| 423 HostPortPair spdy_server_google("www.google.com", 443); | 427 HostPortPair spdy_server_google("www.google.com", 443); |
| 424 | 428 |
| 425 // Check by initializing empty spdy settings. | 429 // Check by initializing empty spdy settings. |
| 426 SpdySettingsMap spdy_settings_map(SpdySettingsMap::NO_AUTO_EVICT); | 430 SpdySettingsMap spdy_settings_map(SpdySettingsMap::NO_AUTO_EVICT); |
| 427 impl_.InitializeSpdySettingsServers(&spdy_settings_map); | 431 impl_.InitializeSpdySettingsServers(&spdy_settings_map); |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 it1_ret = settings_map1_it_ret.find(id1); | 604 it1_ret = settings_map1_it_ret.find(id1); |
| 601 EXPECT_TRUE(it1_ret != settings_map1_it_ret.end()); | 605 EXPECT_TRUE(it1_ret != settings_map1_it_ret.end()); |
| 602 flags_and_value1_ret = it1_ret->second; | 606 flags_and_value1_ret = it1_ret->second; |
| 603 EXPECT_EQ(SETTINGS_FLAG_PERSISTED, flags_and_value1_ret.first); | 607 EXPECT_EQ(SETTINGS_FLAG_PERSISTED, flags_and_value1_ret.first); |
| 604 EXPECT_EQ(value1, flags_and_value1_ret.second); | 608 EXPECT_EQ(value1, flags_and_value1_ret.second); |
| 605 } | 609 } |
| 606 | 610 |
| 607 } // namespace | 611 } // namespace |
| 608 | 612 |
| 609 } // namespace net | 613 } // namespace net |
| OLD | NEW |