| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_flow_controller.h" | 5 #include "net/quic/quic_flow_controller.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 flow_controller_.reset( | 37 flow_controller_.reset( |
| 38 new QuicFlowController(&connection_, stream_id_, Perspective::IS_CLIENT, | 38 new QuicFlowController(&connection_, stream_id_, Perspective::IS_CLIENT, |
| 39 send_window_, receive_window_, false)); | 39 send_window_, receive_window_, false)); |
| 40 } | 40 } |
| 41 | 41 |
| 42 protected: | 42 protected: |
| 43 QuicStreamId stream_id_; | 43 QuicStreamId stream_id_; |
| 44 QuicByteCount send_window_; | 44 QuicByteCount send_window_; |
| 45 QuicByteCount receive_window_; | 45 QuicByteCount receive_window_; |
| 46 std::unique_ptr<QuicFlowController> flow_controller_; | 46 std::unique_ptr<QuicFlowController> flow_controller_; |
| 47 MockConnectionHelper helper_; | 47 MockQuicConnectionHelper helper_; |
| 48 MockAlarmFactory alarm_factory_; | 48 MockAlarmFactory alarm_factory_; |
| 49 MockConnection connection_; | 49 MockQuicConnection connection_; |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 TEST_F(QuicFlowControllerTest, SendingBytes) { | 52 TEST_F(QuicFlowControllerTest, SendingBytes) { |
| 53 Initialize(); | 53 Initialize(); |
| 54 | 54 |
| 55 EXPECT_FALSE(flow_controller_->IsBlocked()); | 55 EXPECT_FALSE(flow_controller_->IsBlocked()); |
| 56 EXPECT_FALSE(flow_controller_->FlowControlViolation()); | 56 EXPECT_FALSE(flow_controller_->FlowControlViolation()); |
| 57 EXPECT_EQ(send_window_, flow_controller_->SendWindowSize()); | 57 EXPECT_EQ(send_window_, flow_controller_->SendWindowSize()); |
| 58 | 58 |
| 59 // Send some bytes, but not enough to block. | 59 // Send some bytes, but not enough to block. |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 EXPECT_FALSE(flow_controller_->FlowControlViolation()); | 370 EXPECT_FALSE(flow_controller_->FlowControlViolation()); |
| 371 | 371 |
| 372 QuicByteCount new_threshold = | 372 QuicByteCount new_threshold = |
| 373 QuicFlowControllerPeer::WindowUpdateThreshold(flow_controller_.get()); | 373 QuicFlowControllerPeer::WindowUpdateThreshold(flow_controller_.get()); |
| 374 | 374 |
| 375 EXPECT_EQ(new_threshold, threshold); | 375 EXPECT_EQ(new_threshold, threshold); |
| 376 } | 376 } |
| 377 | 377 |
| 378 } // namespace test | 378 } // namespace test |
| 379 } // namespace net | 379 } // namespace net |
| OLD | NEW |