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

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

Issue 340433002: Port QuicServer to Chrome network stack (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments and fix blocked writers using callbacks Created 6 years, 6 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 <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 &session_, &TestSession::SendStreamData, stream4->id())))); 393 &session_, &TestSession::SendStreamData, stream4->id()))));
394 EXPECT_CALL(*stream6, OnCanWrite()) 394 EXPECT_CALL(*stream6, OnCanWrite())
395 .WillOnce(IgnoreResult(Invoke(CreateFunctor( 395 .WillOnce(IgnoreResult(Invoke(CreateFunctor(
396 &session_, &TestSession::SendStreamData, stream6->id())))); 396 &session_, &TestSession::SendStreamData, stream6->id()))));
397 397
398 // Expect that we only send one packet, the writes from different streams 398 // Expect that we only send one packet, the writes from different streams
399 // should be bundled together. 399 // should be bundled together.
400 MockPacketWriter* writer = 400 MockPacketWriter* writer =
401 static_cast<MockPacketWriter*>( 401 static_cast<MockPacketWriter*>(
402 QuicConnectionPeer::GetWriter(session_.connection())); 402 QuicConnectionPeer::GetWriter(session_.connection()));
403 EXPECT_CALL(*writer, WritePacket(_, _, _, _)).WillOnce( 403 EXPECT_CALL(*writer, WritePacket(_, _, _, _, _)).WillOnce(
404 Return(WriteResult(WRITE_STATUS_OK, 0))); 404 Return(WriteResult(WRITE_STATUS_OK, 0)));
405 EXPECT_CALL(*send_algorithm, OnPacketSent(_, _, _, _, _)).Times(1); 405 EXPECT_CALL(*send_algorithm, OnPacketSent(_, _, _, _, _)).Times(1);
406 session_.OnCanWrite(); 406 session_.OnCanWrite();
407 EXPECT_FALSE(session_.WillingAndAbleToWrite()); 407 EXPECT_FALSE(session_.WillingAndAbleToWrite());
408 } 408 }
409 409
410 TEST_P(QuicSessionTest, OnCanWriteCongestionControlBlocks) { 410 TEST_P(QuicSessionTest, OnCanWriteCongestionControlBlocks) {
411 InSequence s; 411 InSequence s;
412 412
413 // Drive congestion control manually. 413 // Drive congestion control manually.
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
881 881
882 // Version 16 means all flow control is disabled. 882 // Version 16 means all flow control is disabled.
883 session_.OnSuccessfulVersionNegotiation(QUIC_VERSION_16); 883 session_.OnSuccessfulVersionNegotiation(QUIC_VERSION_16);
884 EXPECT_FALSE(session_.flow_controller()->IsEnabled()); 884 EXPECT_FALSE(session_.flow_controller()->IsEnabled());
885 EXPECT_FALSE(stream->flow_controller()->IsEnabled()); 885 EXPECT_FALSE(stream->flow_controller()->IsEnabled());
886 } 886 }
887 887
888 } // namespace 888 } // namespace
889 } // namespace test 889 } // namespace test
890 } // namespace net 890 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698