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

Side by Side Diff: net/tools/quic/quic_dispatcher_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/tools/quic/end_to_end_test.cc ('k') | net/tools/quic/quic_simple_server_session_test.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/tools/quic/quic_dispatcher.h" 5 #include "net/tools/quic/quic_dispatcher.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <ostream> 8 #include <ostream>
9 #include <string> 9 #include <string>
10 10
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 client_hello.GetSerialized().AsStringPiece().as_string()); 720 client_hello.GetSerialized().AsStringPiece().as_string());
721 721
722 if (GetParam().enable_stateless_rejects_via_flag) { 722 if (GetParam().enable_stateless_rejects_via_flag) {
723 EXPECT_EQ(true, 723 EXPECT_EQ(true,
724 time_wait_list_manager_->IsConnectionIdInTimeWait(connection_id)); 724 time_wait_list_manager_->IsConnectionIdInTimeWait(connection_id));
725 } 725 }
726 } 726 }
727 727
728 TEST_P(QuicDispatcherStatelessRejectTest, BufferNonChlo) { 728 TEST_P(QuicDispatcherStatelessRejectTest, BufferNonChlo) {
729 FLAGS_quic_use_cheap_stateless_rejects = true; 729 FLAGS_quic_use_cheap_stateless_rejects = true;
730 FLAGS_quic_always_log_bugs_for_tests = true;
731 CreateTimeWaitListManager(); 730 CreateTimeWaitListManager();
732 731
733 const IPEndPoint client_address(net::test::Loopback4(), 1); 732 const IPEndPoint client_address(net::test::Loopback4(), 1);
734 const QuicConnectionId connection_id = 1; 733 const QuicConnectionId connection_id = 1;
735 734
736 if (!GetParam().enable_stateless_rejects_via_flag && 735 if (!GetParam().enable_stateless_rejects_via_flag &&
737 !FLAGS_quic_buffer_packet_till_chlo) { 736 !FLAGS_quic_buffer_packet_till_chlo) {
738 // If stateless rejects are not being used and early arrived packets are not 737 // If stateless rejects are not being used and early arrived packets are not
739 // buffered, then a connection will be created immediately. 738 // buffered, then a connection will be created immediately.
740 EXPECT_CALL(*dispatcher_, CreateQuicSession(connection_id, client_address)) 739 EXPECT_CALL(*dispatcher_, CreateQuicSession(connection_id, client_address))
741 .WillOnce(testing::Return( 740 .WillOnce(testing::Return(
742 CreateSessionBasedOnTestParams(connection_id, client_address))); 741 CreateSessionBasedOnTestParams(connection_id, client_address)));
743 EXPECT_CALL(*reinterpret_cast<MockQuicConnection*>(session1_->connection()), 742 EXPECT_CALL(*reinterpret_cast<MockQuicConnection*>(session1_->connection()),
744 ProcessUdpPacket(_, client_address, _)) 743 ProcessUdpPacket(_, client_address, _))
745 .WillOnce(testing::WithArg<2>( 744 .WillOnce(testing::WithArg<2>(
746 Invoke(CreateFunctor(&QuicDispatcherTest::ValidatePacket, 745 Invoke(CreateFunctor(&QuicDispatcherTest::ValidatePacket,
747 base::Unretained(this), connection_id)))); 746 base::Unretained(this), connection_id))));
748 } 747 }
749 bool first_packet_dropped = GetParam().enable_stateless_rejects_via_flag && 748 bool first_packet_dropped = GetParam().enable_stateless_rejects_via_flag &&
750 !FLAGS_quic_buffer_packet_till_chlo; 749 !FLAGS_quic_buffer_packet_till_chlo;
751 if (first_packet_dropped) { 750 if (first_packet_dropped) {
752 // Never do stateless reject while 751 // Never do stateless reject while
753 // FLAGS_quic_buffer_packet_till_chlo is off. 752 // FLAGS_quic_buffer_packet_till_chlo is off.
754 EXPECT_DFATAL( 753 EXPECT_QUIC_BUG(
755 ProcessPacket(client_address, connection_id, true, false, 754 ProcessPacket(client_address, connection_id, true, false,
756 "NOT DATA FOR A CHLO"), 755 "NOT DATA FOR A CHLO"),
757 "Have to drop packet because buffering non-chlo packet is " 756 "Have to drop packet because buffering non-chlo packet is "
758 "not supported while trying to do stateless reject. " 757 "not supported while trying to do stateless reject. "
759 "--gfe2_reloadable_flag_quic_buffer_packet_till_chlo false " 758 "--gfe2_reloadable_flag_quic_buffer_packet_till_chlo false "
760 "--gfe2_reloadable_flag_quic_use_cheap_stateless_rejects true"); 759 "--gfe2_reloadable_flag_quic_use_cheap_stateless_rejects true");
761 } else { 760 } else {
762 ProcessPacket(client_address, connection_id, true, false, 761 ProcessPacket(client_address, connection_id, true, false,
763 "NOT DATA FOR A CHLO"); 762 "NOT DATA FOR A CHLO");
764 } 763 }
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
1278 // New arrived CHLO will be dropped because this connection is in time wait 1277 // New arrived CHLO will be dropped because this connection is in time wait
1279 // list. 1278 // list.
1280 ASSERT_TRUE(time_wait_list_manager_->IsConnectionIdInTimeWait(conn_id)); 1279 ASSERT_TRUE(time_wait_list_manager_->IsConnectionIdInTimeWait(conn_id));
1281 EXPECT_CALL(*time_wait_list_manager_, ProcessPacket(_, _, conn_id, _, _)); 1280 EXPECT_CALL(*time_wait_list_manager_, ProcessPacket(_, _, conn_id, _, _));
1282 ProcessPacket(client_address, conn_id, true, false, SerializeFullCHLO()); 1281 ProcessPacket(client_address, conn_id, true, false, SerializeFullCHLO());
1283 } 1282 }
1284 1283
1285 } // namespace 1284 } // namespace
1286 } // namespace test 1285 } // namespace test
1287 } // namespace net 1286 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/end_to_end_test.cc ('k') | net/tools/quic/quic_simple_server_session_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698