| 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_session.h" | 5 #include "net/quic/quic_session.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/containers/hash_tables.h" | 11 #include "base/containers/hash_tables.h" |
| 12 #include "base/rand_util.h" | 12 #include "base/rand_util.h" |
| 13 #include "base/stl_util.h" |
| 13 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
| 14 #include "net/quic/crypto/crypto_protocol.h" | 15 #include "net/quic/crypto/crypto_protocol.h" |
| 15 #include "net/quic/quic_crypto_stream.h" | 16 #include "net/quic/quic_crypto_stream.h" |
| 16 #include "net/quic/quic_flags.h" | 17 #include "net/quic/quic_flags.h" |
| 17 #include "net/quic/quic_protocol.h" | 18 #include "net/quic/quic_protocol.h" |
| 18 #include "net/quic/quic_utils.h" | 19 #include "net/quic/quic_utils.h" |
| 19 #include "net/quic/reliable_quic_stream.h" | 20 #include "net/quic/reliable_quic_stream.h" |
| 20 #include "net/quic/test_tools/quic_config_peer.h" | 21 #include "net/quic/test_tools/quic_config_peer.h" |
| 21 #include "net/quic/test_tools/quic_connection_peer.h" | 22 #include "net/quic/test_tools/quic_connection_peer.h" |
| 22 #include "net/quic/test_tools/quic_data_stream_peer.h" | 23 #include "net/quic/test_tools/quic_data_stream_peer.h" |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 "Rgj3RWUoPumQVCxtSOBdX0GlJOEcDTNCzQIm9BSfetog_eP_TfYubKudt5eMsXmN6" | 221 "Rgj3RWUoPumQVCxtSOBdX0GlJOEcDTNCzQIm9BSfetog_eP_TfYubKudt5eMsXmN6" |
| 221 "QnyXHeGeK2UINUzJ-D30AFcpqYgH9_1BvYSpi7fc7_ydBU8TaD8ZRxvtnzXqj0RfG" | 222 "QnyXHeGeK2UINUzJ-D30AFcpqYgH9_1BvYSpi7fc7_ydBU8TaD8ZRxvtnzXqj0RfG" |
| 222 "tuHghmv3aD-uzSYJ75XDdzKdizZ86IG6Fbn1XFhYZM-fbHhm3mVEXnyRW4ZuNOLFk" | 223 "tuHghmv3aD-uzSYJ75XDdzKdizZ86IG6Fbn1XFhYZM-fbHhm3mVEXnyRW4ZuNOLFk" |
| 223 "Fas6LMcVC6Q8QLlHYbXBpdNFuGbuZGUnav5C-2I_-46lL0NGg3GewxGKGHvHEfoyn" | 224 "Fas6LMcVC6Q8QLlHYbXBpdNFuGbuZGUnav5C-2I_-46lL0NGg3GewxGKGHvHEfoyn" |
| 224 "EFFlEYHsBQ98rXImL8ySDycdLEFvBPdtctPmWCfTxwmoSMLHU2SCVDhbqMWU5b0yr" | 225 "EFFlEYHsBQ98rXImL8ySDycdLEFvBPdtctPmWCfTxwmoSMLHU2SCVDhbqMWU5b0yr" |
| 225 "JBCScs_ejbKaqBDoB7ZGxTvqlrB__2ZmnHHjCr8RgMRtKNtIeuZAo "; | 226 "JBCScs_ejbKaqBDoB7ZGxTvqlrB__2ZmnHHjCr8RgMRtKNtIeuZAo "; |
| 226 } | 227 } |
| 227 | 228 |
| 228 void CheckClosedStreams() { | 229 void CheckClosedStreams() { |
| 229 for (int i = kCryptoStreamId; i < 100; i++) { | 230 for (int i = kCryptoStreamId; i < 100; i++) { |
| 230 if (closed_streams_.count(i) == 0) { | 231 if (!ContainsKey(closed_streams_, i)) { |
| 231 EXPECT_FALSE(session_.IsClosedStream(i)) << " stream id: " << i; | 232 EXPECT_FALSE(session_.IsClosedStream(i)) << " stream id: " << i; |
| 232 } else { | 233 } else { |
| 233 EXPECT_TRUE(session_.IsClosedStream(i)) << " stream id: " << i; | 234 EXPECT_TRUE(session_.IsClosedStream(i)) << " stream id: " << i; |
| 234 } | 235 } |
| 235 } | 236 } |
| 236 } | 237 } |
| 237 | 238 |
| 238 void CloseStream(QuicStreamId id) { | 239 void CloseStream(QuicStreamId id) { |
| 239 session_.CloseStream(id); | 240 session_.CloseStream(id); |
| 240 closed_streams_.insert(id); | 241 closed_streams_.insert(id); |
| (...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 851 frames.push_back(window_update_frame); | 852 frames.push_back(window_update_frame); |
| 852 session_.OnWindowUpdateFrames(frames); | 853 session_.OnWindowUpdateFrames(frames); |
| 853 EXPECT_FALSE(headers_stream->flow_controller()->IsBlocked()); | 854 EXPECT_FALSE(headers_stream->flow_controller()->IsBlocked()); |
| 854 EXPECT_FALSE(session_.IsConnectionFlowControlBlocked()); | 855 EXPECT_FALSE(session_.IsConnectionFlowControlBlocked()); |
| 855 EXPECT_FALSE(session_.IsStreamFlowControlBlocked()); | 856 EXPECT_FALSE(session_.IsStreamFlowControlBlocked()); |
| 856 } | 857 } |
| 857 | 858 |
| 858 } // namespace | 859 } // namespace |
| 859 } // namespace test | 860 } // namespace test |
| 860 } // namespace net | 861 } // namespace net |
| OLD | NEW |