| 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 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1089 // from the peer results in the connection being torn down. | 1089 // from the peer results in the connection being torn down. |
| 1090 const uint32_t kInvalidWindow = kMinimumFlowControlSendWindow - 1; | 1090 const uint32_t kInvalidWindow = kMinimumFlowControlSendWindow - 1; |
| 1091 QuicConfigPeer::SetReceivedInitialSessionFlowControlWindow(session_.config(), | 1091 QuicConfigPeer::SetReceivedInitialSessionFlowControlWindow(session_.config(), |
| 1092 kInvalidWindow); | 1092 kInvalidWindow); |
| 1093 | 1093 |
| 1094 EXPECT_CALL(*connection_, | 1094 EXPECT_CALL(*connection_, |
| 1095 CloseConnection(QUIC_FLOW_CONTROL_INVALID_WINDOW, _, _)); | 1095 CloseConnection(QUIC_FLOW_CONTROL_INVALID_WINDOW, _, _)); |
| 1096 session_.OnConfigNegotiated(); | 1096 session_.OnConfigNegotiated(); |
| 1097 } | 1097 } |
| 1098 | 1098 |
| 1099 // Test negotiation of custom server initial flow control window. |
| 1100 TEST_P(QuicSessionTestServer, CustomFlowControlWindow) { |
| 1101 FLAGS_quic_large_ifw_options = true; |
| 1102 QuicTagVector copt; |
| 1103 copt.push_back(kIFW7); |
| 1104 QuicConfigPeer::SetReceivedConnectionOptions(session_.config(), copt); |
| 1105 |
| 1106 session_.OnConfigNegotiated(); |
| 1107 EXPECT_EQ(192 * 1024u, QuicFlowControllerPeer::ReceiveWindowSize( |
| 1108 session_.flow_controller())); |
| 1109 } |
| 1110 |
| 1099 TEST_P(QuicSessionTestServer, FlowControlWithInvalidFinalOffset) { | 1111 TEST_P(QuicSessionTestServer, FlowControlWithInvalidFinalOffset) { |
| 1100 // Test that if we receive a stream RST with a highest byte offset that | 1112 // Test that if we receive a stream RST with a highest byte offset that |
| 1101 // violates flow control, that we close the connection. | 1113 // violates flow control, that we close the connection. |
| 1102 const uint64_t kLargeOffset = kInitialSessionFlowControlWindowForTest + 1; | 1114 const uint64_t kLargeOffset = kInitialSessionFlowControlWindowForTest + 1; |
| 1103 EXPECT_CALL(*connection_, | 1115 EXPECT_CALL(*connection_, |
| 1104 CloseConnection(QUIC_FLOW_CONTROL_RECEIVED_TOO_MUCH_DATA, _, _)) | 1116 CloseConnection(QUIC_FLOW_CONTROL_RECEIVED_TOO_MUCH_DATA, _, _)) |
| 1105 .Times(2); | 1117 .Times(2); |
| 1106 | 1118 |
| 1107 // Check that stream frame + FIN results in connection close. | 1119 // Check that stream frame + FIN results in connection close. |
| 1108 TestStream* stream = session_.CreateOutgoingDynamicStream(kDefaultPriority); | 1120 TestStream* stream = session_.CreateOutgoingDynamicStream(kDefaultPriority); |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1301 if (version() <= QUIC_VERSION_35) { | 1313 if (version() <= QUIC_VERSION_35) { |
| 1302 EXPECT_FALSE(session_.force_hol_blocking()); | 1314 EXPECT_FALSE(session_.force_hol_blocking()); |
| 1303 } else { | 1315 } else { |
| 1304 EXPECT_TRUE(session_.force_hol_blocking()); | 1316 EXPECT_TRUE(session_.force_hol_blocking()); |
| 1305 } | 1317 } |
| 1306 } | 1318 } |
| 1307 | 1319 |
| 1308 } // namespace | 1320 } // namespace |
| 1309 } // namespace test | 1321 } // namespace test |
| 1310 } // namespace net | 1322 } // namespace net |
| OLD | NEW |