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

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

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