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

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

Issue 903213003: Enable QUIC for proxies based on Finch config and command line switch. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed one tiny function. 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 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 net::NetLog::TYPE_QUIC_SESSION_STREAM_FRAME_RECEIVED, 413 net::NetLog::TYPE_QUIC_SESSION_STREAM_FRAME_RECEIVED,
414 net::NetLog::PHASE_NONE); 414 net::NetLog::PHASE_NONE);
415 EXPECT_LT(0, pos); 415 EXPECT_LT(0, pos);
416 416
417 int log_stream_id; 417 int log_stream_id;
418 ASSERT_TRUE(entries[pos].GetIntegerValue("stream_id", &log_stream_id)); 418 ASSERT_TRUE(entries[pos].GetIntegerValue("stream_id", &log_stream_id));
419 EXPECT_EQ(3, log_stream_id); 419 EXPECT_EQ(3, log_stream_id);
420 } 420 }
421 421
422 TEST_P(QuicNetworkTransactionTest, QuicProxy) { 422 TEST_P(QuicNetworkTransactionTest, QuicProxy) {
423 params_.enable_quic_for_proxies = true;
423 proxy_service_.reset( 424 proxy_service_.reset(
424 ProxyService::CreateFixedFromPacResult("QUIC myproxy:70")); 425 ProxyService::CreateFixedFromPacResult("QUIC myproxy:70"));
425 426
426 MockQuicData mock_quic_data; 427 MockQuicData mock_quic_data;
427 mock_quic_data.AddWrite( 428 mock_quic_data.AddWrite(
428 ConstructRequestHeadersPacket(1, kClientDataStreamId1, true, true, 429 ConstructRequestHeadersPacket(1, kClientDataStreamId1, true, true,
429 GetRequestHeaders("GET", "http", "/"))); 430 GetRequestHeaders("GET", "http", "/")));
430 mock_quic_data.AddRead( 431 mock_quic_data.AddRead(
431 ConstructResponseHeadersPacket(1, kClientDataStreamId1, false, false, 432 ConstructResponseHeadersPacket(1, kClientDataStreamId1, false, false,
432 GetResponseHeaders("200 OK"))); 433 GetResponseHeaders("200 OK")));
433 mock_quic_data.AddRead( 434 mock_quic_data.AddRead(
434 ConstructDataPacket(2, kClientDataStreamId1, false, true, 0, "hello!")); 435 ConstructDataPacket(2, kClientDataStreamId1, false, true, 0, "hello!"));
435 mock_quic_data.AddWrite(ConstructAckPacket(2, 1)); 436 mock_quic_data.AddWrite(ConstructAckPacket(2, 1));
436 mock_quic_data.AddRead(SYNCHRONOUS, 0); // EOF 437 mock_quic_data.AddRead(SYNCHRONOUS, 0); // EOF
437 438
438 mock_quic_data.AddDelayedSocketDataToFactory(&socket_factory_, 1); 439 mock_quic_data.AddDelayedSocketDataToFactory(&socket_factory_, 1);
439 440
440 // There is no need to set up an alternate protocol job, because 441 // There is no need to set up an alternate protocol job, because
441 // no attempt will be made to speak to the proxy over TCP. 442 // no attempt will be made to speak to the proxy over TCP.
442 443
443 CreateSession(); 444 CreateSession();
444 445
445 SendRequestAndExpectQuicResponseFromProxy("hello!"); 446 SendRequestAndExpectQuicResponseFromProxy("hello!");
447 params_.enable_quic_for_proxies = false;
Ryan Hamilton 2015/02/14 00:09:23 I don't think you need this line, do you?
tbansal1 2015/02/14 01:06:11 Done.
446 } 448 }
447 449
448 TEST_P(QuicNetworkTransactionTest, ForceQuicWithErrorConnecting) { 450 TEST_P(QuicNetworkTransactionTest, ForceQuicWithErrorConnecting) {
449 params_.origin_to_force_quic_on = 451 params_.origin_to_force_quic_on =
450 HostPortPair::FromString("www.google.com:80"); 452 HostPortPair::FromString("www.google.com:80");
451 453
452 MockQuicData mock_quic_data; 454 MockQuicData mock_quic_data;
453 mock_quic_data.AddRead(ASYNC, ERR_SOCKET_NOT_CONNECTED); 455 mock_quic_data.AddRead(ASYNC, ERR_SOCKET_NOT_CONNECTED);
454 456
455 mock_quic_data.AddDelayedSocketDataToFactory(&socket_factory_, 0); 457 mock_quic_data.AddDelayedSocketDataToFactory(&socket_factory_, 0);
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after
1063 nullptr, 1065 nullptr,
1064 net_log_.bound()); 1066 net_log_.bound());
1065 1067
1066 CreateSessionWithNextProtos(); 1068 CreateSessionWithNextProtos();
1067 AddQuicAlternateProtocolMapping(MockCryptoClientStream::ZERO_RTT); 1069 AddQuicAlternateProtocolMapping(MockCryptoClientStream::ZERO_RTT);
1068 SendRequestAndExpectHttpResponse("hello world"); 1070 SendRequestAndExpectHttpResponse("hello world");
1069 } 1071 }
1070 1072
1071 } // namespace test 1073 } // namespace test
1072 } // namespace net 1074 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698