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

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

Issue 333803007: Rather than passing initial_flow_control_window all the way down the (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « net/quic/quic_client_session_base.cc ('k') | net/quic/quic_config.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/quic_client_session.h" 5 #include "net/quic/quic_client_session.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/rand_util.h" 9 #include "base/rand_util.h"
10 #include "net/base/capturing_net_log.h" 10 #include "net/base/capturing_net_log.h"
(...skipping 15 matching lines...) Expand all
26 26
27 namespace net { 27 namespace net {
28 namespace test { 28 namespace test {
29 namespace { 29 namespace {
30 30
31 const char kServerHostname[] = "www.example.com"; 31 const char kServerHostname[] = "www.example.com";
32 const uint16 kServerPort = 80; 32 const uint16 kServerPort = 80;
33 33
34 class TestPacketWriter : public QuicDefaultPacketWriter { 34 class TestPacketWriter : public QuicDefaultPacketWriter {
35 public: 35 public:
36 TestPacketWriter(QuicVersion version) : version_(version) { 36 TestPacketWriter(QuicVersion version) : version_(version) {}
37 }
38 37
39 // QuicPacketWriter 38 // QuicPacketWriter
40 virtual WriteResult WritePacket( 39 virtual WriteResult WritePacket(
41 const char* buffer, size_t buf_len, 40 const char* buffer, size_t buf_len,
42 const IPAddressNumber& self_address, 41 const IPAddressNumber& self_address,
43 const IPEndPoint& peer_address) OVERRIDE { 42 const IPEndPoint& peer_address) OVERRIDE {
44 SimpleQuicFramer framer(SupportedVersions(version_)); 43 SimpleQuicFramer framer(SupportedVersions(version_));
45 QuicEncryptedPacket packet(buffer, buf_len); 44 QuicEncryptedPacket packet(buffer, buf_len);
46 EXPECT_TRUE(framer.ProcessPacket(packet)); 45 EXPECT_TRUE(framer.ProcessPacket(packet));
47 header_ = framer.header(); 46 header_ = framer.header();
(...skipping 17 matching lines...) Expand all
65 class QuicClientSessionTest : public ::testing::TestWithParam<QuicVersion> { 64 class QuicClientSessionTest : public ::testing::TestWithParam<QuicVersion> {
66 protected: 65 protected:
67 QuicClientSessionTest() 66 QuicClientSessionTest()
68 : writer_(new TestPacketWriter(GetParam())), 67 : writer_(new TestPacketWriter(GetParam())),
69 connection_( 68 connection_(
70 new PacketSavingConnection(false, SupportedVersions(GetParam()))), 69 new PacketSavingConnection(false, SupportedVersions(GetParam()))),
71 session_(connection_, GetSocket().Pass(), writer_.Pass(), NULL, NULL, 70 session_(connection_, GetSocket().Pass(), writer_.Pass(), NULL, NULL,
72 make_scoped_ptr((QuicServerInfo*)NULL), 71 make_scoped_ptr((QuicServerInfo*)NULL),
73 QuicServerId(kServerHostname, kServerPort, false, 72 QuicServerId(kServerHostname, kServerPort, false,
74 PRIVACY_MODE_DISABLED), 73 PRIVACY_MODE_DISABLED),
75 DefaultQuicConfig(), kInitialFlowControlWindowForTest, 74 DefaultQuicConfig(), &crypto_config_,
76 &crypto_config_,
77 base::MessageLoop::current()->message_loop_proxy().get(), 75 base::MessageLoop::current()->message_loop_proxy().get(),
78 &net_log_) { 76 &net_log_) {
79 session_.config()->SetDefaults(); 77 session_.config()->SetDefaults();
80 crypto_config_.SetDefaults(); 78 crypto_config_.SetDefaults();
81 } 79 }
82 80
83 virtual void TearDown() OVERRIDE { 81 virtual void TearDown() OVERRIDE {
84 session_.CloseSessionOnError(ERR_ABORTED); 82 session_.CloseSessionOnError(ERR_ABORTED);
85 } 83 }
86 84
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 162
165 // After receiving a GoAway, I should no longer be able to create outgoing 163 // After receiving a GoAway, I should no longer be able to create outgoing
166 // streams. 164 // streams.
167 session_.OnGoAway(QuicGoAwayFrame(QUIC_PEER_GOING_AWAY, 1u, "Going away.")); 165 session_.OnGoAway(QuicGoAwayFrame(QUIC_PEER_GOING_AWAY, 1u, "Going away."));
168 EXPECT_EQ(NULL, session_.CreateOutgoingDataStream()); 166 EXPECT_EQ(NULL, session_.CreateOutgoingDataStream());
169 } 167 }
170 168
171 } // namespace 169 } // namespace
172 } // namespace test 170 } // namespace test
173 } // namespace net 171 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_client_session_base.cc ('k') | net/quic/quic_config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698