| 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_stream.h" | 5 #include "net/quic/quic_crypto_stream.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 private: | 38 private: |
| 39 vector<CryptoHandshakeMessage> messages_; | 39 vector<CryptoHandshakeMessage> messages_; |
| 40 | 40 |
| 41 DISALLOW_COPY_AND_ASSIGN(MockQuicCryptoStream); | 41 DISALLOW_COPY_AND_ASSIGN(MockQuicCryptoStream); |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 class QuicCryptoStreamTest : public ::testing::Test { | 44 class QuicCryptoStreamTest : public ::testing::Test { |
| 45 public: | 45 public: |
| 46 QuicCryptoStreamTest() | 46 QuicCryptoStreamTest() |
| 47 : connection_(new MockConnection(&helper_, Perspective::IS_CLIENT)), | 47 : connection_(new MockConnection(&helper_, |
| 48 &alarm_factory_, |
| 49 Perspective::IS_CLIENT)), |
| 48 session_(connection_), | 50 session_(connection_), |
| 49 stream_(&session_) { | 51 stream_(&session_) { |
| 50 message_.set_tag(kSHLO); | 52 message_.set_tag(kSHLO); |
| 51 message_.SetStringPiece(1, "abc"); | 53 message_.SetStringPiece(1, "abc"); |
| 52 message_.SetStringPiece(2, "def"); | 54 message_.SetStringPiece(2, "def"); |
| 53 ConstructHandshakeMessage(); | 55 ConstructHandshakeMessage(); |
| 54 } | 56 } |
| 55 | 57 |
| 56 void ConstructHandshakeMessage() { | 58 void ConstructHandshakeMessage() { |
| 57 CryptoFramer framer; | 59 CryptoFramer framer; |
| 58 message_data_.reset(framer.ConstructHandshakeMessage(message_)); | 60 message_data_.reset(framer.ConstructHandshakeMessage(message_)); |
| 59 } | 61 } |
| 60 | 62 |
| 61 protected: | 63 protected: |
| 62 MockConnectionHelper helper_; | 64 MockConnectionHelper helper_; |
| 65 MockAlarmFactory alarm_factory_; |
| 63 MockConnection* connection_; | 66 MockConnection* connection_; |
| 64 MockQuicSpdySession session_; | 67 MockQuicSpdySession session_; |
| 65 MockQuicCryptoStream stream_; | 68 MockQuicCryptoStream stream_; |
| 66 CryptoHandshakeMessage message_; | 69 CryptoHandshakeMessage message_; |
| 67 std::unique_ptr<QuicData> message_data_; | 70 std::unique_ptr<QuicData> message_data_; |
| 68 | 71 |
| 69 private: | 72 private: |
| 70 DISALLOW_COPY_AND_ASSIGN(QuicCryptoStreamTest); | 73 DISALLOW_COPY_AND_ASSIGN(QuicCryptoStreamTest); |
| 71 }; | 74 }; |
| 72 | 75 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 102 } | 105 } |
| 103 | 106 |
| 104 TEST_F(QuicCryptoStreamTest, NoConnectionLevelFlowControl) { | 107 TEST_F(QuicCryptoStreamTest, NoConnectionLevelFlowControl) { |
| 105 EXPECT_FALSE(ReliableQuicStreamPeer::StreamContributesToConnectionFlowControl( | 108 EXPECT_FALSE(ReliableQuicStreamPeer::StreamContributesToConnectionFlowControl( |
| 106 &stream_)); | 109 &stream_)); |
| 107 } | 110 } |
| 108 | 111 |
| 109 } // namespace | 112 } // namespace |
| 110 } // namespace test | 113 } // namespace test |
| 111 } // namespace net | 114 } // namespace net |
| OLD | NEW |