| 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 "base/thread_task_runner_handle.h" | 9 #include "base/thread_task_runner_handle.h" |
| 10 #include "net/base/chunked_upload_data_stream.h" | 10 #include "net/base/chunked_upload_data_stream.h" |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 | 187 |
| 188 MockUDPClientSocket* socket = new MockUDPClientSocket(socket_data_.get(), | 188 MockUDPClientSocket* socket = new MockUDPClientSocket(socket_data_.get(), |
| 189 net_log_.net_log()); | 189 net_log_.net_log()); |
| 190 socket->Connect(peer_addr_); | 190 socket->Connect(peer_addr_); |
| 191 runner_ = new TestTaskRunner(&clock_); | 191 runner_ = new TestTaskRunner(&clock_); |
| 192 send_algorithm_ = new MockSendAlgorithm(); | 192 send_algorithm_ = new MockSendAlgorithm(); |
| 193 EXPECT_CALL(*send_algorithm_, InRecovery()).WillRepeatedly(Return(false)); | 193 EXPECT_CALL(*send_algorithm_, InRecovery()).WillRepeatedly(Return(false)); |
| 194 EXPECT_CALL(*send_algorithm_, InSlowStart()).WillRepeatedly(Return(false)); | 194 EXPECT_CALL(*send_algorithm_, InSlowStart()).WillRepeatedly(Return(false)); |
| 195 EXPECT_CALL(*send_algorithm_, | 195 EXPECT_CALL(*send_algorithm_, |
| 196 OnPacketSent(_, _, _, _, _)).WillRepeatedly(Return(true)); | 196 OnPacketSent(_, _, _, _, _)).WillRepeatedly(Return(true)); |
| 197 EXPECT_CALL(*send_algorithm_, RetransmissionDelay()).WillRepeatedly( | 197 EXPECT_CALL(*send_algorithm_, RetransmissionDelay()) |
| 198 Return(QuicTime::Delta::Zero())); | 198 .WillRepeatedly(Return(QuicTime::Delta::Zero())); |
| 199 EXPECT_CALL(*send_algorithm_, GetCongestionWindow()).WillRepeatedly( | 199 EXPECT_CALL(*send_algorithm_, GetCongestionWindow()) |
| 200 Return(kMaxPacketSize)); | 200 .WillRepeatedly(Return(kMaxPacketSize)); |
| 201 EXPECT_CALL(*send_algorithm_, TimeUntilSend(_, _, _)). | 201 EXPECT_CALL(*send_algorithm_, PacingRate()) |
| 202 WillRepeatedly(Return(QuicTime::Delta::Zero())); | 202 .WillRepeatedly(Return(QuicBandwidth::Zero())); |
| 203 EXPECT_CALL(*send_algorithm_, BandwidthEstimate()).WillRepeatedly( | 203 EXPECT_CALL(*send_algorithm_, TimeUntilSend(_, _, _)) |
| 204 Return(QuicBandwidth::Zero())); | 204 .WillRepeatedly(Return(QuicTime::Delta::Zero())); |
| 205 EXPECT_CALL(*send_algorithm_, BandwidthEstimate()) |
| 206 .WillRepeatedly(Return(QuicBandwidth::Zero())); |
| 205 EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _)).Times(AnyNumber()); | 207 EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _)).Times(AnyNumber()); |
| 206 helper_.reset(new QuicConnectionHelper(runner_.get(), &clock_, | 208 helper_.reset(new QuicConnectionHelper(runner_.get(), &clock_, |
| 207 &random_generator_)); | 209 &random_generator_)); |
| 208 TestPacketWriterFactory writer_factory(socket); | 210 TestPacketWriterFactory writer_factory(socket); |
| 209 connection_ = new TestQuicConnection(SupportedVersions(GetParam()), | 211 connection_ = new TestQuicConnection(SupportedVersions(GetParam()), |
| 210 connection_id_, peer_addr_, | 212 connection_id_, peer_addr_, |
| 211 helper_.get(), writer_factory); | 213 helper_.get(), writer_factory); |
| 212 connection_->set_visitor(&visitor_); | 214 connection_->set_visitor(&visitor_); |
| 213 connection_->SetSendAlgorithm(send_algorithm_); | 215 connection_->SetSendAlgorithm(send_algorithm_); |
| 214 session_.reset(new QuicChromiumClientSession( | 216 session_.reset(new QuicChromiumClientSession( |
| (...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 779 // Set Delegate to nullptr and make sure EffectivePriority returns highest | 781 // Set Delegate to nullptr and make sure EffectivePriority returns highest |
| 780 // priority. | 782 // priority. |
| 781 reliable_stream->SetDelegate(nullptr); | 783 reliable_stream->SetDelegate(nullptr); |
| 782 DCHECK_EQ(QuicWriteBlockedList::kHighestPriority, | 784 DCHECK_EQ(QuicWriteBlockedList::kHighestPriority, |
| 783 reliable_stream->EffectivePriority()); | 785 reliable_stream->EffectivePriority()); |
| 784 reliable_stream->SetDelegate(delegate); | 786 reliable_stream->SetDelegate(delegate); |
| 785 } | 787 } |
| 786 | 788 |
| 787 } // namespace test | 789 } // namespace test |
| 788 } // namespace net | 790 } // namespace net |
| OLD | NEW |