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

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

Issue 1983183002: Landing Recent QUIC changes until 5/14/2016 02:25:25 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: "first try to fix link error for win_clang build" 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 162
163 Initialize(); 163 Initialize();
164 flow_controller_->set_auto_tune_receive_window(true); 164 flow_controller_->set_auto_tune_receive_window(true);
165 165
166 // Make sure clock is inititialized. 166 // Make sure clock is inititialized.
167 connection_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1)); 167 connection_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1));
168 168
169 QuicSentPacketManager* manager = 169 QuicSentPacketManager* manager =
170 QuicConnectionPeer::GetSentPacketManager(&connection_); 170 QuicConnectionPeer::GetSentPacketManager(&connection_);
171 171
172 RttStats* rtt_stats = QuicSentPacketManagerPeer::GetRttStats(manager); 172 RttStats* rtt_stats = const_cast<RttStats*>(manager->GetRttStats());
173 rtt_stats->UpdateRtt(QuicTime::Delta::FromMilliseconds(kRtt), 173 rtt_stats->UpdateRtt(QuicTime::Delta::FromMilliseconds(kRtt),
174 QuicTime::Delta::Zero(), QuicTime::Zero()); 174 QuicTime::Delta::Zero(), QuicTime::Zero());
175 175
176 EXPECT_FALSE(flow_controller_->IsBlocked()); 176 EXPECT_FALSE(flow_controller_->IsBlocked());
177 EXPECT_FALSE(flow_controller_->FlowControlViolation()); 177 EXPECT_FALSE(flow_controller_->FlowControlViolation());
178 EXPECT_EQ(kInitialSessionFlowControlWindowForTest, 178 EXPECT_EQ(kInitialSessionFlowControlWindowForTest,
179 QuicFlowControllerPeer::ReceiveWindowSize(flow_controller_.get())); 179 QuicFlowControllerPeer::ReceiveWindowSize(flow_controller_.get()));
180 180
181 QuicByteCount threshold = 181 QuicByteCount threshold =
182 QuicFlowControllerPeer::WindowUpdateThreshold(flow_controller_.get()); 182 QuicFlowControllerPeer::WindowUpdateThreshold(flow_controller_.get());
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 216
217 Initialize(); 217 Initialize();
218 flow_controller_->set_auto_tune_receive_window(true); 218 flow_controller_->set_auto_tune_receive_window(true);
219 219
220 // Make sure clock is inititialized. 220 // Make sure clock is inititialized.
221 connection_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1)); 221 connection_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1));
222 222
223 QuicSentPacketManager* manager = 223 QuicSentPacketManager* manager =
224 QuicConnectionPeer::GetSentPacketManager(&connection_); 224 QuicConnectionPeer::GetSentPacketManager(&connection_);
225 225
226 RttStats* rtt_stats = QuicSentPacketManagerPeer::GetRttStats(manager); 226 RttStats* rtt_stats = const_cast<RttStats*>(manager->GetRttStats());
227 rtt_stats->UpdateRtt(QuicTime::Delta::FromMilliseconds(kRtt), 227 rtt_stats->UpdateRtt(QuicTime::Delta::FromMilliseconds(kRtt),
228 QuicTime::Delta::Zero(), QuicTime::Zero()); 228 QuicTime::Delta::Zero(), QuicTime::Zero());
229 229
230 EXPECT_FALSE(flow_controller_->IsBlocked()); 230 EXPECT_FALSE(flow_controller_->IsBlocked());
231 EXPECT_FALSE(flow_controller_->FlowControlViolation()); 231 EXPECT_FALSE(flow_controller_->FlowControlViolation());
232 EXPECT_EQ(kInitialSessionFlowControlWindowForTest, 232 EXPECT_EQ(kInitialSessionFlowControlWindowForTest,
233 QuicFlowControllerPeer::ReceiveWindowSize(flow_controller_.get())); 233 QuicFlowControllerPeer::ReceiveWindowSize(flow_controller_.get()));
234 234
235 QuicByteCount threshold = 235 QuicByteCount threshold =
236 QuicFlowControllerPeer::WindowUpdateThreshold(flow_controller_.get()); 236 QuicFlowControllerPeer::WindowUpdateThreshold(flow_controller_.get());
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 EXPECT_CALL(connection_, SendWindowUpdate(stream_id_, ::testing::_)).Times(2); 269 EXPECT_CALL(connection_, SendWindowUpdate(stream_id_, ::testing::_)).Times(2);
270 270
271 Initialize(); 271 Initialize();
272 flow_controller_->set_auto_tune_receive_window(true); 272 flow_controller_->set_auto_tune_receive_window(true);
273 273
274 // Make sure clock is inititialized. 274 // Make sure clock is inititialized.
275 connection_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1)); 275 connection_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1));
276 276
277 QuicSentPacketManager* manager = 277 QuicSentPacketManager* manager =
278 QuicConnectionPeer::GetSentPacketManager(&connection_); 278 QuicConnectionPeer::GetSentPacketManager(&connection_);
279 RttStats* rtt_stats = QuicSentPacketManagerPeer::GetRttStats(manager); 279 RttStats* rtt_stats = const_cast<RttStats*>(manager->GetRttStats());
280 rtt_stats->UpdateRtt(QuicTime::Delta::FromMilliseconds(kRtt), 280 rtt_stats->UpdateRtt(QuicTime::Delta::FromMilliseconds(kRtt),
281 QuicTime::Delta::Zero(), QuicTime::Zero()); 281 QuicTime::Delta::Zero(), QuicTime::Zero());
282 282
283 EXPECT_FALSE(flow_controller_->IsBlocked()); 283 EXPECT_FALSE(flow_controller_->IsBlocked());
284 EXPECT_FALSE(flow_controller_->FlowControlViolation()); 284 EXPECT_FALSE(flow_controller_->FlowControlViolation());
285 EXPECT_EQ(kInitialSessionFlowControlWindowForTest, 285 EXPECT_EQ(kInitialSessionFlowControlWindowForTest,
286 QuicFlowControllerPeer::ReceiveWindowSize(flow_controller_.get())); 286 QuicFlowControllerPeer::ReceiveWindowSize(flow_controller_.get()));
287 287
288 QuicByteCount threshold = 288 QuicByteCount threshold =
289 QuicFlowControllerPeer::WindowUpdateThreshold(flow_controller_.get()); 289 QuicFlowControllerPeer::WindowUpdateThreshold(flow_controller_.get());
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 EXPECT_CALL(connection_, SendWindowUpdate(stream_id_, ::testing::_)).Times(2); 325 EXPECT_CALL(connection_, SendWindowUpdate(stream_id_, ::testing::_)).Times(2);
326 326
327 Initialize(); 327 Initialize();
328 flow_controller_->set_auto_tune_receive_window(true); 328 flow_controller_->set_auto_tune_receive_window(true);
329 329
330 // Make sure clock is inititialized. 330 // Make sure clock is inititialized.
331 connection_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1)); 331 connection_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1));
332 332
333 QuicSentPacketManager* manager = 333 QuicSentPacketManager* manager =
334 QuicConnectionPeer::GetSentPacketManager(&connection_); 334 QuicConnectionPeer::GetSentPacketManager(&connection_);
335 RttStats* rtt_stats = QuicSentPacketManagerPeer::GetRttStats(manager); 335 RttStats* rtt_stats = const_cast<RttStats*>(manager->GetRttStats());
336 rtt_stats->UpdateRtt(QuicTime::Delta::FromMilliseconds(kRtt), 336 rtt_stats->UpdateRtt(QuicTime::Delta::FromMilliseconds(kRtt),
337 QuicTime::Delta::Zero(), QuicTime::Zero()); 337 QuicTime::Delta::Zero(), QuicTime::Zero());
338 338
339 EXPECT_FALSE(flow_controller_->IsBlocked()); 339 EXPECT_FALSE(flow_controller_->IsBlocked());
340 EXPECT_FALSE(flow_controller_->FlowControlViolation()); 340 EXPECT_FALSE(flow_controller_->FlowControlViolation());
341 EXPECT_EQ(kInitialSessionFlowControlWindowForTest, 341 EXPECT_EQ(kInitialSessionFlowControlWindowForTest,
342 QuicFlowControllerPeer::ReceiveWindowSize(flow_controller_.get())); 342 QuicFlowControllerPeer::ReceiveWindowSize(flow_controller_.get()));
343 343
344 QuicByteCount threshold = 344 QuicByteCount threshold =
345 QuicFlowControllerPeer::WindowUpdateThreshold(flow_controller_.get()); 345 QuicFlowControllerPeer::WindowUpdateThreshold(flow_controller_.get());
(...skipping 24 matching lines...) Expand all
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