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

Side by Side Diff: net/quic/chromium/quic_stream_factory_test.cc

Issue 2901093004: Add and persist a new field in AlternativeServiceInfo to list QUIC verisons advertised (Closed)
Patch Set: fix Canonical test Created 3 years, 5 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/quic/chromium/quic_stream_factory.h" 5 #include "net/quic/chromium/quic_stream_factory.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <ostream> 8 #include <ostream>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 const QuicConfig* config = QuicStreamFactoryPeer::GetConfig(factory_.get()); 480 const QuicConfig* config = QuicStreamFactoryPeer::GetConfig(factory_.get());
481 EXPECT_EQ(500, config->IdleNetworkTimeout().ToSeconds()); 481 EXPECT_EQ(500, config->IdleNetworkTimeout().ToSeconds());
482 482
483 QuicStreamFactoryPeer::SetTaskRunner(factory_.get(), runner_.get()); 483 QuicStreamFactoryPeer::SetTaskRunner(factory_.get(), runner_.get());
484 484
485 const AlternativeService alternative_service1( 485 const AlternativeService alternative_service1(
486 kProtoQUIC, host_port_pair_.host(), host_port_pair_.port()); 486 kProtoQUIC, host_port_pair_.host(), host_port_pair_.port());
487 AlternativeServiceInfoVector alternative_service_info_vector; 487 AlternativeServiceInfoVector alternative_service_info_vector;
488 base::Time expiration = base::Time::Now() + base::TimeDelta::FromDays(1); 488 base::Time expiration = base::Time::Now() + base::TimeDelta::FromDays(1);
489 alternative_service_info_vector.push_back( 489 alternative_service_info_vector.push_back(
490 AlternativeServiceInfo(alternative_service1, expiration)); 490 AlternativeServiceInfo::CreateQuicAlternativeServiceInfo(
491 alternative_service1, expiration, {version_}));
491 http_server_properties_.SetAlternativeServices( 492 http_server_properties_.SetAlternativeServices(
492 url::SchemeHostPort(url_), alternative_service_info_vector); 493 url::SchemeHostPort(url_), alternative_service_info_vector);
493 494
494 HostPortPair host_port_pair2(kServer2HostName, kDefaultServerPort); 495 HostPortPair host_port_pair2(kServer2HostName, kDefaultServerPort);
495 url::SchemeHostPort server2("https", kServer2HostName, kDefaultServerPort); 496 url::SchemeHostPort server2("https", kServer2HostName, kDefaultServerPort);
496 const AlternativeService alternative_service2( 497 const AlternativeService alternative_service2(
497 kProtoQUIC, host_port_pair2.host(), host_port_pair2.port()); 498 kProtoQUIC, host_port_pair2.host(), host_port_pair2.port());
498 AlternativeServiceInfoVector alternative_service_info_vector2; 499 AlternativeServiceInfoVector alternative_service_info_vector2;
499 alternative_service_info_vector2.push_back( 500 alternative_service_info_vector2.push_back(
500 AlternativeServiceInfo(alternative_service2, expiration)); 501 AlternativeServiceInfo::CreateQuicAlternativeServiceInfo(
502 alternative_service2, expiration, {version_}));
501 503
502 http_server_properties_.SetAlternativeServices( 504 http_server_properties_.SetAlternativeServices(
503 server2, alternative_service_info_vector2); 505 server2, alternative_service_info_vector2);
504 // Verify that the properties of both QUIC servers are stored in the 506 // Verify that the properties of both QUIC servers are stored in the
505 // HTTP properties map. 507 // HTTP properties map.
506 EXPECT_EQ(2U, http_server_properties_.alternative_service_map().size()); 508 EXPECT_EQ(2U, http_server_properties_.alternative_service_map().size());
507 509
508 http_server_properties_.SetMaxServerConfigsStoredInProperties( 510 http_server_properties_.SetMaxServerConfigsStoredInProperties(
509 kMaxQuicServersToPersist); 511 kMaxQuicServersToPersist);
510 512
(...skipping 4561 matching lines...) Expand 10 before | Expand all | Expand 10 after
5072 // Clear all cached states. 5074 // Clear all cached states.
5073 factory_->ClearCachedStatesInCryptoConfig( 5075 factory_->ClearCachedStatesInCryptoConfig(
5074 base::Callback<bool(const GURL&)>()); 5076 base::Callback<bool(const GURL&)>());
5075 EXPECT_TRUE(test_cases[0].state->certs().empty()); 5077 EXPECT_TRUE(test_cases[0].state->certs().empty());
5076 EXPECT_TRUE(test_cases[1].state->certs().empty()); 5078 EXPECT_TRUE(test_cases[1].state->certs().empty());
5077 EXPECT_TRUE(test_cases[2].state->certs().empty()); 5079 EXPECT_TRUE(test_cases[2].state->certs().empty());
5078 } 5080 }
5079 5081
5080 } // namespace test 5082 } // namespace test
5081 } // namespace net 5083 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/chromium/quic_network_transaction_unittest.cc ('k') | net/spdy/chromium/spdy_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698