Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(347)

Unified Diff: net/http/http_server_properties_manager_unittest.cc

Issue 2886273002: Change GetAlternativeServies to return alternative service infos. (Closed)
Patch Set: address comments in ps #3 Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/http/http_server_properties_manager.cc ('k') | net/http/http_stream_factory_impl_job_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 7ab1f662a68480e381e808fd411542e4fcfca6e8..0b01a6deb54f78a0bdfc7dc4d828ba39e0a542ef 100644
--- a/net/http/http_server_properties_manager_unittest.cc
+++ b/net/http/http_server_properties_manager_unittest.cc
@@ -225,9 +225,9 @@ class HttpServerPropertiesManagerTest : public testing::TestWithParam<int> {
}
bool HasAlternativeService(const url::SchemeHostPort& server) {
- const AlternativeServiceVector alternative_service_vector =
- http_server_props_manager_->GetAlternativeServices(server);
- return !alternative_service_vector.empty();
+ const AlternativeServiceInfoVector alternative_service_info_vector =
+ http_server_props_manager_->GetAlternativeServiceInfos(server);
+ return !alternative_service_info_vector.empty();
}
MockPrefDelegate* pref_delegate_; // Owned by HttpServerPropertiesManager.
@@ -719,7 +719,7 @@ TEST_P(HttpServerPropertiesManagerTest,
Mock::VerifyAndClearExpectations(http_server_props_manager_.get());
}
-TEST_P(HttpServerPropertiesManagerTest, GetAlternativeServices) {
+TEST_P(HttpServerPropertiesManagerTest, GetAlternativeServiceInfos) {
ExpectPrefsUpdate(1);
ExpectScheduleUpdatePrefsOnNetworkThread();
@@ -744,10 +744,11 @@ TEST_P(HttpServerPropertiesManagerTest, GetAlternativeServices) {
EXPECT_FALSE(net_test_task_runner_->HasPendingTask());
Mock::VerifyAndClearExpectations(http_server_props_manager_.get());
- AlternativeServiceVector alternative_service_vector =
- http_server_props_manager_->GetAlternativeServices(spdy_server_mail);
- ASSERT_EQ(1u, alternative_service_vector.size());
- EXPECT_EQ(alternative_service, alternative_service_vector[0]);
+ AlternativeServiceInfoVector alternative_service_info_vector =
+ http_server_props_manager_->GetAlternativeServiceInfos(spdy_server_mail);
+ ASSERT_EQ(1u, alternative_service_info_vector.size());
+ EXPECT_EQ(alternative_service,
+ alternative_service_info_vector[0].alternative_service);
}
TEST_P(HttpServerPropertiesManagerTest, SetAlternativeServices) {
@@ -782,11 +783,13 @@ TEST_P(HttpServerPropertiesManagerTest, SetAlternativeServices) {
EXPECT_FALSE(net_test_task_runner_->HasPendingTask());
Mock::VerifyAndClearExpectations(http_server_props_manager_.get());
- AlternativeServiceVector alternative_service_vector =
- http_server_props_manager_->GetAlternativeServices(spdy_server_mail);
- ASSERT_EQ(2u, alternative_service_vector.size());
- EXPECT_EQ(alternative_service1, alternative_service_vector[0]);
- EXPECT_EQ(alternative_service2, alternative_service_vector[1]);
+ AlternativeServiceInfoVector alternative_service_info_vector2 =
+ http_server_props_manager_->GetAlternativeServiceInfos(spdy_server_mail);
+ ASSERT_EQ(2u, alternative_service_info_vector2.size());
+ EXPECT_EQ(alternative_service1,
+ alternative_service_info_vector2[0].alternative_service);
+ EXPECT_EQ(alternative_service2,
+ alternative_service_info_vector2[1].alternative_service);
}
TEST_P(HttpServerPropertiesManagerTest, SetAlternativeServicesEmpty) {
@@ -1138,11 +1141,12 @@ TEST_P(HttpServerPropertiesManagerTest, BadSupportsQuic) {
server_gurl = GURL(StringPrintf("https://www.google.com:%d", i));
}
url::SchemeHostPort server(server_gurl);
- AlternativeServiceVector alternative_service_vector =
- http_server_props_manager_->GetAlternativeServices(server);
- ASSERT_EQ(1u, alternative_service_vector.size());
- EXPECT_EQ(kProtoQUIC, alternative_service_vector[0].protocol);
- EXPECT_EQ(i, alternative_service_vector[0].port);
+ AlternativeServiceInfoVector alternative_service_info_vector =
+ http_server_props_manager_->GetAlternativeServiceInfos(server);
+ ASSERT_EQ(1u, alternative_service_info_vector.size());
+ EXPECT_EQ(kProtoQUIC,
+ alternative_service_info_vector[0].alternative_service.protocol);
+ EXPECT_EQ(i, alternative_service_info_vector[0].alternative_service.port);
}
// Verify SupportsQuic.
« no previous file with comments | « net/http/http_server_properties_manager.cc ('k') | net/http/http_stream_factory_impl_job_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698