| 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" |
| 11 #include "net/quic/crypto/crypto_server_config.h" | 11 #include "net/quic/crypto/crypto_server_config.h" |
| 12 #include "net/quic/crypto/quic_random.h" |
| 12 #include "net/quic/quic_crypto_stream.h" | 13 #include "net/quic/quic_crypto_stream.h" |
| 13 #include "net/quic/test_tools/quic_test_utils.h" | 14 #include "net/quic/test_tools/quic_test_utils.h" |
| 14 #include "net/tools/flip_server/epoll_server.h" | 15 #include "net/tools/flip_server/epoll_server.h" |
| 15 #include "net/tools/quic/quic_time_wait_list_manager.h" | 16 #include "net/tools/quic/quic_time_wait_list_manager.h" |
| 16 #include "net/tools/quic/test_tools/quic_test_utils.h" | 17 #include "net/tools/quic/test_tools/quic_test_utils.h" |
| 17 #include "testing/gmock/include/gmock/gmock.h" | 18 #include "testing/gmock/include/gmock/gmock.h" |
| 18 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
| 19 | 20 |
| 20 using base::StringPiece; | 21 using base::StringPiece; |
| 21 using net::EpollServer; | 22 using net::EpollServer; |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 connection, &MockServerConnection::UnregisterOnConnectionClose))); | 97 connection, &MockServerConnection::UnregisterOnConnectionClose))); |
| 97 EXPECT_CALL(*reinterpret_cast<MockConnection*>((*session)->connection()), | 98 EXPECT_CALL(*reinterpret_cast<MockConnection*>((*session)->connection()), |
| 98 ProcessUdpPacket(_, addr, _)); | 99 ProcessUdpPacket(_, addr, _)); |
| 99 | 100 |
| 100 return *session; | 101 return *session; |
| 101 } | 102 } |
| 102 | 103 |
| 103 class QuicDispatcherTest : public ::testing::Test { | 104 class QuicDispatcherTest : public ::testing::Test { |
| 104 public: | 105 public: |
| 105 QuicDispatcherTest() | 106 QuicDispatcherTest() |
| 106 : crypto_config_(QuicCryptoServerConfig::TESTING), | 107 : crypto_config_(QuicCryptoServerConfig::TESTING, |
| 108 QuicRandom::GetInstance()), |
| 107 dispatcher_(config_, crypto_config_, &eps_), | 109 dispatcher_(config_, crypto_config_, &eps_), |
| 108 session1_(NULL), | 110 session1_(NULL), |
| 109 session2_(NULL) { | 111 session2_(NULL) { |
| 110 } | 112 } |
| 111 | 113 |
| 112 virtual ~QuicDispatcherTest() {} | 114 virtual ~QuicDispatcherTest() {} |
| 113 | 115 |
| 114 MockConnection* connection1() { | 116 MockConnection* connection1() { |
| 115 return reinterpret_cast<MockConnection*>(session1_->connection()); | 117 return reinterpret_cast<MockConnection*>(session1_->connection()); |
| 116 } | 118 } |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 // And we'll resume where we left off when we get another call. | 381 // And we'll resume where we left off when we get another call. |
| 380 EXPECT_CALL(*connection2(), OnCanWrite()); | 382 EXPECT_CALL(*connection2(), OnCanWrite()); |
| 381 dispatcher_.OnCanWrite(); | 383 dispatcher_.OnCanWrite(); |
| 382 } | 384 } |
| 383 | 385 |
| 384 | 386 |
| 385 } // namespace | 387 } // namespace |
| 386 } // namespace test | 388 } // namespace test |
| 387 } // namespace tools | 389 } // namespace tools |
| 388 } // namespace net | 390 } // namespace net |
| OLD | NEW |