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

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

Issue 1114383003: Add AllReadDataConsumed and AllWriteDataConsumed methods to SocketDataProvider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
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_http_stream.h" 5 #include "net/quic/quic_http_stream.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "net/base/chunked_upload_data_stream.h" 9 #include "net/base/chunked_upload_data_stream.h"
10 #include "net/base/elements_upload_data_stream.h" 10 #include "net/base/elements_upload_data_stream.h"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 void AddWrite(scoped_ptr<QuicEncryptedPacket> packet) { 155 void AddWrite(scoped_ptr<QuicEncryptedPacket> packet) {
156 writes_.push_back(PacketToWrite(SYNCHRONOUS, packet.release())); 156 writes_.push_back(PacketToWrite(SYNCHRONOUS, packet.release()));
157 } 157 }
158 158
159 // Returns the packet to be written at position |pos|. 159 // Returns the packet to be written at position |pos|.
160 QuicEncryptedPacket* GetWrite(size_t pos) { 160 QuicEncryptedPacket* GetWrite(size_t pos) {
161 return writes_[pos].packet; 161 return writes_[pos].packet;
162 } 162 }
163 163
164 bool AtEof() { 164 bool AtEof() {
165 return socket_data_->at_read_eof() && socket_data_->at_write_eof(); 165 return socket_data_->AllReadDataConsumed() &&
166 socket_data_->AllWriteDataConsumed();
166 } 167 }
167 168
168 void ProcessPacket(scoped_ptr<QuicEncryptedPacket> packet) { 169 void ProcessPacket(scoped_ptr<QuicEncryptedPacket> packet) {
169 connection_->ProcessUdpPacket(self_addr_, peer_addr_, *packet); 170 connection_->ProcessUdpPacket(self_addr_, peer_addr_, *packet);
170 } 171 }
171 172
172 // Configures the test fixture to use the list of expected writes. 173 // Configures the test fixture to use the list of expected writes.
173 void Initialize() { 174 void Initialize() {
174 mock_writes_.reset(new MockWrite[writes_.size()]); 175 mock_writes_.reset(new MockWrite[writes_.size()]);
175 for (size_t i = 0; i < writes_.size(); i++) { 176 for (size_t i = 0; i < writes_.size(); i++) {
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after
752 // Set Delegate to nullptr and make sure EffectivePriority returns highest 753 // Set Delegate to nullptr and make sure EffectivePriority returns highest
753 // priority. 754 // priority.
754 reliable_stream->SetDelegate(nullptr); 755 reliable_stream->SetDelegate(nullptr);
755 DCHECK_EQ(QuicWriteBlockedList::kHighestPriority, 756 DCHECK_EQ(QuicWriteBlockedList::kHighestPriority,
756 reliable_stream->EffectivePriority()); 757 reliable_stream->EffectivePriority());
757 reliable_stream->SetDelegate(delegate); 758 reliable_stream->SetDelegate(delegate);
758 } 759 }
759 760
760 } // namespace test 761 } // namespace test
761 } // namespace net 762 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698