| 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 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 | 468 |
| 469 impl_.SetAlternateProtocol(canonical_port_pair, | 469 impl_.SetAlternateProtocol(canonical_port_pair, |
| 470 canonical_protocol.port, | 470 canonical_protocol.port, |
| 471 canonical_protocol.protocol, | 471 canonical_protocol.protocol, |
| 472 canonical_protocol.probability); | 472 canonical_protocol.probability); |
| 473 | 473 |
| 474 impl_.SetBrokenAlternateProtocol(canonical_port_pair); | 474 impl_.SetBrokenAlternateProtocol(canonical_port_pair); |
| 475 EXPECT_FALSE(impl_.HasAlternateProtocol(test_host_port_pair)); | 475 EXPECT_FALSE(impl_.HasAlternateProtocol(test_host_port_pair)); |
| 476 } | 476 } |
| 477 | 477 |
| 478 TEST_F(AlternateProtocolServerPropertiesTest, CanonicalBroken2) { |
| 479 HostPortPair test_host_port_pair("foo.c.youtube.com", 80); |
| 480 HostPortPair canonical_port_pair("bar.c.youtube.com", 80); |
| 481 |
| 482 AlternateProtocolInfo canonical_protocol(1234, QUIC, 1); |
| 483 |
| 484 impl_.SetAlternateProtocol(canonical_port_pair, |
| 485 canonical_protocol.port, |
| 486 canonical_protocol.protocol, |
| 487 canonical_protocol.probability); |
| 488 |
| 489 impl_.SetBrokenAlternateProtocol(test_host_port_pair); |
| 490 AlternateProtocolInfo alternate = |
| 491 impl_.GetAlternateProtocol(test_host_port_pair); |
| 492 EXPECT_TRUE(alternate.is_broken); |
| 493 } |
| 494 |
| 478 TEST_F(AlternateProtocolServerPropertiesTest, ClearWithCanonical) { | 495 TEST_F(AlternateProtocolServerPropertiesTest, ClearWithCanonical) { |
| 479 HostPortPair test_host_port_pair("foo.c.youtube.com", 80); | 496 HostPortPair test_host_port_pair("foo.c.youtube.com", 80); |
| 480 HostPortPair canonical_port_pair("bar.c.youtube.com", 80); | 497 HostPortPair canonical_port_pair("bar.c.youtube.com", 80); |
| 481 | 498 |
| 482 AlternateProtocolInfo canonical_protocol(1234, QUIC, 1); | 499 AlternateProtocolInfo canonical_protocol(1234, QUIC, 1); |
| 483 | 500 |
| 484 impl_.SetAlternateProtocol(canonical_port_pair, | 501 impl_.SetAlternateProtocol(canonical_port_pair, |
| 485 canonical_protocol.port, | 502 canonical_protocol.port, |
| 486 canonical_protocol.protocol, | 503 canonical_protocol.protocol, |
| 487 canonical_protocol.probability); | 504 canonical_protocol.probability); |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 710 EXPECT_EQ("foo", supports_quic1.address); | 727 EXPECT_EQ("foo", supports_quic1.address); |
| 711 | 728 |
| 712 impl_.Clear(); | 729 impl_.Clear(); |
| 713 SupportsQuic supports_quic2 = impl_.GetSupportsQuic(test_host_port_pair); | 730 SupportsQuic supports_quic2 = impl_.GetSupportsQuic(test_host_port_pair); |
| 714 EXPECT_FALSE(supports_quic2.used_quic); | 731 EXPECT_FALSE(supports_quic2.used_quic); |
| 715 EXPECT_EQ("", supports_quic2.address); | 732 EXPECT_EQ("", supports_quic2.address); |
| 716 } | 733 } |
| 717 } // namespace | 734 } // namespace |
| 718 | 735 |
| 719 } // namespace net | 736 } // namespace net |
| OLD | NEW |