| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 | 95 |
| 96 return *session; | 96 return *session; |
| 97 } | 97 } |
| 98 | 98 |
| 99 class QuicDispatcherTest : public ::testing::Test { | 99 class QuicDispatcherTest : public ::testing::Test { |
| 100 public: | 100 public: |
| 101 QuicDispatcherTest() | 101 QuicDispatcherTest() |
| 102 : crypto_config_(QuicCryptoServerConfig::TESTING, | 102 : crypto_config_(QuicCryptoServerConfig::TESTING, |
| 103 QuicRandom::GetInstance()), | 103 QuicRandom::GetInstance()), |
| 104 dispatcher_(config_, crypto_config_, &eps_), | 104 dispatcher_(config_, crypto_config_, &eps_), |
| 105 session1_(NULL), | 105 session1_(nullptr), |
| 106 session2_(NULL) { | 106 session2_(nullptr) { |
| 107 dispatcher_.Initialize(1); | 107 dispatcher_.Initialize(1); |
| 108 } | 108 } |
| 109 | 109 |
| 110 virtual ~QuicDispatcherTest() {} | 110 virtual ~QuicDispatcherTest() {} |
| 111 | 111 |
| 112 MockConnection* connection1() { | 112 MockConnection* connection1() { |
| 113 return reinterpret_cast<MockConnection*>(session1_->connection()); | 113 return reinterpret_cast<MockConnection*>(session1_->connection()); |
| 114 } | 114 } |
| 115 | 115 |
| 116 MockConnection* connection2() { | 116 MockConnection* connection2() { |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 // And we'll resume where we left off when we get another call. | 452 // And we'll resume where we left off when we get another call. |
| 453 EXPECT_CALL(*connection2(), OnCanWrite()); | 453 EXPECT_CALL(*connection2(), OnCanWrite()); |
| 454 dispatcher_.OnCanWrite(); | 454 dispatcher_.OnCanWrite(); |
| 455 EXPECT_FALSE(dispatcher_.HasPendingWrites()); | 455 EXPECT_FALSE(dispatcher_.HasPendingWrites()); |
| 456 } | 456 } |
| 457 | 457 |
| 458 } // namespace | 458 } // namespace |
| 459 } // namespace test | 459 } // namespace test |
| 460 } // namespace tools | 460 } // namespace tools |
| 461 } // namespace net | 461 } // namespace net |
| OLD | NEW |