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/tools/quic/quic_dispatcher.h" | 5 #include "net/tools/quic/quic_dispatcher.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/strings/string_piece.h" | 9 #include "base/strings/string_piece.h" |
10 #include "net/quic/crypto/crypto_handshake.h" | 10 #include "net/quic/crypto/crypto_handshake.h" |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 class QuicDispatcherTest : public ::testing::Test { | 118 class QuicDispatcherTest : public ::testing::Test { |
119 public: | 119 public: |
120 QuicDispatcherTest() | 120 QuicDispatcherTest() |
121 : helper_(&eps_), | 121 : helper_(&eps_), |
122 crypto_config_(QuicCryptoServerConfig::TESTING, | 122 crypto_config_(QuicCryptoServerConfig::TESTING, |
123 QuicRandom::GetInstance()), | 123 QuicRandom::GetInstance()), |
124 dispatcher_(config_, crypto_config_, &eps_), | 124 dispatcher_(config_, crypto_config_, &eps_), |
125 time_wait_list_manager_(nullptr), | 125 time_wait_list_manager_(nullptr), |
126 session1_(nullptr), | 126 session1_(nullptr), |
127 session2_(nullptr) { | 127 session2_(nullptr) { |
128 dispatcher_.Initialize(1); | 128 dispatcher_.InitializeWithWriter(new QuicDefaultPacketWriter(1)); |
129 } | 129 } |
130 | 130 |
131 ~QuicDispatcherTest() override {} | 131 ~QuicDispatcherTest() override {} |
132 | 132 |
133 MockConnection* connection1() { | 133 MockConnection* connection1() { |
134 return reinterpret_cast<MockConnection*>(session1_->connection()); | 134 return reinterpret_cast<MockConnection*>(session1_->connection()); |
135 } | 135 } |
136 | 136 |
137 MockConnection* connection2() { | 137 MockConnection* connection2() { |
138 return reinterpret_cast<MockConnection*>(session2_->connection()); | 138 return reinterpret_cast<MockConnection*>(session2_->connection()); |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 // And we'll resume where we left off when we get another call. | 489 // And we'll resume where we left off when we get another call. |
490 EXPECT_CALL(*connection2(), OnCanWrite()); | 490 EXPECT_CALL(*connection2(), OnCanWrite()); |
491 dispatcher_.OnCanWrite(); | 491 dispatcher_.OnCanWrite(); |
492 EXPECT_FALSE(dispatcher_.HasPendingWrites()); | 492 EXPECT_FALSE(dispatcher_.HasPendingWrites()); |
493 } | 493 } |
494 | 494 |
495 } // namespace | 495 } // namespace |
496 } // namespace test | 496 } // namespace test |
497 } // namespace tools | 497 } // namespace tools |
498 } // namespace net | 498 } // namespace net |
OLD | NEW |