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

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

Issue 2496953002: Revert of Unify enum NextProto and enum AlternateProtocol. (Closed)
Patch Set: Created 4 years, 1 month 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/chromium/quic_stream_factory.cc ('k') | net/socket/next_proto.h » ('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/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 25 matching lines...) Expand all
36 #include "net/quic/core/quic_client_promised_info.h" 36 #include "net/quic/core/quic_client_promised_info.h"
37 #include "net/quic/core/quic_http_utils.h" 37 #include "net/quic/core/quic_http_utils.h"
38 #include "net/quic/test_tools/mock_clock.h" 38 #include "net/quic/test_tools/mock_clock.h"
39 #include "net/quic/test_tools/mock_crypto_client_stream_factory.h" 39 #include "net/quic/test_tools/mock_crypto_client_stream_factory.h"
40 #include "net/quic/test_tools/mock_random.h" 40 #include "net/quic/test_tools/mock_random.h"
41 #include "net/quic/test_tools/quic_config_peer.h" 41 #include "net/quic/test_tools/quic_config_peer.h"
42 #include "net/quic/test_tools/quic_stream_factory_peer.h" 42 #include "net/quic/test_tools/quic_stream_factory_peer.h"
43 #include "net/quic/test_tools/quic_test_packet_maker.h" 43 #include "net/quic/test_tools/quic_test_packet_maker.h"
44 #include "net/quic/test_tools/quic_test_utils.h" 44 #include "net/quic/test_tools/quic_test_utils.h"
45 #include "net/quic/test_tools/test_task_runner.h" 45 #include "net/quic/test_tools/test_task_runner.h"
46 #include "net/socket/next_proto.h"
47 #include "net/socket/socket_test_util.h" 46 #include "net/socket/socket_test_util.h"
48 #include "net/spdy/spdy_session_test_util.h" 47 #include "net/spdy/spdy_session_test_util.h"
49 #include "net/spdy/spdy_test_utils.h" 48 #include "net/spdy/spdy_test_utils.h"
50 #include "net/ssl/channel_id_service.h" 49 #include "net/ssl/channel_id_service.h"
51 #include "net/ssl/default_channel_id_store.h" 50 #include "net/ssl/default_channel_id_store.h"
52 #include "net/test/cert_test_util.h" 51 #include "net/test/cert_test_util.h"
53 #include "net/test/gtest_util.h" 52 #include "net/test/gtest_util.h"
54 #include "net/test/test_data_directory.h" 53 #include "net/test/test_data_directory.h"
55 #include "testing/gmock/include/gmock/gmock.h" 54 #include "testing/gmock/include/gmock/gmock.h"
56 #include "testing/gtest/include/gtest/gtest.h" 55 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 void VerifyInitialization(bool proxy_delegate_provides_quic_supported_proxy) { 508 void VerifyInitialization(bool proxy_delegate_provides_quic_supported_proxy) {
510 idle_connection_timeout_seconds_ = 500; 509 idle_connection_timeout_seconds_ = 500;
511 Initialize(); 510 Initialize();
512 ProofVerifyDetailsChromium verify_details = DefaultProofVerifyDetails(); 511 ProofVerifyDetailsChromium verify_details = DefaultProofVerifyDetails();
513 crypto_client_stream_factory_.AddProofVerifyDetails(&verify_details); 512 crypto_client_stream_factory_.AddProofVerifyDetails(&verify_details);
514 const QuicConfig* config = QuicStreamFactoryPeer::GetConfig(factory_.get()); 513 const QuicConfig* config = QuicStreamFactoryPeer::GetConfig(factory_.get());
515 EXPECT_EQ(500, config->IdleNetworkTimeout().ToSeconds()); 514 EXPECT_EQ(500, config->IdleNetworkTimeout().ToSeconds());
516 515
517 QuicStreamFactoryPeer::SetTaskRunner(factory_.get(), runner_.get()); 516 QuicStreamFactoryPeer::SetTaskRunner(factory_.get(), runner_.get());
518 517
519 const AlternativeService alternative_service1( 518 const AlternativeService alternative_service1(QUIC, host_port_pair_.host(),
520 kProtoQUIC, host_port_pair_.host(), host_port_pair_.port()); 519 host_port_pair_.port());
521 AlternativeServiceInfoVector alternative_service_info_vector; 520 AlternativeServiceInfoVector alternative_service_info_vector;
522 base::Time expiration = base::Time::Now() + base::TimeDelta::FromDays(1); 521 base::Time expiration = base::Time::Now() + base::TimeDelta::FromDays(1);
523 alternative_service_info_vector.push_back( 522 alternative_service_info_vector.push_back(
524 AlternativeServiceInfo(alternative_service1, expiration)); 523 AlternativeServiceInfo(alternative_service1, expiration));
525 http_server_properties_.SetAlternativeServices( 524 http_server_properties_.SetAlternativeServices(
526 url::SchemeHostPort(url_), alternative_service_info_vector); 525 url::SchemeHostPort(url_), alternative_service_info_vector);
527 526
528 HostPortPair host_port_pair2(kServer2HostName, kDefaultServerPort); 527 HostPortPair host_port_pair2(kServer2HostName, kDefaultServerPort);
529 url::SchemeHostPort server2("https", kServer2HostName, kDefaultServerPort); 528 url::SchemeHostPort server2("https", kServer2HostName, kDefaultServerPort);
530 const AlternativeService alternative_service2( 529 const AlternativeService alternative_service2(QUIC, host_port_pair2.host(),
531 kProtoQUIC, host_port_pair2.host(), host_port_pair2.port()); 530 host_port_pair2.port());
532 AlternativeServiceInfoVector alternative_service_info_vector2; 531 AlternativeServiceInfoVector alternative_service_info_vector2;
533 alternative_service_info_vector2.push_back( 532 alternative_service_info_vector2.push_back(
534 AlternativeServiceInfo(alternative_service2, expiration)); 533 AlternativeServiceInfo(alternative_service2, expiration));
535 if (!proxy_delegate_provides_quic_supported_proxy) { 534 if (!proxy_delegate_provides_quic_supported_proxy) {
536 http_server_properties_.SetAlternativeServices( 535 http_server_properties_.SetAlternativeServices(
537 server2, alternative_service_info_vector2); 536 server2, alternative_service_info_vector2);
538 // Verify that the properties of both QUIC servers are stored in the 537 // Verify that the properties of both QUIC servers are stored in the
539 // HTTP properties map. 538 // HTTP properties map.
540 EXPECT_EQ(2U, http_server_properties_.alternative_service_map().size()); 539 EXPECT_EQ(2U, http_server_properties_.alternative_service_map().size());
541 } else { 540 } else {
(...skipping 3576 matching lines...) Expand 10 before | Expand all | Expand 10 after
4118 QuicStreamFactoryPeer::SetTaskRunner(factory_.get(), runner_.get()); 4117 QuicStreamFactoryPeer::SetTaskRunner(factory_.get(), runner_.get());
4119 4118
4120 MockQuicData socket_data; 4119 MockQuicData socket_data;
4121 socket_data.AddRead(SYNCHRONOUS, ERR_IO_PENDING); 4120 socket_data.AddRead(SYNCHRONOUS, ERR_IO_PENDING);
4122 socket_data.AddSocketDataToFactory(&socket_factory_); 4121 socket_data.AddSocketDataToFactory(&socket_factory_);
4123 4122
4124 MockQuicData socket_data2; 4123 MockQuicData socket_data2;
4125 socket_data2.AddRead(SYNCHRONOUS, ERR_IO_PENDING); 4124 socket_data2.AddRead(SYNCHRONOUS, ERR_IO_PENDING);
4126 socket_data2.AddSocketDataToFactory(&socket_factory_); 4125 socket_data2.AddSocketDataToFactory(&socket_factory_);
4127 4126
4128 const AlternativeService alternative_service1( 4127 const AlternativeService alternative_service1(QUIC, host_port_pair_.host(),
4129 kProtoQUIC, host_port_pair_.host(), host_port_pair_.port()); 4128 host_port_pair_.port());
4130 AlternativeServiceInfoVector alternative_service_info_vector; 4129 AlternativeServiceInfoVector alternative_service_info_vector;
4131 base::Time expiration = base::Time::Now() + base::TimeDelta::FromDays(1); 4130 base::Time expiration = base::Time::Now() + base::TimeDelta::FromDays(1);
4132 alternative_service_info_vector.push_back( 4131 alternative_service_info_vector.push_back(
4133 AlternativeServiceInfo(alternative_service1, expiration)); 4132 AlternativeServiceInfo(alternative_service1, expiration));
4134 4133
4135 http_server_properties_.SetAlternativeServices( 4134 http_server_properties_.SetAlternativeServices(
4136 url::SchemeHostPort(url_), alternative_service_info_vector); 4135 url::SchemeHostPort(url_), alternative_service_info_vector);
4137 4136
4138 crypto_client_stream_factory_.set_handshake_mode( 4137 crypto_client_stream_factory_.set_handshake_mode(
4139 MockCryptoClientStream::ZERO_RTT); 4138 MockCryptoClientStream::ZERO_RTT);
(...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after
5255 // Clear all cached states. 5254 // Clear all cached states.
5256 factory_->ClearCachedStatesInCryptoConfig( 5255 factory_->ClearCachedStatesInCryptoConfig(
5257 base::Callback<bool(const GURL&)>()); 5256 base::Callback<bool(const GURL&)>());
5258 EXPECT_TRUE(test_cases[0].state->certs().empty()); 5257 EXPECT_TRUE(test_cases[0].state->certs().empty());
5259 EXPECT_TRUE(test_cases[1].state->certs().empty()); 5258 EXPECT_TRUE(test_cases[1].state->certs().empty());
5260 EXPECT_TRUE(test_cases[2].state->certs().empty()); 5259 EXPECT_TRUE(test_cases[2].state->certs().empty());
5261 } 5260 }
5262 5261
5263 } // namespace test 5262 } // namespace test
5264 } // namespace net 5263 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/chromium/quic_stream_factory.cc ('k') | net/socket/next_proto.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698