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

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

Issue 2249813002: Create EXPECT_QUIC_BUG macro, and modify QUIC tests to use it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « net/quic/core/quic_stream_sequencer_test.cc ('k') | net/quic/test_tools/quic_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/core/reliable_quic_stream.h" 5 #include "net/quic/core/reliable_quic_stream.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "net/quic/core/quic_connection.h" 9 #include "net/quic/core/quic_connection.h"
10 #include "net/quic/core/quic_flags.h" 10 #include "net/quic/core/quic_flags.h"
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 .WillOnce(Return(QuicConsumedData(kDataLen, true))); 177 .WillOnce(Return(QuicConsumedData(kDataLen, true)));
178 stream_->WriteOrBufferData(kData1, false, nullptr); 178 stream_->WriteOrBufferData(kData1, false, nullptr);
179 EXPECT_FALSE(HasWriteBlockedStreams()); 179 EXPECT_FALSE(HasWriteBlockedStreams());
180 } 180 }
181 181
182 TEST_F(ReliableQuicStreamTest, NoBlockingIfNoDataOrFin) { 182 TEST_F(ReliableQuicStreamTest, NoBlockingIfNoDataOrFin) {
183 Initialize(kShouldProcessData); 183 Initialize(kShouldProcessData);
184 184
185 // Write no data and no fin. If we consume nothing we should not be write 185 // Write no data and no fin. If we consume nothing we should not be write
186 // blocked. 186 // blocked.
187 EXPECT_DFATAL(stream_->WriteOrBufferData(StringPiece(), false, nullptr), ""); 187 EXPECT_QUIC_BUG(stream_->WriteOrBufferData(StringPiece(), false, nullptr),
188 "");
188 EXPECT_FALSE(HasWriteBlockedStreams()); 189 EXPECT_FALSE(HasWriteBlockedStreams());
189 } 190 }
190 191
191 TEST_F(ReliableQuicStreamTest, BlockIfOnlySomeDataConsumed) { 192 TEST_F(ReliableQuicStreamTest, BlockIfOnlySomeDataConsumed) {
192 Initialize(kShouldProcessData); 193 Initialize(kShouldProcessData);
193 194
194 // Write some data and no fin. If we consume some but not all of the data, 195 // Write some data and no fin. If we consume some but not all of the data,
195 // we should be write blocked a not all the data was consumed. 196 // we should be write blocked a not all the data was consumed.
196 EXPECT_CALL(*session_, WritevData(stream_, kTestStreamId, _, _, _, _)) 197 EXPECT_CALL(*session_, WritevData(stream_, kTestStreamId, _, _, _, _))
197 .WillOnce(Return(QuicConsumedData(1, false))); 198 .WillOnce(Return(QuicConsumedData(1, false)));
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 // Receive remaining data and FIN for the request. 707 // Receive remaining data and FIN for the request.
707 QuicStreamFrame frame2(stream_->id(), true, 0, StringPiece("End")); 708 QuicStreamFrame frame2(stream_->id(), true, 0, StringPiece("End"));
708 stream_->OnStreamFrame(frame2); 709 stream_->OnStreamFrame(frame2);
709 EXPECT_TRUE(stream_->fin_received()); 710 EXPECT_TRUE(stream_->fin_received());
710 EXPECT_TRUE(stream_->HasFinalReceivedByteOffset()); 711 EXPECT_TRUE(stream_->HasFinalReceivedByteOffset());
711 } 712 }
712 713
713 } // namespace 714 } // namespace
714 } // namespace test 715 } // namespace test
715 } // namespace net 716 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/quic_stream_sequencer_test.cc ('k') | net/quic/test_tools/quic_test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698