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

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

Issue 973683003: CL generated with data from dead-code analysis using (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Change_PrrSender_TimeUntilSend_87535917
Patch Set: Created 5 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/quic_server_id.h ('k') | net/quic/quic_time.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/quic_stream_sequencer.h" 5 #include "net/quic/quic_stream_sequencer.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 protected: 62 protected:
63 QuicStreamSequencerTest() 63 QuicStreamSequencerTest()
64 : connection_(new MockConnection(false)), 64 : connection_(new MockConnection(false)),
65 session_(connection_), 65 session_(connection_),
66 stream_(&session_, 1), 66 stream_(&session_, 1),
67 sequencer_(new QuicStreamSequencer(&stream_)), 67 sequencer_(new QuicStreamSequencer(&stream_)),
68 buffered_frames_( 68 buffered_frames_(
69 QuicStreamSequencerPeer::GetBufferedFrames(sequencer_.get())) { 69 QuicStreamSequencerPeer::GetBufferedFrames(sequencer_.get())) {
70 } 70 }
71 71
72 bool VerifyReadableRegions(const char** expected, size_t num_expected) {
73 iovec iovecs[5];
74 size_t num_iovecs = sequencer_->GetReadableRegions(iovecs,
75 arraysize(iovecs));
76 return VerifyIovecs(iovecs, num_iovecs, expected, num_expected);
77 }
78
79 bool VerifyIovecs(iovec* iovecs, 72 bool VerifyIovecs(iovec* iovecs,
80 size_t num_iovecs, 73 size_t num_iovecs,
81 const char** expected, 74 const char** expected,
82 size_t num_expected) { 75 size_t num_expected) {
83 if (num_expected != num_iovecs) { 76 if (num_expected != num_iovecs) {
84 LOG(ERROR) << "Incorrect number of iovecs. Expected: " 77 LOG(ERROR) << "Incorrect number of iovecs. Expected: "
85 << num_expected << " Actual: " << num_iovecs; 78 << num_expected << " Actual: " << num_iovecs;
86 return false; 79 return false;
87 } 80 }
88 for (size_t i = 0; i < num_expected; ++i) { 81 for (size_t i = 0; i < num_expected; ++i) {
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 QuicStreamFrame frame2(kClientDataStreamId1, false, 2, MakeIOVector("hello")); 432 QuicStreamFrame frame2(kClientDataStreamId1, false, 2, MakeIOVector("hello"));
440 EXPECT_TRUE(sequencer_->FrameOverlapsBufferedData(frame2)); 433 EXPECT_TRUE(sequencer_->FrameOverlapsBufferedData(frame2));
441 EXPECT_CALL(stream_, CloseConnectionWithDetails(QUIC_INVALID_STREAM_FRAME, _)) 434 EXPECT_CALL(stream_, CloseConnectionWithDetails(QUIC_INVALID_STREAM_FRAME, _))
442 .Times(1); 435 .Times(1);
443 sequencer_->OnStreamFrame(frame2); 436 sequencer_->OnStreamFrame(frame2);
444 } 437 }
445 438
446 } // namespace 439 } // namespace
447 } // namespace test 440 } // namespace test
448 } // namespace net 441 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_server_id.h ('k') | net/quic/quic_time.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698