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

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

Issue 14287009: Land Recent QUIC Changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with Tot Created 7 years, 8 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/reliable_quic_stream.cc ('k') | net/quic/test_tools/crypto_test_utils.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/reliable_quic_stream.h" 5 #include "net/quic/reliable_quic_stream.h"
6 6
7 #include "net/quic/quic_connection.h" 7 #include "net/quic/quic_connection.h"
8 #include "net/quic/quic_utils.h" 8 #include "net/quic/quic_utils.h"
9 #include "net/quic/test_tools/quic_test_utils.h" 9 #include "net/quic/test_tools/quic_test_utils.h"
10 #include "testing/gmock/include/gmock/gmock.h" 10 #include "testing/gmock/include/gmock/gmock.h"
(...skipping 14 matching lines...) Expand all
25 25
26 class QuicReliableTestStream : public ReliableQuicStream { 26 class QuicReliableTestStream : public ReliableQuicStream {
27 public: 27 public:
28 QuicReliableTestStream(QuicStreamId id, QuicSession* session) 28 QuicReliableTestStream(QuicStreamId id, QuicSession* session)
29 : ReliableQuicStream(id, session) { 29 : ReliableQuicStream(id, session) {
30 } 30 }
31 virtual uint32 ProcessData(const char* data, uint32 data_len) OVERRIDE { 31 virtual uint32 ProcessData(const char* data, uint32 data_len) OVERRIDE {
32 return 0; 32 return 0;
33 } 33 }
34 using ReliableQuicStream::WriteData; 34 using ReliableQuicStream::WriteData;
35 using ReliableQuicStream::CloseReadSide;
36 using ReliableQuicStream::CloseWriteSide;
35 }; 37 };
36 38
37 class ReliableQuicStreamTest : public ::testing::TestWithParam<bool> { 39 class ReliableQuicStreamTest : public ::testing::TestWithParam<bool> {
38 public: 40 public:
39 ReliableQuicStreamTest() 41 ReliableQuicStreamTest()
40 : connection_(new MockConnection(1, IPEndPoint(), false)), 42 : connection_(new MockConnection(1, IPEndPoint(), false)),
41 session_(connection_, true), 43 session_(connection_, true),
42 stream_(1, &session_) { 44 stream_(1, &session_) {
43 } 45 }
44 46
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 WillOnce(Return(QuicConsumedData(kDataLen - 2, false))); 82 WillOnce(Return(QuicConsumedData(kDataLen - 2, false)));
81 stream_.OnCanWrite(); 83 stream_.OnCanWrite();
82 84
83 // And finally the end of the bytes_consumed 85 // And finally the end of the bytes_consumed
84 //EXPECT_CALL(session_, WriteData(_, StrEq(&kData2[kDataLen - 2]), _, _)). 86 //EXPECT_CALL(session_, WriteData(_, StrEq(&kData2[kDataLen - 2]), _, _)).
85 EXPECT_CALL(session_, WriteData(_, _, _, _)). 87 EXPECT_CALL(session_, WriteData(_, _, _, _)).
86 WillOnce(Return(QuicConsumedData(2, true))); 88 WillOnce(Return(QuicConsumedData(2, true)));
87 stream_.OnCanWrite(); 89 stream_.OnCanWrite();
88 } 90 }
89 91
92 TEST_F(ReliableQuicStreamTest, ConnectionCloseAfterStreamClose) {
93 stream_.CloseReadSide();
94 stream_.CloseWriteSide();
95 EXPECT_EQ(QUIC_STREAM_NO_ERROR, stream_.stream_error());
96 EXPECT_EQ(QUIC_NO_ERROR, stream_.connection_error());
97 stream_.ConnectionClose(QUIC_INTERNAL_ERROR, false);
98 EXPECT_EQ(QUIC_STREAM_NO_ERROR, stream_.stream_error());
99 EXPECT_EQ(QUIC_NO_ERROR, stream_.connection_error());
100 }
101
90 } // namespace 102 } // namespace
91 } // namespace test 103 } // namespace test
92 } // namespace net 104 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/reliable_quic_stream.cc ('k') | net/quic/test_tools/crypto_test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698