Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(236)

Side by Side Diff: net/quic/quic_flow_controller_test.cc

Issue 1979763002: Landing Recent QUIC changes until Sun May 8 00:39:29 2016 +0000 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/quic/quic_flags.cc ('k') | net/quic/quic_framer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « net/quic/quic_flags.cc ('k') | net/quic/quic_framer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698