| 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_session.h" | 5 #include "net/quic/core/quic_session.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 914 EXPECT_FALSE(headers_stream->flow_controller()->IsBlocked()); | 914 EXPECT_FALSE(headers_stream->flow_controller()->IsBlocked()); |
| 915 EXPECT_FALSE(session_.IsConnectionFlowControlBlocked()); | 915 EXPECT_FALSE(session_.IsConnectionFlowControlBlocked()); |
| 916 EXPECT_FALSE(session_.IsStreamFlowControlBlocked()); | 916 EXPECT_FALSE(session_.IsStreamFlowControlBlocked()); |
| 917 QuicStreamId stream_id = 5; | 917 QuicStreamId stream_id = 5; |
| 918 // Write until the header stream is flow control blocked. | 918 // Write until the header stream is flow control blocked. |
| 919 EXPECT_CALL(*connection_, SendBlocked(kHeadersStreamId)); | 919 EXPECT_CALL(*connection_, SendBlocked(kHeadersStreamId)); |
| 920 SpdyHeaderBlock headers; | 920 SpdyHeaderBlock headers; |
| 921 while (!headers_stream->flow_controller()->IsBlocked() && stream_id < 2000) { | 921 while (!headers_stream->flow_controller()->IsBlocked() && stream_id < 2000) { |
| 922 EXPECT_FALSE(session_.IsConnectionFlowControlBlocked()); | 922 EXPECT_FALSE(session_.IsConnectionFlowControlBlocked()); |
| 923 EXPECT_FALSE(session_.IsStreamFlowControlBlocked()); | 923 EXPECT_FALSE(session_.IsStreamFlowControlBlocked()); |
| 924 headers["header"] = base::Uint64ToString(base::RandUint64()) + | 924 headers["header"] = QuicStrCat("", base::RandUint64(), base::RandUint64(), |
| 925 base::Uint64ToString(base::RandUint64()) + | 925 base::RandUint64()); |
| 926 base::Uint64ToString(base::RandUint64()); | |
| 927 headers_stream->WriteHeaders(stream_id, headers.Clone(), true, 0, nullptr); | 926 headers_stream->WriteHeaders(stream_id, headers.Clone(), true, 0, nullptr); |
| 928 stream_id += 2; | 927 stream_id += 2; |
| 929 } | 928 } |
| 930 // Write once more to ensure that the headers stream has buffered data. The | 929 // Write once more to ensure that the headers stream has buffered data. The |
| 931 // random headers may have exactly filled the flow control window. | 930 // random headers may have exactly filled the flow control window. |
| 932 headers_stream->WriteHeaders(stream_id, std::move(headers), true, 0, nullptr); | 931 headers_stream->WriteHeaders(stream_id, std::move(headers), true, 0, nullptr); |
| 933 EXPECT_TRUE(headers_stream->HasBufferedData()); | 932 EXPECT_TRUE(headers_stream->HasBufferedData()); |
| 934 | 933 |
| 935 EXPECT_TRUE(headers_stream->flow_controller()->IsBlocked()); | 934 EXPECT_TRUE(headers_stream->flow_controller()->IsBlocked()); |
| 936 EXPECT_FALSE(crypto_stream->flow_controller()->IsBlocked()); | 935 EXPECT_FALSE(crypto_stream->flow_controller()->IsBlocked()); |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1315 if (version() <= QUIC_VERSION_35) { | 1314 if (version() <= QUIC_VERSION_35) { |
| 1316 EXPECT_FALSE(session_.force_hol_blocking()); | 1315 EXPECT_FALSE(session_.force_hol_blocking()); |
| 1317 } else { | 1316 } else { |
| 1318 EXPECT_TRUE(session_.force_hol_blocking()); | 1317 EXPECT_TRUE(session_.force_hol_blocking()); |
| 1319 } | 1318 } |
| 1320 } | 1319 } |
| 1321 | 1320 |
| 1322 } // namespace | 1321 } // namespace |
| 1323 } // namespace test | 1322 } // namespace test |
| 1324 } // namespace net | 1323 } // namespace net |
| OLD | NEW |