| 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/test_tools/quic_test_utils.h" | 5 #include "net/quic/test_tools/quic_test_utils.h" |
| 6 | 6 |
| 7 #include "base/sha1.h" | 7 #include "base/sha1.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "net/quic/crypto/crypto_framer.h" | 10 #include "net/quic/crypto/crypto_framer.h" |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 | 223 |
| 224 void MockHelper::AdvanceTime(QuicTime::Delta delta) { | 224 void MockHelper::AdvanceTime(QuicTime::Delta delta) { |
| 225 clock_.AdvanceTime(delta); | 225 clock_.AdvanceTime(delta); |
| 226 } | 226 } |
| 227 | 227 |
| 228 MockConnection::MockConnection(bool is_server) | 228 MockConnection::MockConnection(bool is_server) |
| 229 : QuicConnection(kTestConnectionId, | 229 : QuicConnection(kTestConnectionId, |
| 230 IPEndPoint(TestPeerIPAddress(), kTestPort), | 230 IPEndPoint(TestPeerIPAddress(), kTestPort), |
| 231 new testing::NiceMock<MockHelper>(), | 231 new testing::NiceMock<MockHelper>(), |
| 232 new testing::NiceMock<MockPacketWriter>(), | 232 new testing::NiceMock<MockPacketWriter>(), |
| 233 true /* owns_writer */, |
| 233 is_server, QuicSupportedVersions()), | 234 is_server, QuicSupportedVersions()), |
| 234 writer_(QuicConnectionPeer::GetWriter(this)), | |
| 235 helper_(helper()) { | 235 helper_(helper()) { |
| 236 } | 236 } |
| 237 | 237 |
| 238 MockConnection::MockConnection(IPEndPoint address, | 238 MockConnection::MockConnection(IPEndPoint address, |
| 239 bool is_server) | 239 bool is_server) |
| 240 : QuicConnection(kTestConnectionId, address, | 240 : QuicConnection(kTestConnectionId, address, |
| 241 new testing::NiceMock<MockHelper>(), | 241 new testing::NiceMock<MockHelper>(), |
| 242 new testing::NiceMock<MockPacketWriter>(), | 242 new testing::NiceMock<MockPacketWriter>(), |
| 243 true /* owns_writer */, |
| 243 is_server, QuicSupportedVersions()), | 244 is_server, QuicSupportedVersions()), |
| 244 writer_(QuicConnectionPeer::GetWriter(this)), | |
| 245 helper_(helper()) { | 245 helper_(helper()) { |
| 246 } | 246 } |
| 247 | 247 |
| 248 MockConnection::MockConnection(QuicConnectionId connection_id, | 248 MockConnection::MockConnection(QuicConnectionId connection_id, |
| 249 bool is_server) | 249 bool is_server) |
| 250 : QuicConnection(connection_id, | 250 : QuicConnection(connection_id, |
| 251 IPEndPoint(TestPeerIPAddress(), kTestPort), | 251 IPEndPoint(TestPeerIPAddress(), kTestPort), |
| 252 new testing::NiceMock<MockHelper>(), | 252 new testing::NiceMock<MockHelper>(), |
| 253 new testing::NiceMock<MockPacketWriter>(), | 253 new testing::NiceMock<MockPacketWriter>(), |
| 254 true /* owns_writer */, |
| 254 is_server, QuicSupportedVersions()), | 255 is_server, QuicSupportedVersions()), |
| 255 writer_(QuicConnectionPeer::GetWriter(this)), | |
| 256 helper_(helper()) { | 256 helper_(helper()) { |
| 257 } | 257 } |
| 258 | 258 |
| 259 MockConnection::MockConnection(bool is_server, | 259 MockConnection::MockConnection(bool is_server, |
| 260 const QuicVersionVector& supported_versions) | 260 const QuicVersionVector& supported_versions) |
| 261 : QuicConnection(kTestConnectionId, | 261 : QuicConnection(kTestConnectionId, |
| 262 IPEndPoint(TestPeerIPAddress(), kTestPort), | 262 IPEndPoint(TestPeerIPAddress(), kTestPort), |
| 263 new testing::NiceMock<MockHelper>(), | 263 new testing::NiceMock<MockHelper>(), |
| 264 new testing::NiceMock<MockPacketWriter>(), | 264 new testing::NiceMock<MockPacketWriter>(), |
| 265 true /* owns_writer */, |
| 265 is_server, supported_versions), | 266 is_server, supported_versions), |
| 266 writer_(QuicConnectionPeer::GetWriter(this)), | |
| 267 helper_(helper()) { | 267 helper_(helper()) { |
| 268 } | 268 } |
| 269 | 269 |
| 270 MockConnection::~MockConnection() { | 270 MockConnection::~MockConnection() { |
| 271 } | 271 } |
| 272 | 272 |
| 273 void MockConnection::AdvanceTime(QuicTime::Delta delta) { | 273 void MockConnection::AdvanceTime(QuicTime::Delta delta) { |
| 274 static_cast<MockHelper*>(helper())->AdvanceTime(delta); | 274 static_cast<MockHelper*>(helper())->AdvanceTime(delta); |
| 275 } | 275 } |
| 276 | 276 |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 } | 605 } |
| 606 | 606 |
| 607 QuicVersionVector SupportedVersions(QuicVersion version) { | 607 QuicVersionVector SupportedVersions(QuicVersion version) { |
| 608 QuicVersionVector versions; | 608 QuicVersionVector versions; |
| 609 versions.push_back(version); | 609 versions.push_back(version); |
| 610 return versions; | 610 return versions; |
| 611 } | 611 } |
| 612 | 612 |
| 613 } // namespace test | 613 } // namespace test |
| 614 } // namespace net | 614 } // namespace net |
| OLD | NEW |