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

Side by Side Diff: net/quic/quartc/quartc_stream_test.cc

Issue 2820263005: In QUIC version >= 38, enables random padding of size [1, 256] (Closed)
Patch Set: Created 3 years, 8 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/core/quic_stream_test.cc ('k') | net/quic/test_tools/quic_test_utils.h » ('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) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 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/quartc/quartc_stream.h" 5 #include "net/quic/quartc/quartc_stream.h"
6 6
7 #include "base/threading/thread_task_runner_handle.h" 7 #include "base/threading/thread_task_runner_handle.h"
8 #include "net/quic/core/crypto/quic_random.h" 8 #include "net/quic/core/crypto/quic_random.h"
9 #include "net/quic/core/quic_session.h" 9 #include "net/quic/core/quic_session.h"
10 #include "net/quic/core/quic_simple_buffer_allocator.h" 10 #include "net/quic/core/quic_simple_buffer_allocator.h"
(...skipping 19 matching lines...) Expand all
30 std::string* write_buffer) 30 std::string* write_buffer)
31 : QuicSession(connection, nullptr /*visitor*/, config), 31 : QuicSession(connection, nullptr /*visitor*/, config),
32 write_buffer_(write_buffer) {} 32 write_buffer_(write_buffer) {}
33 33
34 // Writes outgoing data from QuicStream to a string. 34 // Writes outgoing data from QuicStream to a string.
35 QuicConsumedData WritevData( 35 QuicConsumedData WritevData(
36 QuicStream* stream, 36 QuicStream* stream,
37 QuicStreamId id, 37 QuicStreamId id,
38 QuicIOVector iovector, 38 QuicIOVector iovector,
39 QuicStreamOffset offset, 39 QuicStreamOffset offset,
40 bool fin, 40 StreamSendingState fin,
41 QuicReferenceCountedPointer< 41 QuicReferenceCountedPointer<
42 QuicAckListenerInterface> /*ack_notifier_delegate*/) override { 42 QuicAckListenerInterface> /*ack_notifier_delegate*/) override {
43 if (!writable_) { 43 if (!writable_) {
44 return QuicConsumedData(0, false); 44 return QuicConsumedData(0, false);
45 } 45 }
46 46
47 const char* data = reinterpret_cast<const char*>(iovector.iov->iov_base); 47 const char* data = reinterpret_cast<const char*>(iovector.iov->iov_base);
48 size_t len = iovector.total_length; 48 size_t len = iovector.total_length;
49 write_buffer_->append(data, len); 49 write_buffer_->append(data, len);
50 return QuicConsumedData(len, fin); 50 return QuicConsumedData(len, fin);
Zhongyi Shi 2017/04/18 22:17:56 QuicConsumedData constructor should takes a boolea
Ryan Hamilton 2017/04/18 22:49:36 It does... but probably by accident :/ Fixed in th
51 } 51 }
52 52
53 QuartcStream* CreateIncomingDynamicStream(QuicStreamId id) override { 53 QuartcStream* CreateIncomingDynamicStream(QuicStreamId id) override {
54 return nullptr; 54 return nullptr;
55 } 55 }
56 56
57 QuartcStream* CreateOutgoingDynamicStream(SpdyPriority priority) override { 57 QuartcStream* CreateOutgoingDynamicStream(SpdyPriority priority) override {
58 return nullptr; 58 return nullptr;
59 } 59 }
60 60
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 TEST_F(QuartcStreamTest, CloseStream) { 257 TEST_F(QuartcStreamTest, CloseStream) {
258 CreateReliableQuicStream(); 258 CreateReliableQuicStream();
259 EXPECT_FALSE(mock_stream_delegate_->closed()); 259 EXPECT_FALSE(mock_stream_delegate_->closed());
260 stream_->OnClose(); 260 stream_->OnClose();
261 EXPECT_TRUE(mock_stream_delegate_->closed()); 261 EXPECT_TRUE(mock_stream_delegate_->closed());
262 } 262 }
263 263
264 } // namespace 264 } // namespace
265 } // namespace test 265 } // namespace test
266 } // namespace net 266 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/quic_stream_test.cc ('k') | net/quic/test_tools/quic_test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698