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

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

Issue 114933003: Minor cleanup of QUIC MockConnection and PacketSavingConnection (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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_sequencer_test.cc ('k') | net/quic/test_tools/crypto_test_utils.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/reliable_quic_stream.h" 5 #include "net/quic/reliable_quic_stream.h"
6 6
7 #include "net/quic/quic_ack_notifier.h" 7 #include "net/quic/quic_ack_notifier.h"
8 #include "net/quic/quic_connection.h" 8 #include "net/quic/quic_connection.h"
9 #include "net/quic/quic_spdy_compressor.h" 9 #include "net/quic/quic_spdy_compressor.h"
10 #include "net/quic/quic_spdy_decompressor.h" 10 #include "net/quic/quic_spdy_decompressor.h"
(...skipping 12 matching lines...) Expand all
23 using testing::StrEq; 23 using testing::StrEq;
24 using testing::StrictMock; 24 using testing::StrictMock;
25 25
26 namespace net { 26 namespace net {
27 namespace test { 27 namespace test {
28 namespace { 28 namespace {
29 29
30 const char kData1[] = "FooAndBar"; 30 const char kData1[] = "FooAndBar";
31 const char kData2[] = "EepAndBaz"; 31 const char kData2[] = "EepAndBaz";
32 const size_t kDataLen = 9; 32 const size_t kDataLen = 9;
33 const QuicGuid kGuid = 42;
34 const QuicGuid kStreamId = 3; 33 const QuicGuid kStreamId = 3;
35 const bool kIsServer = true; 34 const bool kIsServer = true;
36 const bool kShouldProcessData = true; 35 const bool kShouldProcessData = true;
37 36
38 class TestStream : public ReliableQuicStream { 37 class TestStream : public ReliableQuicStream {
39 public: 38 public:
40 TestStream(QuicStreamId id, 39 TestStream(QuicStreamId id,
41 QuicSession* session, 40 QuicSession* session,
42 bool should_process_data) 41 bool should_process_data)
43 : ReliableQuicStream(id, session), 42 : ReliableQuicStream(id, session),
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 "edlR9FsEdH6iujMcHkbE5l18ehJDwTWmBKBzVD87naobhMMrF6VvnDGxQVGp9Ir_b" 88 "edlR9FsEdH6iujMcHkbE5l18ehJDwTWmBKBzVD87naobhMMrF6VvnDGxQVGp9Ir_b"
90 "Rgj3RWUoPumQVCxtSOBdX0GlJOEcDTNCzQIm9BSfetog_eP_TfYubKudt5eMsXmN6" 89 "Rgj3RWUoPumQVCxtSOBdX0GlJOEcDTNCzQIm9BSfetog_eP_TfYubKudt5eMsXmN6"
91 "QnyXHeGeK2UINUzJ-D30AFcpqYgH9_1BvYSpi7fc7_ydBU8TaD8ZRxvtnzXqj0RfG" 90 "QnyXHeGeK2UINUzJ-D30AFcpqYgH9_1BvYSpi7fc7_ydBU8TaD8ZRxvtnzXqj0RfG"
92 "tuHghmv3aD-uzSYJ75XDdzKdizZ86IG6Fbn1XFhYZM-fbHhm3mVEXnyRW4ZuNOLFk" 91 "tuHghmv3aD-uzSYJ75XDdzKdizZ86IG6Fbn1XFhYZM-fbHhm3mVEXnyRW4ZuNOLFk"
93 "Fas6LMcVC6Q8QLlHYbXBpdNFuGbuZGUnav5C-2I_-46lL0NGg3GewxGKGHvHEfoyn" 92 "Fas6LMcVC6Q8QLlHYbXBpdNFuGbuZGUnav5C-2I_-46lL0NGg3GewxGKGHvHEfoyn"
94 "EFFlEYHsBQ98rXImL8ySDycdLEFvBPdtctPmWCfTxwmoSMLHU2SCVDhbqMWU5b0yr" 93 "EFFlEYHsBQ98rXImL8ySDycdLEFvBPdtctPmWCfTxwmoSMLHU2SCVDhbqMWU5b0yr"
95 "JBCScs_ejbKaqBDoB7ZGxTvqlrB__2ZmnHHjCr8RgMRtKNtIeuZAo "; 94 "JBCScs_ejbKaqBDoB7ZGxTvqlrB__2ZmnHHjCr8RgMRtKNtIeuZAo ";
96 } 95 }
97 96
98 void Initialize(bool stream_should_process_data) { 97 void Initialize(bool stream_should_process_data) {
99 connection_ = new testing::StrictMock<MockConnection>( 98 connection_ = new StrictMock<MockConnection>(kIsServer);
100 kGuid, IPEndPoint(), kIsServer); 99 session_.reset(new StrictMock<MockSession>(connection_, kIsServer));
101 session_.reset(new testing::StrictMock<MockSession>(
102 connection_, kIsServer));
103 stream_.reset(new TestStream(kStreamId, session_.get(), 100 stream_.reset(new TestStream(kStreamId, session_.get(),
104 stream_should_process_data)); 101 stream_should_process_data));
105 stream2_.reset(new TestStream(kStreamId + 2, session_.get(), 102 stream2_.reset(new TestStream(kStreamId + 2, session_.get(),
106 stream_should_process_data)); 103 stream_should_process_data));
107 compressor_.reset(new QuicSpdyCompressor()); 104 compressor_.reset(new QuicSpdyCompressor());
108 decompressor_.reset(new QuicSpdyDecompressor); 105 decompressor_.reset(new QuicSpdyDecompressor);
109 write_blocked_list_ = 106 write_blocked_list_ =
110 QuicSessionPeer::GetWriteblockedStreams(session_.get()); 107 QuicSessionPeer::GetWriteblockedStreams(session_.get());
111 } 108 }
112 109
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 EXPECT_EQ(QUIC_STREAM_NO_ERROR, stream_->stream_error()); 221 EXPECT_EQ(QUIC_STREAM_NO_ERROR, stream_->stream_error());
225 EXPECT_EQ(QUIC_NO_ERROR, stream_->connection_error()); 222 EXPECT_EQ(QUIC_NO_ERROR, stream_->connection_error());
226 stream_->OnConnectionClosed(QUIC_INTERNAL_ERROR, false); 223 stream_->OnConnectionClosed(QUIC_INTERNAL_ERROR, false);
227 EXPECT_EQ(QUIC_STREAM_NO_ERROR, stream_->stream_error()); 224 EXPECT_EQ(QUIC_STREAM_NO_ERROR, stream_->stream_error());
228 EXPECT_EQ(QUIC_NO_ERROR, stream_->connection_error()); 225 EXPECT_EQ(QUIC_NO_ERROR, stream_->connection_error());
229 } 226 }
230 227
231 } // namespace 228 } // namespace
232 } // namespace test 229 } // namespace test
233 } // namespace net 230 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_stream_sequencer_test.cc ('k') | net/quic/test_tools/crypto_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698