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/quic_crypto_server_stream.h" | 5 #include "net/quic/quic_crypto_server_stream.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 ReliableQuicStream*(QuicStreamId id)); | 60 ReliableQuicStream*(QuicStreamId id)); |
61 MOCK_METHOD0(GetCryptoStream, QuicCryptoStream*()); | 61 MOCK_METHOD0(GetCryptoStream, QuicCryptoStream*()); |
62 MOCK_METHOD0(CreateOutgoingReliableStream, ReliableQuicStream*()); | 62 MOCK_METHOD0(CreateOutgoingReliableStream, ReliableQuicStream*()); |
63 }; | 63 }; |
64 | 64 |
65 class QuicCryptoServerStreamTest : public ::testing::Test { | 65 class QuicCryptoServerStreamTest : public ::testing::Test { |
66 public: | 66 public: |
67 QuicCryptoServerStreamTest() | 67 QuicCryptoServerStreamTest() |
68 : guid_(1), | 68 : guid_(1), |
69 addr_(), | 69 addr_(), |
70 connection_(new PacketSavingConnection(guid_, addr_)), | 70 connection_(new PacketSavingConnection(guid_, addr_, true)), |
71 session_(connection_, true), | 71 session_(connection_, true), |
72 stream_(&session_) { | 72 stream_(&session_) { |
73 } | 73 } |
74 | 74 |
75 void ConstructHandshakeMessage() { | 75 void ConstructHandshakeMessage() { |
76 CryptoFramer framer; | 76 CryptoFramer framer; |
77 message_data_.reset(framer.ConstructHandshakeMessage(message_)); | 77 message_data_.reset(framer.ConstructHandshakeMessage(message_)); |
78 } | 78 } |
79 | 79 |
80 void CompleteCryptoHandshake() { | 80 void CompleteCryptoHandshake() { |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 message_.tag = kSHLO; | 113 message_.tag = kSHLO; |
114 ConstructHandshakeMessage(); | 114 ConstructHandshakeMessage(); |
115 EXPECT_CALL(*connection_, SendConnectionClose( | 115 EXPECT_CALL(*connection_, SendConnectionClose( |
116 QUIC_INVALID_CRYPTO_MESSAGE_TYPE)); | 116 QUIC_INVALID_CRYPTO_MESSAGE_TYPE)); |
117 stream_.ProcessData(message_data_->data(), message_data_->length()); | 117 stream_.ProcessData(message_data_->data(), message_data_->length()); |
118 } | 118 } |
119 | 119 |
120 } // namespace | 120 } // namespace |
121 } // namespace test | 121 } // namespace test |
122 } // namespace net | 122 } // namespace net |
OLD | NEW |