summaryrefslogtreecommitdiffstats
path: root/net/http/http_server_properties_manager_unittest.cc
diff options
context:
space:
mode:
authorbnc <bnc@chromium.org>2015-03-20 13:22:22 -0700
committerCommit bot <commit-bot@chromium.org>2015-03-20 20:23:05 +0000
commitcacc0999aef4d12a2e32fc14f651a448a0b83a00 (patch)
treefe66bae711250715a877571f2760167cc096fcdc /net/http/http_server_properties_manager_unittest.cc
parentab7987e2b286aead19236e89718f8cd97b242ec1 (diff)
downloadchromium_src-cacc0999aef4d12a2e32fc14f651a448a0b83a00.zip
chromium_src-cacc0999aef4d12a2e32fc14f651a448a0b83a00.tar.gz
chromium_src-cacc0999aef4d12a2e32fc14f651a448a0b83a00.tar.bz2
Update HttpServerProperties::*AlternateProtocol* interface.
* Rename SetAlternateProtocol, WasAlternateProtocolRecentlyBroken, ConfirmAlternateProtocol, ClearAlternateProtocol methods to *AlternativeService*. * Rename SetBrokenAlternateProtocol to MarkAlternativeServiceBroken. * Make MarkAlternativeServiceBroken, WasAlternativeServiceRecentlyBroken, and ConfirmAlternativeService take |alternative_service| instead of |origin|. * Make SetAlternativeService take |alternative_service| instead of separate |protocol|, |port| arguments. |alternative_service.host| is currently ignored. This CL does not rename SetAlternateProtocolProbabilityThreshold and GetAlternateProtocolProbabilityThreshold methods or alternate_protocol_probability_threshold_ members, that will come later. TBR=pauljensen@chromium.org BUG=392576 Review URL: https://codereview.chromium.org/1018943002 Cr-Commit-Position: refs/heads/master@{#321622}
Diffstat (limited to 'net/http/http_server_properties_manager_unittest.cc')
-rw-r--r--net/http/http_server_properties_manager_unittest.cc26
1 files changed, 15 insertions, 11 deletions
diff --git a/net/http/http_server_properties_manager_unittest.cc b/net/http/http_server_properties_manager_unittest.cc
index e97d3f1..f017815 100644
--- a/net/http/http_server_properties_manager_unittest.cc
+++ b/net/http/http_server_properties_manager_unittest.cc
@@ -467,17 +467,18 @@ TEST_F(HttpServerPropertiesManagerTest, GetAlternativeService) {
HostPortPair spdy_server_mail("mail.google.com", 80);
EXPECT_FALSE(HasAlternativeService(spdy_server_mail));
- http_server_props_manager_->SetAlternateProtocol(spdy_server_mail, 443,
- NPN_SPDY_3, 1.0);
+ AlternativeService alternative_service(NPN_SPDY_3, "mail.google.com", 443);
+ http_server_props_manager_->SetAlternativeService(spdy_server_mail,
+ alternative_service, 1.0);
// Run the task.
base::RunLoop().RunUntilIdle();
Mock::VerifyAndClearExpectations(http_server_props_manager_.get());
- const AlternativeService alternate_protocol =
+ alternative_service =
http_server_props_manager_->GetAlternativeService(spdy_server_mail);
- EXPECT_EQ(443, alternate_protocol.port);
- EXPECT_EQ(NPN_SPDY_3, alternate_protocol.protocol);
+ EXPECT_EQ(443, alternative_service.port);
+ EXPECT_EQ(NPN_SPDY_3, alternative_service.protocol);
}
TEST_F(HttpServerPropertiesManagerTest, SupportsQuic) {
@@ -523,8 +524,9 @@ TEST_F(HttpServerPropertiesManagerTest, Clear) {
HostPortPair spdy_server_mail("mail.google.com", 443);
http_server_props_manager_->SetSupportsSpdy(spdy_server_mail, true);
- http_server_props_manager_->SetAlternateProtocol(spdy_server_mail, 443,
- NPN_SPDY_3, 1.0);
+ AlternativeService alternative_service(NPN_SPDY_3, "mail.google.com", 443);
+ http_server_props_manager_->SetAlternativeService(spdy_server_mail,
+ alternative_service, 1.0);
IPAddressNumber actual_address;
CHECK(ParseIPLiteralToNumber("127.0.0.1", &actual_address));
http_server_props_manager_->SetSupportsQuic(true, actual_address);
@@ -650,10 +652,12 @@ TEST_F(HttpServerPropertiesManagerTest, UpdateCacheWithPrefs) {
const HostPortPair server_mail("mail.google.com", 80);
// Set alternate protocol.
- http_server_props_manager_->SetAlternateProtocol(server_www, 443, NPN_SPDY_3,
- 1.0);
- http_server_props_manager_->SetAlternateProtocol(server_mail, 444,
- NPN_SPDY_3_1, 0.2);
+ AlternativeService www_altsvc(NPN_SPDY_3, "www.google.com", 443);
+ AlternativeService mail_altsvc(NPN_SPDY_3_1, "mail.google.com", 444);
+ http_server_props_manager_->SetAlternativeService(server_www, www_altsvc,
+ 1.0);
+ http_server_props_manager_->SetAlternativeService(server_mail, mail_altsvc,
+ 0.2);
// Set ServerNetworkStats.
ServerNetworkStats stats;