| Index: net/http/http_server_properties_manager_unittest.cc
|
| diff --git a/net/http/http_server_properties_manager_unittest.cc b/net/http/http_server_properties_manager_unittest.cc
|
| index bf83ff78ec62e4d07d8c9a54a81862e43e576307..072f5d9644b45420a5bb47044e767887937fa9fc 100644
|
| --- a/net/http/http_server_properties_manager_unittest.cc
|
| +++ b/net/http/http_server_properties_manager_unittest.cc
|
| @@ -18,7 +18,6 @@
|
| #include "net/base/ip_address.h"
|
| #include "testing/gmock/include/gmock/gmock.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| -#include "url/gurl.h"
|
|
|
| namespace net {
|
|
|
| @@ -233,7 +232,9 @@ TEST_P(HttpServerPropertiesManagerTest,
|
|
|
| base::DictionaryValue* server_pref_dict = new base::DictionaryValue;
|
| HostPortPair google_server("www.google.com", 80);
|
| + url::SchemeHostPort google_scheme_host_port("http", "www.google.com", 80);
|
| HostPortPair mail_server("mail.google.com", 80);
|
| + url::SchemeHostPort mail_scheme_host_port("http", "mail.google.com", 80);
|
|
|
| // Set supports_spdy for www.google.com:80.
|
| server_pref_dict->SetBoolean("supports_spdy", true);
|
| @@ -347,11 +348,16 @@ TEST_P(HttpServerPropertiesManagerTest,
|
| Mock::VerifyAndClearExpectations(http_server_props_manager_.get());
|
|
|
| // Verify SupportsSpdy.
|
| - EXPECT_TRUE(
|
| - http_server_props_manager_->SupportsRequestPriority(google_server));
|
| - EXPECT_TRUE(http_server_props_manager_->SupportsRequestPriority(mail_server));
|
| + EXPECT_TRUE(http_server_props_manager_->SupportsRequestPriority(
|
| + google_scheme_host_port));
|
| + EXPECT_TRUE(http_server_props_manager_->SupportsRequestPriority(
|
| + mail_scheme_host_port));
|
| + HostPortPair foo_server = HostPortPair::FromString("foo.google.com:1337");
|
| + url::SchemeHostPort foo_scheme_host_port("http", foo_server.host(),
|
| + foo_server.port());
|
| +
|
| EXPECT_FALSE(http_server_props_manager_->SupportsRequestPriority(
|
| - HostPortPair::FromString("foo.google.com:1337")));
|
| + foo_scheme_host_port));
|
|
|
| // Verify alternative service.
|
| if (GetParam() == 4) {
|
| @@ -488,8 +494,12 @@ TEST_P(HttpServerPropertiesManagerTest, BadCachedHostPortPair) {
|
| Mock::VerifyAndClearExpectations(http_server_props_manager_.get());
|
|
|
| // Verify that nothing is set.
|
| + HostPortPair google_server = HostPortPair::FromString("www.google.com:65536");
|
| + url::SchemeHostPort google_scheme_host_port("http", google_server.host(),
|
| + google_server.port());
|
| +
|
| EXPECT_FALSE(http_server_props_manager_->SupportsRequestPriority(
|
| - HostPortPair::FromString("www.google.com:65536")));
|
| + google_scheme_host_port));
|
| EXPECT_FALSE(
|
| HasAlternativeService(HostPortPair::FromString("www.google.com:65536")));
|
| const ServerNetworkStats* stats1 =
|
| @@ -557,17 +567,17 @@ TEST_P(HttpServerPropertiesManagerTest, SupportsSpdy) {
|
|
|
| // Add mail.google.com:443 as a supporting spdy server.
|
| HostPortPair spdy_server_mail("mail.google.com", 443);
|
| + url::SchemeHostPort spdy_server("https", "mail.google.com", 443);
|
| EXPECT_FALSE(
|
| - http_server_props_manager_->SupportsRequestPriority(spdy_server_mail));
|
| - http_server_props_manager_->SetSupportsSpdy(spdy_server_mail, true);
|
| + http_server_props_manager_->SupportsRequestPriority(spdy_server));
|
| + http_server_props_manager_->SetSupportsSpdy(spdy_server, true);
|
| // ExpectScheduleUpdatePrefsOnNetworkThread() should be called only once.
|
| - http_server_props_manager_->SetSupportsSpdy(spdy_server_mail, true);
|
| + http_server_props_manager_->SetSupportsSpdy(spdy_server, true);
|
|
|
| // Run the task.
|
| base::RunLoop().RunUntilIdle();
|
|
|
| - EXPECT_TRUE(
|
| - http_server_props_manager_->SupportsRequestPriority(spdy_server_mail));
|
| + EXPECT_TRUE(http_server_props_manager_->SupportsRequestPriority(spdy_server));
|
| Mock::VerifyAndClearExpectations(http_server_props_manager_.get());
|
| }
|
|
|
| @@ -883,7 +893,8 @@ TEST_P(HttpServerPropertiesManagerTest, Clear) {
|
| ExpectScheduleUpdatePrefsOnNetworkThreadRepeatedly();
|
|
|
| HostPortPair spdy_server_mail("mail.google.com", 443);
|
| - http_server_props_manager_->SetSupportsSpdy(spdy_server_mail, true);
|
| + url::SchemeHostPort spdy_server("https", "mail.google.com", 443);
|
| + http_server_props_manager_->SetSupportsSpdy(spdy_server, true);
|
| AlternativeService alternative_service(NPN_HTTP_2, "mail.google.com", 1234);
|
| http_server_props_manager_->SetAlternativeService(
|
| spdy_server_mail, alternative_service, one_day_from_now_);
|
| @@ -907,8 +918,7 @@ TEST_P(HttpServerPropertiesManagerTest, Clear) {
|
| // Run the task.
|
| base::RunLoop().RunUntilIdle();
|
|
|
| - EXPECT_TRUE(
|
| - http_server_props_manager_->SupportsRequestPriority(spdy_server_mail));
|
| + EXPECT_TRUE(http_server_props_manager_->SupportsRequestPriority(spdy_server));
|
| EXPECT_TRUE(HasAlternativeService(spdy_server_mail));
|
| IPAddress address;
|
| EXPECT_TRUE(http_server_props_manager_->GetSupportsQuic(&address));
|
| @@ -938,7 +948,7 @@ TEST_P(HttpServerPropertiesManagerTest, Clear) {
|
| base::RunLoop().Run();
|
|
|
| EXPECT_FALSE(
|
| - http_server_props_manager_->SupportsRequestPriority(spdy_server_mail));
|
| + http_server_props_manager_->SupportsRequestPriority(spdy_server));
|
| EXPECT_FALSE(HasAlternativeService(spdy_server_mail));
|
| EXPECT_FALSE(http_server_props_manager_->GetSupportsQuic(&address));
|
| const ServerNetworkStats* stats2 =
|
|
|