| 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/core/quic_crypto_stream.h" | 5 #include "net/quic/core/quic_crypto_stream.h" |
| 6 | 6 |
| 7 #include <cstdint> | 7 #include <cstdint> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "net/quic/core/crypto/crypto_handshake.h" | 13 #include "net/quic/core/crypto/crypto_handshake.h" |
| 14 #include "net/quic/core/crypto/crypto_protocol.h" | 14 #include "net/quic/core/crypto/crypto_protocol.h" |
| 15 #include "net/quic/test_tools/crypto_test_utils.h" | 15 #include "net/quic/test_tools/crypto_test_utils.h" |
| 16 #include "net/quic/test_tools/quic_stream_peer.h" |
| 16 #include "net/quic/test_tools/quic_test_utils.h" | 17 #include "net/quic/test_tools/quic_test_utils.h" |
| 17 #include "net/quic/test_tools/reliable_quic_stream_peer.h" | |
| 18 #include "testing/gmock/include/gmock/gmock.h" | 18 #include "testing/gmock/include/gmock/gmock.h" |
| 19 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
| 20 | 20 |
| 21 using std::string; | 21 using std::string; |
| 22 | 22 |
| 23 namespace net { | 23 namespace net { |
| 24 namespace test { | 24 namespace test { |
| 25 namespace { | 25 namespace { |
| 26 | 26 |
| 27 class MockQuicCryptoStream : public QuicCryptoStream { | 27 class MockQuicCryptoStream : public QuicCryptoStream { |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 EXPECT_EQ(1, bad[kFirstTagIndex]); | 98 EXPECT_EQ(1, bad[kFirstTagIndex]); |
| 99 bad[kFirstTagIndex] = 0x7F; // out of order tag | 99 bad[kFirstTagIndex] = 0x7F; // out of order tag |
| 100 | 100 |
| 101 EXPECT_CALL(*connection_, CloseConnection(QUIC_CRYPTO_TAGS_OUT_OF_ORDER, | 101 EXPECT_CALL(*connection_, CloseConnection(QUIC_CRYPTO_TAGS_OUT_OF_ORDER, |
| 102 testing::_, testing::_)); | 102 testing::_, testing::_)); |
| 103 stream_.OnStreamFrame( | 103 stream_.OnStreamFrame( |
| 104 QuicStreamFrame(kCryptoStreamId, /*fin=*/false, /*offset=*/0, bad)); | 104 QuicStreamFrame(kCryptoStreamId, /*fin=*/false, /*offset=*/0, bad)); |
| 105 } | 105 } |
| 106 | 106 |
| 107 TEST_F(QuicCryptoStreamTest, NoConnectionLevelFlowControl) { | 107 TEST_F(QuicCryptoStreamTest, NoConnectionLevelFlowControl) { |
| 108 EXPECT_FALSE(ReliableQuicStreamPeer::StreamContributesToConnectionFlowControl( | 108 EXPECT_FALSE( |
| 109 &stream_)); | 109 QuicStreamPeer::StreamContributesToConnectionFlowControl(&stream_)); |
| 110 } | 110 } |
| 111 | 111 |
| 112 } // namespace | 112 } // namespace |
| 113 } // namespace test | 113 } // namespace test |
| 114 } // namespace net | 114 } // namespace net |
| OLD | NEW |