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

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

Issue 1811043002: Landing Recent QUIC changes until 2016-03-15 16:26 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add an export clause. Created 4 years, 9 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_session.cc ('k') | net/quic/quic_stream_sequencer_test.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 (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/quic_session.h" 5 #include "net/quic/quic_session.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/containers/hash_tables.h" 9 #include "base/containers/hash_tables.h"
10 #include "base/rand_util.h" 10 #include "base/rand_util.h"
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 QuicConnectionPeer::SetSendAlgorithm(session_.connection(), send_algorithm); 494 QuicConnectionPeer::SetSendAlgorithm(session_.connection(), send_algorithm);
495 495
496 TestStream* stream2 = session_.CreateOutgoingDynamicStream(kDefaultPriority); 496 TestStream* stream2 = session_.CreateOutgoingDynamicStream(kDefaultPriority);
497 TestStream* stream4 = session_.CreateOutgoingDynamicStream(kDefaultPriority); 497 TestStream* stream4 = session_.CreateOutgoingDynamicStream(kDefaultPriority);
498 TestStream* stream6 = session_.CreateOutgoingDynamicStream(kDefaultPriority); 498 TestStream* stream6 = session_.CreateOutgoingDynamicStream(kDefaultPriority);
499 499
500 session_.MarkConnectionLevelWriteBlocked(stream2->id()); 500 session_.MarkConnectionLevelWriteBlocked(stream2->id());
501 session_.MarkConnectionLevelWriteBlocked(stream6->id()); 501 session_.MarkConnectionLevelWriteBlocked(stream6->id());
502 session_.MarkConnectionLevelWriteBlocked(stream4->id()); 502 session_.MarkConnectionLevelWriteBlocked(stream4->id());
503 503
504 EXPECT_CALL(*send_algorithm, TimeUntilSend(_, _, _)) 504 EXPECT_CALL(*send_algorithm, TimeUntilSend(_, _))
505 .WillRepeatedly(Return(QuicTime::Delta::Zero())); 505 .WillRepeatedly(Return(QuicTime::Delta::Zero()));
506 EXPECT_CALL(*send_algorithm, GetCongestionWindow()) 506 EXPECT_CALL(*send_algorithm, GetCongestionWindow())
507 .WillRepeatedly(Return(kMaxPacketSize * 10)); 507 .WillRepeatedly(Return(kMaxPacketSize * 10));
508 EXPECT_CALL(*stream2, OnCanWrite()) 508 EXPECT_CALL(*stream2, OnCanWrite())
509 .WillOnce(testing::IgnoreResult(Invoke(CreateFunctor( 509 .WillOnce(testing::IgnoreResult(Invoke(CreateFunctor(
510 &TestSession::SendStreamData, 510 &TestSession::SendStreamData,
511 base::Unretained(&session_), stream2->id())))); 511 base::Unretained(&session_), stream2->id()))));
512 EXPECT_CALL(*stream4, OnCanWrite()) 512 EXPECT_CALL(*stream4, OnCanWrite())
513 .WillOnce(testing::IgnoreResult(Invoke(CreateFunctor( 513 .WillOnce(testing::IgnoreResult(Invoke(CreateFunctor(
514 &TestSession::SendStreamData, 514 &TestSession::SendStreamData,
(...skipping 25 matching lines...) Expand all
540 540
541 TestStream* stream2 = session_.CreateOutgoingDynamicStream(kDefaultPriority); 541 TestStream* stream2 = session_.CreateOutgoingDynamicStream(kDefaultPriority);
542 TestStream* stream4 = session_.CreateOutgoingDynamicStream(kDefaultPriority); 542 TestStream* stream4 = session_.CreateOutgoingDynamicStream(kDefaultPriority);
543 TestStream* stream6 = session_.CreateOutgoingDynamicStream(kDefaultPriority); 543 TestStream* stream6 = session_.CreateOutgoingDynamicStream(kDefaultPriority);
544 544
545 session_.MarkConnectionLevelWriteBlocked(stream2->id()); 545 session_.MarkConnectionLevelWriteBlocked(stream2->id());
546 session_.MarkConnectionLevelWriteBlocked(stream6->id()); 546 session_.MarkConnectionLevelWriteBlocked(stream6->id());
547 session_.MarkConnectionLevelWriteBlocked(stream4->id()); 547 session_.MarkConnectionLevelWriteBlocked(stream4->id());
548 548
549 StreamBlocker stream2_blocker(&session_, stream2->id()); 549 StreamBlocker stream2_blocker(&session_, stream2->id());
550 EXPECT_CALL(*send_algorithm, TimeUntilSend(_, _, _)) 550 EXPECT_CALL(*send_algorithm, TimeUntilSend(_, _))
551 .WillOnce(Return(QuicTime::Delta::Zero())); 551 .WillOnce(Return(QuicTime::Delta::Zero()));
552 EXPECT_CALL(*stream2, OnCanWrite()); 552 EXPECT_CALL(*stream2, OnCanWrite());
553 EXPECT_CALL(*send_algorithm, TimeUntilSend(_, _, _)) 553 EXPECT_CALL(*send_algorithm, TimeUntilSend(_, _))
554 .WillOnce(Return(QuicTime::Delta::Zero())); 554 .WillOnce(Return(QuicTime::Delta::Zero()));
555 EXPECT_CALL(*stream6, OnCanWrite()); 555 EXPECT_CALL(*stream6, OnCanWrite());
556 EXPECT_CALL(*send_algorithm, TimeUntilSend(_, _, _)) 556 EXPECT_CALL(*send_algorithm, TimeUntilSend(_, _))
557 .WillOnce(Return(QuicTime::Delta::Infinite())); 557 .WillOnce(Return(QuicTime::Delta::Infinite()));
558 // stream4->OnCanWrite is not called. 558 // stream4->OnCanWrite is not called.
559 559
560 session_.OnCanWrite(); 560 session_.OnCanWrite();
561 EXPECT_TRUE(session_.WillingAndAbleToWrite()); 561 EXPECT_TRUE(session_.WillingAndAbleToWrite());
562 562
563 // Still congestion-control blocked. 563 // Still congestion-control blocked.
564 EXPECT_CALL(*send_algorithm, TimeUntilSend(_, _, _)) 564 EXPECT_CALL(*send_algorithm, TimeUntilSend(_, _))
565 .WillOnce(Return(QuicTime::Delta::Infinite())); 565 .WillOnce(Return(QuicTime::Delta::Infinite()));
566 session_.OnCanWrite(); 566 session_.OnCanWrite();
567 EXPECT_TRUE(session_.WillingAndAbleToWrite()); 567 EXPECT_TRUE(session_.WillingAndAbleToWrite());
568 568
569 // stream4->OnCanWrite is called once the connection stops being 569 // stream4->OnCanWrite is called once the connection stops being
570 // congestion-control blocked. 570 // congestion-control blocked.
571 EXPECT_CALL(*send_algorithm, TimeUntilSend(_, _, _)) 571 EXPECT_CALL(*send_algorithm, TimeUntilSend(_, _))
572 .WillOnce(Return(QuicTime::Delta::Zero())); 572 .WillOnce(Return(QuicTime::Delta::Zero()));
573 EXPECT_CALL(*stream4, OnCanWrite()); 573 EXPECT_CALL(*stream4, OnCanWrite());
574 session_.OnCanWrite(); 574 session_.OnCanWrite();
575 EXPECT_FALSE(session_.WillingAndAbleToWrite()); 575 EXPECT_FALSE(session_.WillingAndAbleToWrite());
576 } 576 }
577 577
578 TEST_P(QuicSessionTestServer, BufferedHandshake) { 578 TEST_P(QuicSessionTestServer, BufferedHandshake) {
579 EXPECT_FALSE(session_.HasPendingHandshake()); // Default value. 579 EXPECT_FALSE(session_.HasPendingHandshake()); // Default value.
580 580
581 // Test that blocking other streams does not change our status. 581 // Test that blocking other streams does not change our status.
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after
1196 session_.max_open_incoming_streams()); 1196 session_.max_open_incoming_streams());
1197 } 1197 }
1198 1198
1199 EXPECT_EQ(session_.max_open_outgoing_streams(), 1199 EXPECT_EQ(session_.max_open_outgoing_streams(),
1200 kDefaultMaxStreamsPerConnection); 1200 kDefaultMaxStreamsPerConnection);
1201 } 1201 }
1202 1202
1203 } // namespace 1203 } // namespace
1204 } // namespace test 1204 } // namespace test
1205 } // namespace net 1205 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_session.cc ('k') | net/quic/quic_stream_sequencer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698