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 <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 sizeof(uint16); // padding | 96 sizeof(uint16); // padding |
97 EXPECT_EQ(1, bad[kFirstTagIndex]); | 97 EXPECT_EQ(1, bad[kFirstTagIndex]); |
98 bad[kFirstTagIndex] = 0x7F; // out of order tag | 98 bad[kFirstTagIndex] = 0x7F; // out of order tag |
99 | 99 |
100 EXPECT_CALL(*connection_, | 100 EXPECT_CALL(*connection_, |
101 SendConnectionClose(QUIC_CRYPTO_TAGS_OUT_OF_ORDER)); | 101 SendConnectionClose(QUIC_CRYPTO_TAGS_OUT_OF_ORDER)); |
102 EXPECT_EQ(0u, stream_.ProcessRawData(bad.data(), bad.length())); | 102 EXPECT_EQ(0u, stream_.ProcessRawData(bad.data(), bad.length())); |
103 } | 103 } |
104 | 104 |
105 TEST_F(QuicCryptoStreamTest, NoConnectionLevelFlowControl) { | 105 TEST_F(QuicCryptoStreamTest, NoConnectionLevelFlowControl) { |
106 if (connection_->version() <= QUIC_VERSION_20) { | 106 if (connection_->version() < QUIC_VERSION_21) { |
107 EXPECT_FALSE(stream_.flow_controller()->IsEnabled()); | 107 EXPECT_FALSE(stream_.flow_controller()->IsEnabled()); |
108 } else { | 108 } else { |
109 EXPECT_TRUE(stream_.flow_controller()->IsEnabled()); | 109 EXPECT_TRUE(stream_.flow_controller()->IsEnabled()); |
110 } | 110 } |
111 EXPECT_FALSE(ReliableQuicStreamPeer::StreamContributesToConnectionFlowControl( | 111 EXPECT_FALSE(ReliableQuicStreamPeer::StreamContributesToConnectionFlowControl( |
112 &stream_)); | 112 &stream_)); |
113 } | 113 } |
114 | 114 |
115 } // namespace | 115 } // namespace |
116 } // namespace test | 116 } // namespace test |
117 } // namespace net | 117 } // namespace net |
OLD | NEW |