| OLD | NEW |
| 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/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 | 369 |
| 370 session_.MarkWriteBlocked(stream2->id(), kSomeMiddlePriority); | 370 session_.MarkWriteBlocked(stream2->id(), kSomeMiddlePriority); |
| 371 session_.MarkWriteBlocked(stream6->id(), kSomeMiddlePriority); | 371 session_.MarkWriteBlocked(stream6->id(), kSomeMiddlePriority); |
| 372 session_.MarkWriteBlocked(stream4->id(), kSomeMiddlePriority); | 372 session_.MarkWriteBlocked(stream4->id(), kSomeMiddlePriority); |
| 373 | 373 |
| 374 EXPECT_CALL(*send_algorithm, TimeUntilSend(_, _, _)).WillRepeatedly( | 374 EXPECT_CALL(*send_algorithm, TimeUntilSend(_, _, _)).WillRepeatedly( |
| 375 Return(QuicTime::Delta::Zero())); | 375 Return(QuicTime::Delta::Zero())); |
| 376 EXPECT_CALL(*send_algorithm, GetCongestionWindow()) | 376 EXPECT_CALL(*send_algorithm, GetCongestionWindow()) |
| 377 .WillRepeatedly(Return(kMaxPacketSize * 10)); | 377 .WillRepeatedly(Return(kMaxPacketSize * 10)); |
| 378 EXPECT_CALL(*stream2, OnCanWrite()) | 378 EXPECT_CALL(*stream2, OnCanWrite()) |
| 379 .WillOnce(IgnoreResult(Invoke(CreateFunctor( | 379 .WillOnce(testing::IgnoreResult(Invoke(CreateFunctor( |
| 380 &session_, &TestSession::SendStreamData, stream2->id())))); | 380 &session_, &TestSession::SendStreamData, stream2->id())))); |
| 381 EXPECT_CALL(*stream4, OnCanWrite()) | 381 EXPECT_CALL(*stream4, OnCanWrite()) |
| 382 .WillOnce(IgnoreResult(Invoke(CreateFunctor( | 382 .WillOnce(testing::IgnoreResult(Invoke(CreateFunctor( |
| 383 &session_, &TestSession::SendStreamData, stream4->id())))); | 383 &session_, &TestSession::SendStreamData, stream4->id())))); |
| 384 EXPECT_CALL(*stream6, OnCanWrite()) | 384 EXPECT_CALL(*stream6, OnCanWrite()) |
| 385 .WillOnce(IgnoreResult(Invoke(CreateFunctor( | 385 .WillOnce(testing::IgnoreResult(Invoke(CreateFunctor( |
| 386 &session_, &TestSession::SendStreamData, stream6->id())))); | 386 &session_, &TestSession::SendStreamData, stream6->id())))); |
| 387 | 387 |
| 388 // Expect that we only send one packet, the writes from different streams | 388 // Expect that we only send one packet, the writes from different streams |
| 389 // should be bundled together. | 389 // should be bundled together. |
| 390 MockPacketWriter* writer = | 390 MockPacketWriter* writer = |
| 391 static_cast<MockPacketWriter*>( | 391 static_cast<MockPacketWriter*>( |
| 392 QuicConnectionPeer::GetWriter(session_.connection())); | 392 QuicConnectionPeer::GetWriter(session_.connection())); |
| 393 EXPECT_CALL(*writer, WritePacket(_, _, _, _)).WillOnce( | 393 EXPECT_CALL(*writer, WritePacket(_, _, _, _)).WillOnce( |
| 394 Return(WriteResult(WRITE_STATUS_OK, 0))); | 394 Return(WriteResult(WRITE_STATUS_OK, 0))); |
| 395 EXPECT_CALL(*send_algorithm, OnPacketSent(_, _, _, _, _)).Times(1); | 395 EXPECT_CALL(*send_algorithm, OnPacketSent(_, _, _, _, _)).Times(1); |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 956 } | 956 } |
| 957 | 957 |
| 958 // Called after any new data is received by the session, and triggers the call | 958 // Called after any new data is received by the session, and triggers the call |
| 959 // to close the connection. | 959 // to close the connection. |
| 960 session_.PostProcessAfterData(); | 960 session_.PostProcessAfterData(); |
| 961 } | 961 } |
| 962 | 962 |
| 963 } // namespace | 963 } // namespace |
| 964 } // namespace test | 964 } // namespace test |
| 965 } // namespace net | 965 } // namespace net |
| OLD | NEW |