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

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

Issue 874603004: Remove HasAlternateProtocol(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor. Created 5 years, 10 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 <vector> 5 #include <vector>
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 } 277 }
278 278
279 void AddQuicAlternateProtocolMapping( 279 void AddQuicAlternateProtocolMapping(
280 MockCryptoClientStream::HandshakeMode handshake_mode) { 280 MockCryptoClientStream::HandshakeMode handshake_mode) {
281 crypto_client_stream_factory_.set_handshake_mode(handshake_mode); 281 crypto_client_stream_factory_.set_handshake_mode(handshake_mode);
282 session_->http_server_properties()->SetAlternateProtocol( 282 session_->http_server_properties()->SetAlternateProtocol(
283 HostPortPair::FromURL(request_.url), 80, QUIC, 1); 283 HostPortPair::FromURL(request_.url), 80, QUIC, 1);
284 } 284 }
285 285
286 void ExpectBrokenAlternateProtocolMapping() { 286 void ExpectBrokenAlternateProtocolMapping() {
287 ASSERT_TRUE(session_->http_server_properties()->HasAlternateProtocol(
288 HostPortPair::FromURL(request_.url)));
289 const AlternateProtocolInfo alternate = 287 const AlternateProtocolInfo alternate =
290 session_->http_server_properties()->GetAlternateProtocol( 288 session_->http_server_properties()->GetAlternateProtocol(
291 HostPortPair::FromURL(request_.url)); 289 HostPortPair::FromURL(request_.url));
290 EXPECT_NE(UNINITIALIZED_ALTERNATE_PROTOCOL, alternate.protocol);
292 EXPECT_TRUE(alternate.is_broken); 291 EXPECT_TRUE(alternate.is_broken);
293 } 292 }
294 293
295 void ExpectQuicAlternateProtocolMapping() { 294 void ExpectQuicAlternateProtocolMapping() {
296 ASSERT_TRUE(session_->http_server_properties()->HasAlternateProtocol(
297 HostPortPair::FromURL(request_.url)));
298 const AlternateProtocolInfo alternate = 295 const AlternateProtocolInfo alternate =
299 session_->http_server_properties()->GetAlternateProtocol( 296 session_->http_server_properties()->GetAlternateProtocol(
300 HostPortPair::FromURL(request_.url)); 297 HostPortPair::FromURL(request_.url));
301 EXPECT_EQ(QUIC, alternate.protocol); 298 EXPECT_EQ(QUIC, alternate.protocol);
302 } 299 }
303 300
304 void AddHangingNonAlternateProtocolSocketData() { 301 void AddHangingNonAlternateProtocolSocketData() {
305 MockConnect hanging_connect(SYNCHRONOUS, ERR_IO_PENDING); 302 MockConnect hanging_connect(SYNCHRONOUS, ERR_IO_PENDING);
306 hanging_data_.set_connect_data(hanging_connect); 303 hanging_data_.set_connect_data(hanging_connect);
307 socket_factory_.AddSocketDataProvider(&hanging_data_); 304 socket_factory_.AddSocketDataProvider(&hanging_data_);
(...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after
1035 nullptr, 1032 nullptr,
1036 net_log_.bound()); 1033 net_log_.bound());
1037 1034
1038 CreateSessionWithNextProtos(); 1035 CreateSessionWithNextProtos();
1039 AddQuicAlternateProtocolMapping(MockCryptoClientStream::ZERO_RTT); 1036 AddQuicAlternateProtocolMapping(MockCryptoClientStream::ZERO_RTT);
1040 SendRequestAndExpectHttpResponse("hello world"); 1037 SendRequestAndExpectHttpResponse("hello world");
1041 } 1038 }
1042 1039
1043 } // namespace test 1040 } // namespace test
1044 } // namespace net 1041 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698