| 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 "base/format_macros.h" | 7 #include "base/format_macros.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "net/quic/quic_flags.h" | 9 #include "net/quic/quic_flags.h" |
| 10 #include "net/quic/quic_utils.h" | 10 #include "net/quic/quic_utils.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 flow_controller_.reset( | 33 flow_controller_.reset( |
| 34 new QuicFlowController(&connection_, stream_id_, Perspective::IS_CLIENT, | 34 new QuicFlowController(&connection_, stream_id_, Perspective::IS_CLIENT, |
| 35 send_window_, receive_window_, false)); | 35 send_window_, receive_window_, false)); |
| 36 } | 36 } |
| 37 | 37 |
| 38 protected: | 38 protected: |
| 39 QuicStreamId stream_id_; | 39 QuicStreamId stream_id_; |
| 40 QuicByteCount send_window_; | 40 QuicByteCount send_window_; |
| 41 QuicByteCount receive_window_; | 41 QuicByteCount receive_window_; |
| 42 scoped_ptr<QuicFlowController> flow_controller_; | 42 scoped_ptr<QuicFlowController> flow_controller_; |
| 43 MockHelper helper_; | 43 MockConnectionHelper helper_; |
| 44 MockConnection connection_; | 44 MockConnection connection_; |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 TEST_F(QuicFlowControllerTest, SendingBytes) { | 47 TEST_F(QuicFlowControllerTest, SendingBytes) { |
| 48 Initialize(); | 48 Initialize(); |
| 49 | 49 |
| 50 EXPECT_FALSE(flow_controller_->IsBlocked()); | 50 EXPECT_FALSE(flow_controller_->IsBlocked()); |
| 51 EXPECT_FALSE(flow_controller_->FlowControlViolation()); | 51 EXPECT_FALSE(flow_controller_->FlowControlViolation()); |
| 52 EXPECT_EQ(send_window_, flow_controller_->SendWindowSize()); | 52 EXPECT_EQ(send_window_, flow_controller_->SendWindowSize()); |
| 53 | 53 |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 EXPECT_FALSE(flow_controller_->FlowControlViolation()); | 366 EXPECT_FALSE(flow_controller_->FlowControlViolation()); |
| 367 | 367 |
| 368 QuicByteCount new_threshold = | 368 QuicByteCount new_threshold = |
| 369 QuicFlowControllerPeer::WindowUpdateThreshold(flow_controller_.get()); | 369 QuicFlowControllerPeer::WindowUpdateThreshold(flow_controller_.get()); |
| 370 | 370 |
| 371 EXPECT_EQ(new_threshold, threshold); | 371 EXPECT_EQ(new_threshold, threshold); |
| 372 } | 372 } |
| 373 | 373 |
| 374 } // namespace test | 374 } // namespace test |
| 375 } // namespace net | 375 } // namespace net |
| OLD | NEW |