| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 } | 68 } |
| 69 private: | 69 private: |
| 70 QuicDispatcher* dispatcher_; | 70 QuicDispatcher* dispatcher_; |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 QuicSession* CreateSession(QuicDispatcher* dispatcher, | 73 QuicSession* CreateSession(QuicDispatcher* dispatcher, |
| 74 QuicGuid guid, | 74 QuicGuid guid, |
| 75 const IPEndPoint& addr, | 75 const IPEndPoint& addr, |
| 76 MockSession** session) { | 76 MockSession** session) { |
| 77 MockServerConnection* connection = new MockServerConnection(guid, dispatcher); | 77 MockServerConnection* connection = new MockServerConnection(guid, dispatcher); |
| 78 *session = new MockSession(connection, true); | 78 *session = new MockSession(connection); |
| 79 ON_CALL(*connection, SendConnectionClose(_)).WillByDefault( | 79 ON_CALL(*connection, SendConnectionClose(_)).WillByDefault( |
| 80 WithoutArgs(Invoke( | 80 WithoutArgs(Invoke( |
| 81 connection, &MockServerConnection::UnregisterOnConnectionClosed))); | 81 connection, &MockServerConnection::UnregisterOnConnectionClosed))); |
| 82 EXPECT_CALL(*reinterpret_cast<MockConnection*>((*session)->connection()), | 82 EXPECT_CALL(*reinterpret_cast<MockConnection*>((*session)->connection()), |
| 83 ProcessUdpPacket(_, addr, _)); | 83 ProcessUdpPacket(_, addr, _)); |
| 84 | 84 |
| 85 return *session; | 85 return *session; |
| 86 } | 86 } |
| 87 | 87 |
| 88 class QuicDispatcherTest : public ::testing::Test { | 88 class QuicDispatcherTest : public ::testing::Test { |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 | 379 |
| 380 // And we'll resume where we left off when we get another call. | 380 // And we'll resume where we left off when we get another call. |
| 381 EXPECT_CALL(*connection2(), OnCanWrite()); | 381 EXPECT_CALL(*connection2(), OnCanWrite()); |
| 382 dispatcher_.OnCanWrite(); | 382 dispatcher_.OnCanWrite(); |
| 383 } | 383 } |
| 384 | 384 |
| 385 } // namespace | 385 } // namespace |
| 386 } // namespace test | 386 } // namespace test |
| 387 } // namespace tools | 387 } // namespace tools |
| 388 } // namespace net | 388 } // namespace net |
| OLD | NEW |