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

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

Issue 1190823003: Remove dependency on headers stream from QuicSession. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Final_0616
Patch Set: deleted an include Created 5 years, 6 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_spdy_session.cc ('k') | net/quic/quic_unacked_packet_map.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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 void OnFrame(QuicStreamOffset byte_offset, const char* data) { 94 void OnFrame(QuicStreamOffset byte_offset, const char* data) {
95 QuicStreamFrame frame; 95 QuicStreamFrame frame;
96 frame.stream_id = 1; 96 frame.stream_id = 1;
97 frame.offset = byte_offset; 97 frame.offset = byte_offset;
98 frame.data = StringPiece(data); 98 frame.data = StringPiece(data);
99 frame.fin = false; 99 frame.fin = false;
100 sequencer_->OnStreamFrame(frame); 100 sequencer_->OnStreamFrame(frame);
101 } 101 }
102 102
103 MockConnection* connection_; 103 MockConnection* connection_;
104 MockSession session_; 104 MockQuicSpdySession session_;
105 testing::StrictMock<MockStream> stream_; 105 testing::StrictMock<MockStream> stream_;
106 scoped_ptr<QuicStreamSequencer> sequencer_; 106 scoped_ptr<QuicStreamSequencer> sequencer_;
107 map<QuicStreamOffset, string>* buffered_frames_; 107 map<QuicStreamOffset, string>* buffered_frames_;
108 }; 108 };
109 109
110 TEST_F(QuicStreamSequencerTest, RejectOldFrame) { 110 TEST_F(QuicStreamSequencerTest, RejectOldFrame) {
111 EXPECT_CALL(stream_, ProcessRawData(StrEq("abc"), 3)).WillOnce(Return(3)); 111 EXPECT_CALL(stream_, ProcessRawData(StrEq("abc"), 3)).WillOnce(Return(3));
112 112
113 OnFrame(0, "abc"); 113 OnFrame(0, "abc");
114 EXPECT_EQ(0u, buffered_frames_->size()); 114 EXPECT_EQ(0u, buffered_frames_->size());
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 QuicStreamFrame frame2(kClientDataStreamId1, false, 2, StringPiece("hello")); 414 QuicStreamFrame frame2(kClientDataStreamId1, false, 2, StringPiece("hello"));
415 EXPECT_TRUE(sequencer_->FrameOverlapsBufferedData(frame2)); 415 EXPECT_TRUE(sequencer_->FrameOverlapsBufferedData(frame2));
416 EXPECT_CALL(stream_, CloseConnectionWithDetails(QUIC_INVALID_STREAM_FRAME, _)) 416 EXPECT_CALL(stream_, CloseConnectionWithDetails(QUIC_INVALID_STREAM_FRAME, _))
417 .Times(1); 417 .Times(1);
418 sequencer_->OnStreamFrame(frame2); 418 sequencer_->OnStreamFrame(frame2);
419 } 419 }
420 420
421 } // namespace 421 } // namespace
422 } // namespace test 422 } // namespace test
423 } // namespace net 423 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_spdy_session.cc ('k') | net/quic/quic_unacked_packet_map.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698