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

Side by Side Diff: net/quic/test_tools/quic_test_utils.cc

Issue 2747443002: Landing recent QUIC changes until Sun Mar 5 09:18:09 2017 +0000 (Closed)
Patch Set: Fixed formatting errors in quic_error_mapping.cc Created 3 years, 9 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/test_tools/quic_test_utils.h ('k') | net/quic/test_tools/simple_quic_framer.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/test_tools/quic_test_utils.h" 5 #include "net/quic/test_tools/quic_test_utils.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <memory> 8 #include <memory>
9 9
10 #include "net/quic/core/crypto/crypto_framer.h" 10 #include "net/quic/core/crypto/crypto_framer.h"
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 214
215 bool NoOpFramerVisitor::OnWindowUpdateFrame( 215 bool NoOpFramerVisitor::OnWindowUpdateFrame(
216 const QuicWindowUpdateFrame& frame) { 216 const QuicWindowUpdateFrame& frame) {
217 return true; 217 return true;
218 } 218 }
219 219
220 bool NoOpFramerVisitor::OnBlockedFrame(const QuicBlockedFrame& frame) { 220 bool NoOpFramerVisitor::OnBlockedFrame(const QuicBlockedFrame& frame) {
221 return true; 221 return true;
222 } 222 }
223 223
224 bool NoOpFramerVisitor::OnPathCloseFrame(const QuicPathCloseFrame& frame) {
225 return true;
226 }
227
228 MockQuicConnectionVisitor::MockQuicConnectionVisitor() {} 224 MockQuicConnectionVisitor::MockQuicConnectionVisitor() {}
229 225
230 MockQuicConnectionVisitor::~MockQuicConnectionVisitor() {} 226 MockQuicConnectionVisitor::~MockQuicConnectionVisitor() {}
231 227
232 MockQuicConnectionHelper::MockQuicConnectionHelper() {} 228 MockQuicConnectionHelper::MockQuicConnectionHelper() {}
233 229
234 MockQuicConnectionHelper::~MockQuicConnectionHelper() {} 230 MockQuicConnectionHelper::~MockQuicConnectionHelper() {}
235 231
236 const QuicClock* MockQuicConnectionHelper::GetClock() const { 232 const QuicClock* MockQuicConnectionHelper::GetClock() const {
237 return &clock_; 233 return &clock_;
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 QuicVersion QuicVersionMax() { 543 QuicVersion QuicVersionMax() {
548 return AllSupportedVersions().front(); 544 return AllSupportedVersions().front();
549 } 545 }
550 546
551 QuicVersion QuicVersionMin() { 547 QuicVersion QuicVersionMin() {
552 return AllSupportedVersions().back(); 548 return AllSupportedVersions().back();
553 } 549 }
554 550
555 QuicEncryptedPacket* ConstructEncryptedPacket(QuicConnectionId connection_id, 551 QuicEncryptedPacket* ConstructEncryptedPacket(QuicConnectionId connection_id,
556 bool version_flag, 552 bool version_flag,
557 bool multipath_flag,
558 bool reset_flag, 553 bool reset_flag,
559 QuicPacketNumber packet_number, 554 QuicPacketNumber packet_number,
560 const string& data) { 555 const string& data) {
561 return ConstructEncryptedPacket( 556 return ConstructEncryptedPacket(
562 connection_id, version_flag, multipath_flag, reset_flag, packet_number, 557 connection_id, version_flag, reset_flag, packet_number, data,
563 data, PACKET_8BYTE_CONNECTION_ID, PACKET_6BYTE_PACKET_NUMBER); 558 PACKET_8BYTE_CONNECTION_ID, PACKET_6BYTE_PACKET_NUMBER);
564 } 559 }
565 560
566 QuicEncryptedPacket* ConstructEncryptedPacket( 561 QuicEncryptedPacket* ConstructEncryptedPacket(
567 QuicConnectionId connection_id, 562 QuicConnectionId connection_id,
568 bool version_flag, 563 bool version_flag,
569 bool multipath_flag,
570 bool reset_flag, 564 bool reset_flag,
571 QuicPacketNumber packet_number, 565 QuicPacketNumber packet_number,
572 const string& data, 566 const string& data,
573 QuicConnectionIdLength connection_id_length, 567 QuicConnectionIdLength connection_id_length,
574 QuicPacketNumberLength packet_number_length) { 568 QuicPacketNumberLength packet_number_length) {
575 return ConstructEncryptedPacket( 569 return ConstructEncryptedPacket(connection_id, version_flag, reset_flag,
576 connection_id, version_flag, multipath_flag, reset_flag, packet_number, 570 packet_number, data, connection_id_length,
577 data, connection_id_length, packet_number_length, nullptr); 571 packet_number_length, nullptr);
578 } 572 }
579 573
580 QuicEncryptedPacket* ConstructEncryptedPacket( 574 QuicEncryptedPacket* ConstructEncryptedPacket(
581 QuicConnectionId connection_id, 575 QuicConnectionId connection_id,
582 bool version_flag, 576 bool version_flag,
583 bool multipath_flag,
584 bool reset_flag, 577 bool reset_flag,
585 QuicPacketNumber packet_number, 578 QuicPacketNumber packet_number,
586 const string& data, 579 const string& data,
587 QuicConnectionIdLength connection_id_length, 580 QuicConnectionIdLength connection_id_length,
588 QuicPacketNumberLength packet_number_length, 581 QuicPacketNumberLength packet_number_length,
589 QuicVersionVector* versions) { 582 QuicVersionVector* versions) {
590 return ConstructEncryptedPacket(connection_id, version_flag, multipath_flag, 583 return ConstructEncryptedPacket(connection_id, version_flag, reset_flag,
591 reset_flag, packet_number, data, 584 packet_number, data, connection_id_length,
592 connection_id_length, packet_number_length, 585 packet_number_length, versions,
593 versions, Perspective::IS_CLIENT); 586 Perspective::IS_CLIENT);
594 } 587 }
595 QuicEncryptedPacket* ConstructEncryptedPacket( 588 QuicEncryptedPacket* ConstructEncryptedPacket(
596 QuicConnectionId connection_id, 589 QuicConnectionId connection_id,
597 bool version_flag, 590 bool version_flag,
598 bool multipath_flag,
599 bool reset_flag, 591 bool reset_flag,
600 QuicPacketNumber packet_number, 592 QuicPacketNumber packet_number,
601 const string& data, 593 const string& data,
602 QuicConnectionIdLength connection_id_length, 594 QuicConnectionIdLength connection_id_length,
603 QuicPacketNumberLength packet_number_length, 595 QuicPacketNumberLength packet_number_length,
604 QuicVersionVector* versions, 596 QuicVersionVector* versions,
605 Perspective perspective) { 597 Perspective perspective) {
606 QuicPacketHeader header; 598 QuicPacketHeader header;
607 header.public_header.connection_id = connection_id; 599 header.public_header.connection_id = connection_id;
608 header.public_header.connection_id_length = connection_id_length; 600 header.public_header.connection_id_length = connection_id_length;
609 header.public_header.version_flag = version_flag; 601 header.public_header.version_flag = version_flag;
610 header.public_header.multipath_flag = multipath_flag; 602 header.public_header.multipath_flag = false;
611 header.public_header.reset_flag = reset_flag; 603 header.public_header.reset_flag = reset_flag;
612 header.public_header.packet_number_length = packet_number_length; 604 header.public_header.packet_number_length = packet_number_length;
613 header.packet_number = packet_number; 605 header.packet_number = packet_number;
614 QuicStreamFrame stream_frame(1, false, 0, QuicStringPiece(data)); 606 QuicStreamFrame stream_frame(1, false, 0, QuicStringPiece(data));
615 QuicFrame frame(&stream_frame); 607 QuicFrame frame(&stream_frame);
616 QuicFrames frames; 608 QuicFrames frames;
617 frames.push_back(frame); 609 frames.push_back(frame);
618 QuicFramer framer( 610 QuicFramer framer(
619 versions != nullptr ? *versions : CurrentSupportedVersions(), 611 versions != nullptr ? *versions : CurrentSupportedVersions(),
620 QuicTime::Zero(), perspective); 612 QuicTime::Zero(), perspective);
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
828 // strike register worries that we've just overflowed a uint32_t time. 820 // strike register worries that we've just overflowed a uint32_t time.
829 (*server_connection)->AdvanceTime(connection_start_time); 821 (*server_connection)->AdvanceTime(connection_start_time);
830 } 822 }
831 823
832 QuicStreamId QuicClientDataStreamId(int i) { 824 QuicStreamId QuicClientDataStreamId(int i) {
833 return kClientDataStreamId1 + 2 * i; 825 return kClientDataStreamId1 + 2 * i;
834 } 826 }
835 827
836 } // namespace test 828 } // namespace test
837 } // namespace net 829 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/test_tools/quic_test_utils.h ('k') | net/quic/test_tools/simple_quic_framer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698