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

Side by Side Diff: net/tools/quic/quic_simple_server_stream_test.cc

Issue 2176323002: Deprecate FLAGS_quic_disable_pre_30. Remove QUIC versions [25-29]. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@127879468
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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/tools/quic/quic_simple_server_stream.h" 5 #include "net/tools/quic/quic_simple_server_stream.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/string_piece.h" 10 #include "base/strings/string_piece.h"
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 EXPECT_CALL(session_, WritevData(_, _, _, _, _, _)) 279 EXPECT_CALL(session_, WritevData(_, _, _, _, _, _))
280 .Times(AnyNumber()) 280 .Times(AnyNumber())
281 .WillRepeatedly(Invoke(MockQuicSession::ConsumeAllData)); 281 .WillRepeatedly(Invoke(MockQuicSession::ConsumeAllData));
282 282
283 EXPECT_FALSE(stream_->fin_received()); 283 EXPECT_FALSE(stream_->fin_received());
284 EXPECT_FALSE(stream_->rst_received()); 284 EXPECT_FALSE(stream_->rst_received());
285 285
286 stream_->set_fin_sent(true); 286 stream_->set_fin_sent(true);
287 stream_->CloseWriteSide(); 287 stream_->CloseWriteSide();
288 288
289 if (GetParam() > QUIC_VERSION_28) { 289 EXPECT_CALL(session_, SendRstStream(_, QUIC_STREAM_NO_ERROR, _)).Times(1);
290 EXPECT_CALL(session_, SendRstStream(_, QUIC_STREAM_NO_ERROR, _)).Times(1);
291 } else {
292 EXPECT_CALL(session_, SendRstStream(_, QUIC_STREAM_NO_ERROR, _)).Times(0);
293 }
294 stream_->StopReading(); 290 stream_->StopReading();
295 } 291 }
296 292
297 TEST_P(QuicSimpleServerStreamTest, TestFramingExtraData) { 293 TEST_P(QuicSimpleServerStreamTest, TestFramingExtraData) {
298 string large_body = "hello world!!!!!!"; 294 string large_body = "hello world!!!!!!";
299 295
300 // We'll automatically write out an error (headers + body) 296 // We'll automatically write out an error (headers + body)
301 EXPECT_CALL(session_, WriteHeadersMock(_, _, _, _, _)); 297 EXPECT_CALL(session_, WriteHeadersMock(_, _, _, _, _));
302 EXPECT_CALL(session_, WritevData(_, _, _, _, _, _)) 298 EXPECT_CALL(session_, WritevData(_, _, _, _, _, _))
303 .WillOnce(Invoke(MockQuicSession::ConsumeAllData)); 299 .WillOnce(Invoke(MockQuicSession::ConsumeAllData));
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 EXPECT_FALSE(stream_->reading_stopped()); 590 EXPECT_FALSE(stream_->reading_stopped());
595 EXPECT_FALSE(stream_->write_side_closed()); 591 EXPECT_FALSE(stream_->write_side_closed());
596 } 592 }
597 593
598 TEST_P(QuicSimpleServerStreamTest, SendQuicRstStreamNoErrorWithEarlyResponse) { 594 TEST_P(QuicSimpleServerStreamTest, SendQuicRstStreamNoErrorWithEarlyResponse) {
599 InSequence s; 595 InSequence s;
600 EXPECT_CALL(session_, WriteHeadersMock(stream_->id(), _, false, _, nullptr)); 596 EXPECT_CALL(session_, WriteHeadersMock(stream_->id(), _, false, _, nullptr));
601 EXPECT_CALL(session_, WritevData(_, _, _, _, _, _)) 597 EXPECT_CALL(session_, WritevData(_, _, _, _, _, _))
602 .Times(1) 598 .Times(1)
603 .WillOnce(Return(QuicConsumedData(3, true))); 599 .WillOnce(Return(QuicConsumedData(3, true)));
604 if (GetParam() > QUIC_VERSION_28) { 600 EXPECT_CALL(session_, SendRstStream(_, QUIC_STREAM_NO_ERROR, _)).Times(1);
605 EXPECT_CALL(session_, SendRstStream(_, QUIC_STREAM_NO_ERROR, _)).Times(1);
606 } else {
607 EXPECT_CALL(session_, SendRstStream(_, QUIC_STREAM_NO_ERROR, _)).Times(0);
608 }
609 EXPECT_FALSE(stream_->fin_received()); 601 EXPECT_FALSE(stream_->fin_received());
610 QuicSimpleServerStreamPeer::SendErrorResponse(stream_); 602 QuicSimpleServerStreamPeer::SendErrorResponse(stream_);
611 EXPECT_TRUE(stream_->reading_stopped()); 603 EXPECT_TRUE(stream_->reading_stopped());
612 EXPECT_TRUE(stream_->write_side_closed()); 604 EXPECT_TRUE(stream_->write_side_closed());
613 } 605 }
614 606
615 TEST_P(QuicSimpleServerStreamTest, 607 TEST_P(QuicSimpleServerStreamTest,
616 DoNotSendQuicRstStreamNoErrorWithRstReceived) { 608 DoNotSendQuicRstStreamNoErrorWithRstReceived) {
617 InSequence s; 609 InSequence s;
618 EXPECT_FALSE(stream_->reading_stopped()); 610 EXPECT_FALSE(stream_->reading_stopped());
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 }; 644 };
653 StringPiece data(arr, arraysize(arr)); 645 StringPiece data(arr, arraysize(arr));
654 QuicStreamFrame frame(stream_->id(), true, 0, data); 646 QuicStreamFrame frame(stream_->id(), true, 0, data);
655 // Verify that we don't crash when we get a invalid headers in stream frame. 647 // Verify that we don't crash when we get a invalid headers in stream frame.
656 stream_->OnStreamFrame(frame); 648 stream_->OnStreamFrame(frame);
657 } 649 }
658 650
659 } // namespace 651 } // namespace
660 } // namespace test 652 } // namespace test
661 } // namespace net 653 } // namespace net
OLDNEW
« net/tools/quic/quic_dispatcher.cc ('K') | « net/tools/quic/quic_dispatcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698