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

Unified Diff: net/http/http_server_properties_impl_unittest.cc

Issue 2901093004: Add and persist a new field in AlternativeServiceInfo to list QUIC verisons advertised (Closed)
Patch Set: fix compile in components Created 3 years, 6 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
Index: net/http/http_server_properties_impl_unittest.cc
diff --git a/net/http/http_server_properties_impl_unittest.cc b/net/http/http_server_properties_impl_unittest.cc
index 46cd0dfd0dd9153b58d6bc4ee630c72a67d71001..0baed96c226a7cf7270ab888ba1ffc756125d2db 100644
--- a/net/http/http_server_properties_impl_unittest.cc
+++ b/net/http/http_server_properties_impl_unittest.cc
@@ -13,6 +13,7 @@
#include "base/values.h"
#include "net/base/host_port_pair.h"
#include "net/base/ip_address.h"
+#include "net/http/http_network_session.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
@@ -78,7 +79,9 @@ class HttpServerPropertiesImplTest : public testing::Test {
const AlternativeService& alternative_service) {
const base::Time expiration =
base::Time::Now() + base::TimeDelta::FromDays(1);
- return impl_.SetAlternativeService(origin, alternative_service, expiration);
+ return impl_.SetAlternativeService(
+ origin, alternative_service, expiration,
+ HttpNetworkSession::Params().quic_supported_versions);
}
void MarkBrokenAndLetExpireAlternativeServiceNTimes(
@@ -389,20 +392,20 @@ TEST_F(AlternateProtocolServerPropertiesTest, ExcludeOrigin) {
AlternativeServiceInfoVector alternative_service_info_vector;
base::Time expiration = base::Time::Now() + base::TimeDelta::FromDays(1);
// Same hostname, same port, TCP: should be ignored.
- AlternativeServiceInfo alternative_service_info1(kProtoHTTP2, "foo", 443,
- expiration);
+ AlternativeServiceInfo alternative_service_info1(
+ AlternativeService(kProtoHTTP2, "foo", 443), expiration);
alternative_service_info_vector.push_back(alternative_service_info1);
// Different hostname: GetAlternativeServiceInfos should return this one.
- AlternativeServiceInfo alternative_service_info2(kProtoHTTP2, "bar", 443,
- expiration);
+ AlternativeServiceInfo alternative_service_info2(
+ AlternativeService(kProtoHTTP2, "bar", 443), expiration);
alternative_service_info_vector.push_back(alternative_service_info2);
// Different port: GetAlternativeServiceInfos should return this one too.
- AlternativeServiceInfo alternative_service_info3(kProtoHTTP2, "foo", 80,
- expiration);
+ AlternativeServiceInfo alternative_service_info3(
+ AlternativeService(kProtoHTTP2, "foo", 80), expiration);
alternative_service_info_vector.push_back(alternative_service_info3);
// QUIC: GetAlternativeServices should return this one too.
- AlternativeServiceInfo alternative_service_info4(kProtoQUIC, "foo", 443,
- expiration);
+ AlternativeServiceInfo alternative_service_info4(
+ AlternativeService(kProtoQUIC, "foo", 443), expiration);
alternative_service_info_vector.push_back(alternative_service_info4);
url::SchemeHostPort test_server("https", "foo", 443);
@@ -426,7 +429,9 @@ TEST_F(AlternateProtocolServerPropertiesTest, Set) {
const base::Time now = base::Time::Now();
base::Time expiration1 = now + base::TimeDelta::FromDays(1);
// 1st entry in the memory.
- impl_.SetAlternativeService(test_server1, alternative_service1, expiration1);
+ impl_.SetAlternativeService(
+ test_server1, alternative_service1, expiration1,
+ HttpNetworkSession::Params().quic_supported_versions);
Ryan Hamilton 2017/06/07 20:52:23 For tests, I'd just use QuicSupportedVersions()?
Zhongyi Shi 2017/06/08 23:11:16 Fixed. We should use an empty version vector actua
// |test_server2| has an alternative service, which will be
// overwritten by SetAlternativeServiceServers(), because

Powered by Google App Engine
This is Rietveld 408576698