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

Side by Side Diff: net/http/http_stream_factory_impl_job_controller_unittest.cc

Issue 2901093004: Add and persist a new field in AlternativeServiceInfo to list QUIC verisons advertised (Closed)
Patch Set: self review 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/http/http_stream_factory_impl_job_controller.h" 5 #include "net/http/http_stream_factory_impl_job_controller.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 } 186 }
187 187
188 ~HttpStreamFactoryImplJobControllerTest() override {} 188 ~HttpStreamFactoryImplJobControllerTest() override {}
189 189
190 void SetAlternativeService(const HttpRequestInfo& request_info, 190 void SetAlternativeService(const HttpRequestInfo& request_info,
191 AlternativeService alternative_service) { 191 AlternativeService alternative_service) {
192 HostPortPair host_port_pair = HostPortPair::FromURL(request_info.url); 192 HostPortPair host_port_pair = HostPortPair::FromURL(request_info.url);
193 url::SchemeHostPort server(request_info.url); 193 url::SchemeHostPort server(request_info.url);
194 base::Time expiration = base::Time::Now() + base::TimeDelta::FromDays(1); 194 base::Time expiration = base::Time::Now() + base::TimeDelta::FromDays(1);
195 session_->http_server_properties()->SetAlternativeService( 195 session_->http_server_properties()->SetAlternativeService(
196 server, alternative_service, expiration); 196 server, alternative_service, expiration,
197 HttpNetworkSession::Params().quic_supported_versions);
197 } 198 }
198 199
199 void VerifyBrokenAlternateProtocolMapping(const HttpRequestInfo& request_info, 200 void VerifyBrokenAlternateProtocolMapping(const HttpRequestInfo& request_info,
200 bool should_mark_broken) { 201 bool should_mark_broken) {
201 const url::SchemeHostPort server(request_info.url); 202 const url::SchemeHostPort server(request_info.url);
202 const AlternativeServiceInfoVector alternative_service_info_vector = 203 const AlternativeServiceInfoVector alternative_service_info_vector =
203 session_->http_server_properties()->GetAlternativeServiceInfos(server); 204 session_->http_server_properties()->GetAlternativeServiceInfos(server);
204 EXPECT_EQ(1u, alternative_service_info_vector.size()); 205 EXPECT_EQ(1u, alternative_service_info_vector.size());
205 EXPECT_EQ(should_mark_broken, 206 EXPECT_EQ(should_mark_broken,
206 session_->http_server_properties()->IsAlternativeServiceBroken( 207 session_->http_server_properties()->IsAlternativeServiceBroken(
(...skipping 1269 matching lines...) Expand 10 before | Expand all | Expand 10 after
1476 Preconnect(kNumPreconects); 1477 Preconnect(kNumPreconects);
1477 // If experiment is enabled, only 1 stream is requested. 1478 // If experiment is enabled, only 1 stream is requested.
1478 EXPECT_EQ( 1479 EXPECT_EQ(
1479 (int)actual_num_connects, 1480 (int)actual_num_connects,
1480 HttpStreamFactoryImplJobPeer::GetNumStreams(job_controller_->main_job())); 1481 HttpStreamFactoryImplJobPeer::GetNumStreams(job_controller_->main_job()));
1481 base::RunLoop().RunUntilIdle(); 1482 base::RunLoop().RunUntilIdle();
1482 EXPECT_TRUE(HttpStreamFactoryImplPeer::IsJobControllerDeleted(factory_)); 1483 EXPECT_TRUE(HttpStreamFactoryImplPeer::IsJobControllerDeleted(factory_));
1483 } 1484 }
1484 1485
1485 } // namespace net 1486 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698