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_client_stream.h" | 5 #include "net/quic/quic_crypto_client_stream.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "net/quic/crypto/quic_decrypter.h" | 8 #include "net/quic/crypto/quic_decrypter.h" |
9 #include "net/quic/crypto/quic_encrypter.h" | 9 #include "net/quic/crypto/quic_encrypter.h" |
10 #include "net/quic/test_tools/crypto_test_utils.h" | 10 #include "net/quic/test_tools/crypto_test_utils.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 virtual QuicConsumedData WriteData(QuicStreamId id, base::StringPiece data, | 54 virtual QuicConsumedData WriteData(QuicStreamId id, base::StringPiece data, |
55 QuicStreamOffset offset, bool fin) { | 55 QuicStreamOffset offset, bool fin) { |
56 return QuicSession::WriteData(id, data, offset, fin); | 56 return QuicSession::WriteData(id, data, offset, fin); |
57 } | 57 } |
58 }; | 58 }; |
59 | 59 |
60 class QuicCryptoClientStreamTest : public ::testing::Test { | 60 class QuicCryptoClientStreamTest : public ::testing::Test { |
61 public: | 61 public: |
62 QuicCryptoClientStreamTest() | 62 QuicCryptoClientStreamTest() |
63 : addr_(), | 63 : addr_(), |
64 connection_(new PacketSavingConnection(1, addr_)), | 64 connection_(new PacketSavingConnection(1, addr_, true)), |
65 session_(connection_, true), | 65 session_(connection_, true), |
66 stream_(&session_, kServerHostname) { | 66 stream_(&session_, kServerHostname) { |
67 } | 67 } |
68 | 68 |
69 void CompleteCryptoHandshake() { | 69 void CompleteCryptoHandshake() { |
70 EXPECT_TRUE(stream_.CryptoConnect()); | 70 EXPECT_TRUE(stream_.CryptoConnect()); |
71 CryptoTestUtils::HandshakeWithFakeServer(connection_, &stream_); | 71 CryptoTestUtils::HandshakeWithFakeServer(connection_, &stream_); |
72 } | 72 } |
73 | 73 |
74 void ConstructHandshakeMessage() { | 74 void ConstructHandshakeMessage() { |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 stream_.ProcessData(message_data_->data(), message_data_->length()); | 172 stream_.ProcessData(message_data_->data(), message_data_->length()); |
173 } | 173 } |
174 | 174 |
175 TEST_F(QuicCryptoClientStreamTest, CryptoConnect) { | 175 TEST_F(QuicCryptoClientStreamTest, CryptoConnect) { |
176 EXPECT_TRUE(stream_.CryptoConnect()); | 176 EXPECT_TRUE(stream_.CryptoConnect()); |
177 } | 177 } |
178 | 178 |
179 } // namespace | 179 } // namespace |
180 } // namespace test | 180 } // namespace test |
181 } // namespace net | 181 } // namespace net |
OLD | NEW |