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

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

Issue 2183493002: Add a merely pass-through QuicMultipathSentPacketManager. Protected behind blocked flag FLAGS_quic_… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
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 #include <utility> 8 #include <utility>
9 9
10 #include "base/rand_util.h" 10 #include "base/rand_util.h"
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 session_.OnCanWrite(); 489 session_.OnCanWrite();
490 } 490 }
491 491
492 TEST_P(QuicSessionTestServer, OnCanWriteBundlesStreams) { 492 TEST_P(QuicSessionTestServer, OnCanWriteBundlesStreams) {
493 // Encryption needs to be established before data can be sent. 493 // Encryption needs to be established before data can be sent.
494 CryptoHandshakeMessage msg; 494 CryptoHandshakeMessage msg;
495 session_.GetCryptoStream()->OnHandshakeMessage(msg); 495 session_.GetCryptoStream()->OnHandshakeMessage(msg);
496 496
497 // Drive congestion control manually. 497 // Drive congestion control manually.
498 MockSendAlgorithm* send_algorithm = new StrictMock<MockSendAlgorithm>; 498 MockSendAlgorithm* send_algorithm = new StrictMock<MockSendAlgorithm>;
499 QuicConnectionPeer::SetSendAlgorithm(session_.connection(), send_algorithm); 499 QuicConnectionPeer::SetSendAlgorithm(session_.connection(), kDefaultPathId,
500 send_algorithm);
500 501
501 TestStream* stream2 = session_.CreateOutgoingDynamicStream(kDefaultPriority); 502 TestStream* stream2 = session_.CreateOutgoingDynamicStream(kDefaultPriority);
502 TestStream* stream4 = session_.CreateOutgoingDynamicStream(kDefaultPriority); 503 TestStream* stream4 = session_.CreateOutgoingDynamicStream(kDefaultPriority);
503 TestStream* stream6 = session_.CreateOutgoingDynamicStream(kDefaultPriority); 504 TestStream* stream6 = session_.CreateOutgoingDynamicStream(kDefaultPriority);
504 505
505 session_.MarkConnectionLevelWriteBlocked(stream2->id()); 506 session_.MarkConnectionLevelWriteBlocked(stream2->id());
506 session_.MarkConnectionLevelWriteBlocked(stream6->id()); 507 session_.MarkConnectionLevelWriteBlocked(stream6->id());
507 session_.MarkConnectionLevelWriteBlocked(stream4->id()); 508 session_.MarkConnectionLevelWriteBlocked(stream4->id());
508 509
509 EXPECT_CALL(*send_algorithm, TimeUntilSend(_, _)) 510 EXPECT_CALL(*send_algorithm, TimeUntilSend(_, _))
(...skipping 22 matching lines...) Expand all
532 EXPECT_CALL(*send_algorithm, OnPacketSent(_, _, _, _, _)); 533 EXPECT_CALL(*send_algorithm, OnPacketSent(_, _, _, _, _));
533 session_.OnCanWrite(); 534 session_.OnCanWrite();
534 EXPECT_FALSE(session_.WillingAndAbleToWrite()); 535 EXPECT_FALSE(session_.WillingAndAbleToWrite());
535 } 536 }
536 537
537 TEST_P(QuicSessionTestServer, OnCanWriteCongestionControlBlocks) { 538 TEST_P(QuicSessionTestServer, OnCanWriteCongestionControlBlocks) {
538 InSequence s; 539 InSequence s;
539 540
540 // Drive congestion control manually. 541 // Drive congestion control manually.
541 MockSendAlgorithm* send_algorithm = new StrictMock<MockSendAlgorithm>; 542 MockSendAlgorithm* send_algorithm = new StrictMock<MockSendAlgorithm>;
542 QuicConnectionPeer::SetSendAlgorithm(session_.connection(), send_algorithm); 543 QuicConnectionPeer::SetSendAlgorithm(session_.connection(), kDefaultPathId,
544 send_algorithm);
543 545
544 TestStream* stream2 = session_.CreateOutgoingDynamicStream(kDefaultPriority); 546 TestStream* stream2 = session_.CreateOutgoingDynamicStream(kDefaultPriority);
545 TestStream* stream4 = session_.CreateOutgoingDynamicStream(kDefaultPriority); 547 TestStream* stream4 = session_.CreateOutgoingDynamicStream(kDefaultPriority);
546 TestStream* stream6 = session_.CreateOutgoingDynamicStream(kDefaultPriority); 548 TestStream* stream6 = session_.CreateOutgoingDynamicStream(kDefaultPriority);
547 549
548 session_.MarkConnectionLevelWriteBlocked(stream2->id()); 550 session_.MarkConnectionLevelWriteBlocked(stream2->id());
549 session_.MarkConnectionLevelWriteBlocked(stream6->id()); 551 session_.MarkConnectionLevelWriteBlocked(stream6->id());
550 session_.MarkConnectionLevelWriteBlocked(stream4->id()); 552 session_.MarkConnectionLevelWriteBlocked(stream4->id());
551 553
552 StreamBlocker stream2_blocker(&session_, stream2->id()); 554 StreamBlocker stream2_blocker(&session_, stream2->id());
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after
1214 if (version() <= QUIC_VERSION_35) { 1216 if (version() <= QUIC_VERSION_35) {
1215 EXPECT_FALSE(session_.force_hol_blocking()); 1217 EXPECT_FALSE(session_.force_hol_blocking());
1216 } else { 1218 } else {
1217 EXPECT_TRUE(session_.force_hol_blocking()); 1219 EXPECT_TRUE(session_.force_hol_blocking());
1218 } 1220 }
1219 } 1221 }
1220 1222
1221 } // namespace 1223 } // namespace
1222 } // namespace test 1224 } // namespace test
1223 } // namespace net 1225 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698