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

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

Issue 1824903002: Change the AlternativeServiceMap with SchemeOriginPair key. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « net/quic/quic_stream_factory.cc ('k') | net/spdy/spdy_network_transaction_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/quic_stream_factory.h" 5 #include "net/quic/quic_stream_factory.h"
6 6
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/thread_task_runner_handle.h" 9 #include "base/thread_task_runner_handle.h"
10 #include "net/base/test_data_directory.h" 10 #include "net/base/test_data_directory.h"
(...skipping 2509 matching lines...) Expand 10 before | Expand all | Expand 10 after
2520 MockRead reads2[] = {MockRead(SYNCHRONOUS, ERR_IO_PENDING, 0)}; 2520 MockRead reads2[] = {MockRead(SYNCHRONOUS, ERR_IO_PENDING, 0)};
2521 SequencedSocketData socket_data2(reads2, arraysize(reads2), nullptr, 0); 2521 SequencedSocketData socket_data2(reads2, arraysize(reads2), nullptr, 0);
2522 socket_factory_.AddSocketDataProvider(&socket_data2); 2522 socket_factory_.AddSocketDataProvider(&socket_data2);
2523 2523
2524 const AlternativeService alternative_service1(QUIC, host_port_pair_.host(), 2524 const AlternativeService alternative_service1(QUIC, host_port_pair_.host(),
2525 host_port_pair_.port()); 2525 host_port_pair_.port());
2526 AlternativeServiceInfoVector alternative_service_info_vector; 2526 AlternativeServiceInfoVector alternative_service_info_vector;
2527 base::Time expiration = base::Time::Now() + base::TimeDelta::FromDays(1); 2527 base::Time expiration = base::Time::Now() + base::TimeDelta::FromDays(1);
2528 alternative_service_info_vector.push_back( 2528 alternative_service_info_vector.push_back(
2529 AlternativeServiceInfo(alternative_service1, expiration)); 2529 AlternativeServiceInfo(alternative_service1, expiration));
2530 url::SchemeHostPort scheme_origin_pair("https", kDefaultServerHostName,
2531 kDefaultServerPort);
2530 2532
2531 http_server_properties_.SetAlternativeServices( 2533 http_server_properties_.SetAlternativeServices(
2532 host_port_pair_, alternative_service_info_vector); 2534 scheme_origin_pair, alternative_service_info_vector);
2533 2535
2534 crypto_client_stream_factory_.set_handshake_mode( 2536 crypto_client_stream_factory_.set_handshake_mode(
2535 MockCryptoClientStream::ZERO_RTT); 2537 MockCryptoClientStream::ZERO_RTT);
2536 host_resolver_.set_synchronous_mode(true); 2538 host_resolver_.set_synchronous_mode(true);
2537 host_resolver_.rules()->AddIPLiteralRule(host_port_pair_.host(), 2539 host_resolver_.rules()->AddIPLiteralRule(host_port_pair_.host(),
2538 "192.168.0.1", ""); 2540 "192.168.0.1", "");
2539 2541
2540 QuicStreamRequest request(factory_.get()); 2542 QuicStreamRequest request(factory_.get());
2541 QuicServerId server_id(host_port_pair_, privacy_mode_); 2543 QuicServerId server_id(host_port_pair_, privacy_mode_);
2542 EXPECT_EQ(ERR_IO_PENDING, 2544 EXPECT_EQ(ERR_IO_PENDING,
(...skipping 1076 matching lines...) Expand 10 before | Expand all | Expand 10 after
3619 EXPECT_EQ(500, config->IdleConnectionStateLifetime().ToSeconds()); 3621 EXPECT_EQ(500, config->IdleConnectionStateLifetime().ToSeconds());
3620 3622
3621 QuicStreamFactoryPeer::SetTaskRunner(factory_.get(), runner_.get()); 3623 QuicStreamFactoryPeer::SetTaskRunner(factory_.get(), runner_.get());
3622 3624
3623 const AlternativeService alternative_service1(QUIC, host_port_pair_.host(), 3625 const AlternativeService alternative_service1(QUIC, host_port_pair_.host(),
3624 host_port_pair_.port()); 3626 host_port_pair_.port());
3625 AlternativeServiceInfoVector alternative_service_info_vector; 3627 AlternativeServiceInfoVector alternative_service_info_vector;
3626 base::Time expiration = base::Time::Now() + base::TimeDelta::FromDays(1); 3628 base::Time expiration = base::Time::Now() + base::TimeDelta::FromDays(1);
3627 alternative_service_info_vector.push_back( 3629 alternative_service_info_vector.push_back(
3628 AlternativeServiceInfo(alternative_service1, expiration)); 3630 AlternativeServiceInfo(alternative_service1, expiration));
3631 url::SchemeHostPort scheme_origin_pair("https", kDefaultServerHostName,
3632 kDefaultServerPort);
3629 3633
3630 http_server_properties_.SetAlternativeServices( 3634 http_server_properties_.SetAlternativeServices(
3631 host_port_pair_, alternative_service_info_vector); 3635 scheme_origin_pair, alternative_service_info_vector);
3632 http_server_properties_.SetMaxServerConfigsStoredInProperties( 3636 http_server_properties_.SetMaxServerConfigsStoredInProperties(
3633 kMaxQuicServersToPersist); 3637 kMaxQuicServersToPersist);
3634 3638
3635 QuicServerId quic_server_id(kDefaultServerHostName, 80, 3639 QuicServerId quic_server_id(kDefaultServerHostName, 80,
3636 PRIVACY_MODE_DISABLED); 3640 PRIVACY_MODE_DISABLED);
3637 QuicServerInfoFactory* quic_server_info_factory = 3641 QuicServerInfoFactory* quic_server_info_factory =
3638 new PropertiesBasedQuicServerInfoFactory( 3642 new PropertiesBasedQuicServerInfoFactory(
3639 http_server_properties_.GetWeakPtr()); 3643 http_server_properties_.GetWeakPtr());
3640 factory_->set_quic_server_info_factory(quic_server_info_factory); 3644 factory_->set_quic_server_info_factory(quic_server_info_factory);
3641 3645
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
3908 EXPECT_TRUE(stream2.get()); 3912 EXPECT_TRUE(stream2.get());
3909 3913
3910 EXPECT_TRUE(socket_data1.AllReadDataConsumed()); 3914 EXPECT_TRUE(socket_data1.AllReadDataConsumed());
3911 EXPECT_TRUE(socket_data1.AllWriteDataConsumed()); 3915 EXPECT_TRUE(socket_data1.AllWriteDataConsumed());
3912 EXPECT_TRUE(socket_data2.AllReadDataConsumed()); 3916 EXPECT_TRUE(socket_data2.AllReadDataConsumed());
3913 EXPECT_TRUE(socket_data2.AllWriteDataConsumed()); 3917 EXPECT_TRUE(socket_data2.AllWriteDataConsumed());
3914 } 3918 }
3915 3919
3916 } // namespace test 3920 } // namespace test
3917 } // namespace net 3921 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_stream_factory.cc ('k') | net/spdy/spdy_network_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698