| 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 16df3f3cb6bce081c3bcd6011509944816041926..ca55dc4ddf8517301295ac7d66a674332690e8fa 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 {
|
|
|
| @@ -234,6 +233,10 @@ TEST_P(HttpServerPropertiesManagerTest,
|
|
|
| base::DictionaryValue* server_pref_dict = new base::DictionaryValue;
|
| HostPortPair google_server("www.google.com", 80);
|
| + // TODO(zhongyi): change scheme to http once Pref data is also migrated
|
| + // SchemeHostPort.
|
| + url::SchemeHostPort google_scheme_host_port("https", "www.google.com", 80);
|
| + url::SchemeHostPort mail_scheme_host_port("https", "mail.google.com", 80);
|
| HostPortPair mail_server("mail.google.com", 80);
|
|
|
| // Set supports_spdy for www.google.com:80.
|
| @@ -348,11 +351,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) {
|
| @@ -489,8 +497,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 =
|
| @@ -558,17 +570,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());
|
| }
|
|
|
| @@ -884,7 +896,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_);
|
| @@ -908,8 +921,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));
|
| @@ -939,7 +951,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 =
|
|
|