OLD | NEW |
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 Loading... |
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_->AllReadDataConsumed() && | 165 return socket_data_->at_read_eof() && socket_data_->at_write_eof(); |
166 socket_data_->AllWriteDataConsumed(); | |
167 } | 166 } |
168 | 167 |
169 void ProcessPacket(scoped_ptr<QuicEncryptedPacket> packet) { | 168 void ProcessPacket(scoped_ptr<QuicEncryptedPacket> packet) { |
170 connection_->ProcessUdpPacket(self_addr_, peer_addr_, *packet); | 169 connection_->ProcessUdpPacket(self_addr_, peer_addr_, *packet); |
171 } | 170 } |
172 | 171 |
173 // Configures the test fixture to use the list of expected writes. | 172 // Configures the test fixture to use the list of expected writes. |
174 void Initialize() { | 173 void Initialize() { |
175 mock_writes_.reset(new MockWrite[writes_.size()]); | 174 mock_writes_.reset(new MockWrite[writes_.size()]); |
176 for (size_t i = 0; i < writes_.size(); i++) { | 175 for (size_t i = 0; i < writes_.size(); i++) { |
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
753 // Set Delegate to nullptr and make sure EffectivePriority returns highest | 752 // Set Delegate to nullptr and make sure EffectivePriority returns highest |
754 // priority. | 753 // priority. |
755 reliable_stream->SetDelegate(nullptr); | 754 reliable_stream->SetDelegate(nullptr); |
756 DCHECK_EQ(QuicWriteBlockedList::kHighestPriority, | 755 DCHECK_EQ(QuicWriteBlockedList::kHighestPriority, |
757 reliable_stream->EffectivePriority()); | 756 reliable_stream->EffectivePriority()); |
758 reliable_stream->SetDelegate(delegate); | 757 reliable_stream->SetDelegate(delegate); |
759 } | 758 } |
760 | 759 |
761 } // namespace test | 760 } // namespace test |
762 } // namespace net | 761 } // namespace net |
OLD | NEW |