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

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

Issue 23691073: Land Recent QUIC changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Compiler/unittests fix Created 7 years, 3 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 | Annotate | Revision Log
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_reliable_server_stream.h" 5 #include "net/tools/quic/quic_reliable_server_stream.h"
6 6
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "net/quic/quic_spdy_compressor.h" 8 #include "net/quic/quic_spdy_compressor.h"
9 #include "net/quic/quic_utils.h" 9 #include "net/quic/quic_utils.h"
10 #include "net/quic/test_tools/quic_test_utils.h" 10 #include "net/quic/test_tools/quic_test_utils.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 } 114 }
115 115
116 BalsaHeaders response_headers_; 116 BalsaHeaders response_headers_;
117 EpollServer eps_; 117 EpollServer eps_;
118 StrictMock<MockSession> session_; 118 StrictMock<MockSession> session_;
119 scoped_ptr<QuicReliableServerStream> stream_; 119 scoped_ptr<QuicReliableServerStream> stream_;
120 string headers_string_; 120 string headers_string_;
121 string body_; 121 string body_;
122 }; 122 };
123 123
124 QuicConsumedData ConsumeAllData(QuicStreamId id, const struct iovec* iov, 124 QuicConsumedData ConsumeAllData(QuicStreamId id,
125 int count, QuicStreamOffset offset, bool fin) { 125 const struct iovec* iov,
126 int iov_count,
127 QuicStreamOffset offset,
128 bool fin) {
126 ssize_t consumed_length = 0; 129 ssize_t consumed_length = 0;
127 for (int i = 0; i < count; ++i) { 130 for (int i = 0; i < iov_count; ++i) {
128 consumed_length += iov[i].iov_len; 131 consumed_length += iov[i].iov_len;
129 } 132 }
130 return QuicConsumedData(consumed_length, fin); 133 return QuicConsumedData(consumed_length, fin);
131 } 134 }
132 135
133 TEST_F(QuicReliableServerStreamTest, TestFraming) { 136 TEST_F(QuicReliableServerStreamTest, TestFraming) {
134 EXPECT_CALL(session_, WritevData(_, _, _, _, _)).Times(AnyNumber()). 137 EXPECT_CALL(session_, WritevData(_, _, _, _, _)).Times(AnyNumber()).
135 WillRepeatedly(Invoke(ConsumeAllData)); 138 WillRepeatedly(Invoke(ConsumeAllData));
136 139
137 EXPECT_EQ(headers_string_.size(), stream_->ProcessData( 140 EXPECT_EQ(headers_string_.size(), stream_->ProcessData(
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 219
217 stream_->SendErrorResponse(); 220 stream_->SendErrorResponse();
218 EXPECT_TRUE(stream_->read_side_closed()); 221 EXPECT_TRUE(stream_->read_side_closed());
219 EXPECT_TRUE(stream_->write_side_closed()); 222 EXPECT_TRUE(stream_->write_side_closed());
220 } 223 }
221 224
222 } // namespace 225 } // namespace
223 } // namespace test 226 } // namespace test
224 } // namespace tools 227 } // namespace tools
225 } // namespace net 228 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_epoll_connection_helper_test.cc ('k') | net/tools/quic/quic_server_session_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698