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 12 matching lines...) Expand all Loading... |
23 #include "net/tools/quic/quic_per_connection_packet_writer.h" | 23 #include "net/tools/quic/quic_per_connection_packet_writer.h" |
24 | 24 |
25 using base::StringPiece; | 25 using base::StringPiece; |
26 using std::max; | 26 using std::max; |
27 using std::min; | 27 using std::min; |
28 using std::string; | 28 using std::string; |
29 using testing::Invoke; | 29 using testing::Invoke; |
30 using testing::_; | 30 using testing::_; |
31 | 31 |
32 namespace net { | 32 namespace net { |
| 33 |
| 34 class SocketPerformanceWatcher; |
| 35 |
33 namespace test { | 36 namespace test { |
34 namespace { | 37 namespace { |
35 | 38 |
36 // No-op alarm implementation used by MockHelper. | 39 // No-op alarm implementation used by MockHelper. |
37 class TestAlarm : public QuicAlarm { | 40 class TestAlarm : public QuicAlarm { |
38 public: | 41 public: |
39 explicit TestAlarm(QuicAlarm::Delegate* delegate) | 42 explicit TestAlarm(QuicAlarm::Delegate* delegate) |
40 : QuicAlarm(delegate) { | 43 : QuicAlarm(delegate) { |
41 } | 44 } |
42 | 45 |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 Perspective perspective, | 290 Perspective perspective, |
288 bool is_secure, | 291 bool is_secure, |
289 const QuicVersionVector& supported_versions) | 292 const QuicVersionVector& supported_versions) |
290 : QuicConnection(connection_id, | 293 : QuicConnection(connection_id, |
291 address, | 294 address, |
292 new testing::NiceMock<MockHelper>(), | 295 new testing::NiceMock<MockHelper>(), |
293 NiceMockPacketWriterFactory(), | 296 NiceMockPacketWriterFactory(), |
294 /* owns_writer= */ true, | 297 /* owns_writer= */ true, |
295 perspective, | 298 perspective, |
296 is_secure, | 299 is_secure, |
297 supported_versions), | 300 supported_versions, |
| 301 scoped_ptr<SocketPerformanceWatcher>()), |
298 helper_(helper()) { | 302 helper_(helper()) { |
299 ON_CALL(*this, OnError(_)) | 303 ON_CALL(*this, OnError(_)) |
300 .WillByDefault( | 304 .WillByDefault( |
301 Invoke(this, &PacketSavingConnection::QuicConnection_OnError)); | 305 Invoke(this, &PacketSavingConnection::QuicConnection_OnError)); |
302 } | 306 } |
303 | 307 |
304 MockConnection::~MockConnection() { | 308 MockConnection::~MockConnection() { |
305 } | 309 } |
306 | 310 |
307 void MockConnection::AdvanceTime(QuicTime::Delta delta) { | 311 void MockConnection::AdvanceTime(QuicTime::Delta delta) { |
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
824 *server_session = new TestQuicSpdyServerSession( | 828 *server_session = new TestQuicSpdyServerSession( |
825 *server_connection, DefaultQuicConfig(), server_crypto_config); | 829 *server_connection, DefaultQuicConfig(), server_crypto_config); |
826 | 830 |
827 // We advance the clock initially because the default time is zero and the | 831 // We advance the clock initially because the default time is zero and the |
828 // strike register worries that we've just overflowed a uint32 time. | 832 // strike register worries that we've just overflowed a uint32 time. |
829 (*server_connection)->AdvanceTime(connection_start_time); | 833 (*server_connection)->AdvanceTime(connection_start_time); |
830 } | 834 } |
831 | 835 |
832 } // namespace test | 836 } // namespace test |
833 } // namespace net | 837 } // namespace net |
OLD | NEW |