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

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

Issue 47283002: Land Recent QUIC changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix compilation error Created 7 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 | Annotate | Revision Log
« no previous file with comments | « net/quic/quic_stream_factory.cc ('k') | net/quic/quic_stream_sequencer_test.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 "net/cert/cert_verifier.h" 9 #include "net/cert/cert_verifier.h"
10 #include "net/dns/mock_host_resolver.h" 10 #include "net/dns/mock_host_resolver.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 header.entropy_flag = false; 101 header.entropy_flag = false;
102 header.fec_flag = false; 102 header.fec_flag = false;
103 header.fec_group = 0; 103 header.fec_group = 0;
104 104
105 QuicAckFrame ack(largest_received, QuicTime::Zero(), least_unacked); 105 QuicAckFrame ack(largest_received, QuicTime::Zero(), least_unacked);
106 QuicCongestionFeedbackFrame feedback; 106 QuicCongestionFeedbackFrame feedback;
107 feedback.type = kTCP; 107 feedback.type = kTCP;
108 feedback.tcp.accumulated_number_of_lost_packets = 0; 108 feedback.tcp.accumulated_number_of_lost_packets = 0;
109 feedback.tcp.receive_window = 16000; 109 feedback.tcp.receive_window = 16000;
110 110
111 QuicFramer framer(QuicVersionMax(), QuicTime::Zero(), false); 111 QuicFramer framer(QuicSupportedVersions(), QuicTime::Zero(), false);
112 QuicFrames frames; 112 QuicFrames frames;
113 frames.push_back(QuicFrame(&ack)); 113 frames.push_back(QuicFrame(&ack));
114 frames.push_back(QuicFrame(&feedback)); 114 frames.push_back(QuicFrame(&feedback));
115 scoped_ptr<QuicPacket> packet( 115 scoped_ptr<QuicPacket> packet(
116 framer.BuildUnsizedDataPacket(header, frames).packet); 116 framer.BuildUnsizedDataPacket(header, frames).packet);
117 return scoped_ptr<QuicEncryptedPacket>(framer.EncryptPacket( 117 return scoped_ptr<QuicEncryptedPacket>(framer.EncryptPacket(
118 ENCRYPTION_NONE, header.packet_sequence_number, *packet)); 118 ENCRYPTION_NONE, header.packet_sequence_number, *packet));
119 } 119 }
120 120
121 // Returns a newly created packet to send congestion feedback data. 121 // Returns a newly created packet to send congestion feedback data.
(...skipping 13 matching lines...) Expand all
135 frame.tcp.accumulated_number_of_lost_packets = 0; 135 frame.tcp.accumulated_number_of_lost_packets = 0;
136 frame.tcp.receive_window = 16000; 136 frame.tcp.receive_window = 16000;
137 137
138 return scoped_ptr<QuicEncryptedPacket>( 138 return scoped_ptr<QuicEncryptedPacket>(
139 ConstructPacket(header, QuicFrame(&frame))); 139 ConstructPacket(header, QuicFrame(&frame)));
140 } 140 }
141 141
142 scoped_ptr<QuicEncryptedPacket> ConstructPacket( 142 scoped_ptr<QuicEncryptedPacket> ConstructPacket(
143 const QuicPacketHeader& header, 143 const QuicPacketHeader& header,
144 const QuicFrame& frame) { 144 const QuicFrame& frame) {
145 QuicFramer framer(QuicVersionMax(), QuicTime::Zero(), false); 145 QuicFramer framer(QuicSupportedVersions(), QuicTime::Zero(), false);
146 QuicFrames frames; 146 QuicFrames frames;
147 frames.push_back(frame); 147 frames.push_back(frame);
148 scoped_ptr<QuicPacket> packet( 148 scoped_ptr<QuicPacket> packet(
149 framer.BuildUnsizedDataPacket(header, frames).packet); 149 framer.BuildUnsizedDataPacket(header, frames).packet);
150 return scoped_ptr<QuicEncryptedPacket>(framer.EncryptPacket( 150 return scoped_ptr<QuicEncryptedPacket>(framer.EncryptPacket(
151 ENCRYPTION_NONE, header.packet_sequence_number, *packet)); 151 ENCRYPTION_NONE, header.packet_sequence_number, *packet));
152 } 152 }
153 153
154 MockHostResolver host_resolver_; 154 MockHostResolver host_resolver_;
155 DeterministicMockClientSocketFactory socket_factory_; 155 DeterministicMockClientSocketFactory socket_factory_;
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 QuicStreamFactoryPeer::GetOrCreateCryptoConfig(&factory_, 478 QuicStreamFactoryPeer::GetOrCreateCryptoConfig(&factory_,
479 host_port_proxy_pair2); 479 host_port_proxy_pair2);
480 DCHECK(crypto_config2); 480 DCHECK(crypto_config2);
481 QuicCryptoClientConfig::CachedState* cached2 = 481 QuicCryptoClientConfig::CachedState* cached2 =
482 crypto_config2->LookupOrCreate(host_port_proxy_pair2.first.host()); 482 crypto_config2->LookupOrCreate(host_port_proxy_pair2.first.host());
483 EXPECT_EQ(cached1->source_address_token(), cached2->source_address_token()); 483 EXPECT_EQ(cached1->source_address_token(), cached2->source_address_token());
484 } 484 }
485 485
486 } // namespace test 486 } // namespace test
487 } // namespace net 487 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_stream_factory.cc ('k') | net/quic/quic_stream_sequencer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698