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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 }; | 102 }; |
103 | 103 |
104 // Poor man's functor for use as callback in a mock. | 104 // Poor man's functor for use as callback in a mock. |
105 class StreamBlocker { | 105 class StreamBlocker { |
106 public: | 106 public: |
107 StreamBlocker(QuicSession* session, QuicStreamId stream_id) | 107 StreamBlocker(QuicSession* session, QuicStreamId stream_id) |
108 : session_(session), | 108 : session_(session), |
109 stream_id_(stream_id) { | 109 stream_id_(stream_id) { |
110 } | 110 } |
111 | 111 |
112 void MarkWriteBlocked() { | 112 void MarkConnectionLevelWriteBlocked() { |
113 session_->MarkWriteBlocked(stream_id_, kSomeMiddlePriority); | 113 session_->MarkConnectionLevelWriteBlocked(stream_id_, kSomeMiddlePriority); |
114 } | 114 } |
115 | 115 |
116 private: | 116 private: |
117 QuicSession* const session_; | 117 QuicSession* const session_; |
118 const QuicStreamId stream_id_; | 118 const QuicStreamId stream_id_; |
119 }; | 119 }; |
120 | 120 |
121 class TestSession : public QuicSpdySession { | 121 class TestSession : public QuicSpdySession { |
122 public: | 122 public: |
123 explicit TestSession(QuicConnection* connection) | 123 explicit TestSession(QuicConnection* connection) |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 EXPECT_CALL(*connection_, SendConnectionClose(QUIC_INVALID_STREAM_ID)); | 320 EXPECT_CALL(*connection_, SendConnectionClose(QUIC_INVALID_STREAM_ID)); |
321 session_.GetIncomingDynamicStream(stream_id + kMaxStreamIdDelta + 2); | 321 session_.GetIncomingDynamicStream(stream_id + kMaxStreamIdDelta + 2); |
322 } | 322 } |
323 | 323 |
324 TEST_P(QuicSessionTestServer, DebugDFatalIfMarkingClosedStreamWriteBlocked) { | 324 TEST_P(QuicSessionTestServer, DebugDFatalIfMarkingClosedStreamWriteBlocked) { |
325 TestStream* stream2 = session_.CreateOutgoingDynamicStream(); | 325 TestStream* stream2 = session_.CreateOutgoingDynamicStream(); |
326 QuicStreamId kClosedStreamId = stream2->id(); | 326 QuicStreamId kClosedStreamId = stream2->id(); |
327 // Close the stream. | 327 // Close the stream. |
328 EXPECT_CALL(*connection_, SendRstStream(kClosedStreamId, _, _)); | 328 EXPECT_CALL(*connection_, SendRstStream(kClosedStreamId, _, _)); |
329 stream2->Reset(QUIC_BAD_APPLICATION_PAYLOAD); | 329 stream2->Reset(QUIC_BAD_APPLICATION_PAYLOAD); |
330 EXPECT_DEBUG_DFATAL( | 330 EXPECT_DEBUG_DFATAL(session_.MarkConnectionLevelWriteBlocked( |
331 session_.MarkWriteBlocked(kClosedStreamId, kSomeMiddlePriority), | 331 kClosedStreamId, kSomeMiddlePriority), |
332 "Marking unknown stream 2 blocked."); | 332 "Marking unknown stream 2 blocked."); |
333 } | 333 } |
334 | 334 |
335 TEST_P(QuicSessionTestServer, | 335 TEST_P(QuicSessionTestServer, |
336 DebugDFatalIfMarkWriteBlockedCalledWithWrongPriority) { | 336 DebugDFatalIfMarkWriteBlockedCalledWithWrongPriority) { |
337 const QuicPriority kDifferentPriority = 0; | 337 const QuicPriority kDifferentPriority = 0; |
338 | 338 |
339 TestStream* stream2 = session_.CreateOutgoingDynamicStream(); | 339 TestStream* stream2 = session_.CreateOutgoingDynamicStream(); |
340 EXPECT_NE(kDifferentPriority, stream2->EffectivePriority()); | 340 EXPECT_NE(kDifferentPriority, stream2->EffectivePriority()); |
341 EXPECT_DEBUG_DFATAL( | 341 EXPECT_DEBUG_DFATAL(session_.MarkConnectionLevelWriteBlocked( |
342 session_.MarkWriteBlocked(stream2->id(), kDifferentPriority), | 342 stream2->id(), kDifferentPriority), |
343 "Priorities do not match. Got: 0 Expected: 3"); | 343 "Priorities do not match. Got: 0 Expected: 3"); |
344 } | 344 } |
345 | 345 |
346 TEST_P(QuicSessionTestServer, OnCanWrite) { | 346 TEST_P(QuicSessionTestServer, OnCanWrite) { |
347 TestStream* stream2 = session_.CreateOutgoingDynamicStream(); | 347 TestStream* stream2 = session_.CreateOutgoingDynamicStream(); |
348 TestStream* stream4 = session_.CreateOutgoingDynamicStream(); | 348 TestStream* stream4 = session_.CreateOutgoingDynamicStream(); |
349 TestStream* stream6 = session_.CreateOutgoingDynamicStream(); | 349 TestStream* stream6 = session_.CreateOutgoingDynamicStream(); |
350 | 350 |
351 session_.MarkWriteBlocked(stream2->id(), kSomeMiddlePriority); | 351 session_.MarkConnectionLevelWriteBlocked(stream2->id(), kSomeMiddlePriority); |
352 session_.MarkWriteBlocked(stream6->id(), kSomeMiddlePriority); | 352 session_.MarkConnectionLevelWriteBlocked(stream6->id(), kSomeMiddlePriority); |
353 session_.MarkWriteBlocked(stream4->id(), kSomeMiddlePriority); | 353 session_.MarkConnectionLevelWriteBlocked(stream4->id(), kSomeMiddlePriority); |
354 | 354 |
355 InSequence s; | 355 InSequence s; |
356 StreamBlocker stream2_blocker(&session_, stream2->id()); | 356 StreamBlocker stream2_blocker(&session_, stream2->id()); |
357 // Reregister, to test the loop limit. | 357 // Reregister, to test the loop limit. |
358 EXPECT_CALL(*stream2, OnCanWrite()) | 358 EXPECT_CALL(*stream2, OnCanWrite()) |
359 .WillOnce(Invoke(&stream2_blocker, &StreamBlocker::MarkWriteBlocked)); | 359 .WillOnce(Invoke(&stream2_blocker, |
| 360 &StreamBlocker::MarkConnectionLevelWriteBlocked)); |
360 EXPECT_CALL(*stream6, OnCanWrite()); | 361 EXPECT_CALL(*stream6, OnCanWrite()); |
361 EXPECT_CALL(*stream4, OnCanWrite()); | 362 EXPECT_CALL(*stream4, OnCanWrite()); |
362 session_.OnCanWrite(); | 363 session_.OnCanWrite(); |
363 EXPECT_TRUE(session_.WillingAndAbleToWrite()); | 364 EXPECT_TRUE(session_.WillingAndAbleToWrite()); |
364 } | 365 } |
365 | 366 |
366 TEST_P(QuicSessionTestServer, OnCanWriteBundlesStreams) { | 367 TEST_P(QuicSessionTestServer, OnCanWriteBundlesStreams) { |
367 // Drive congestion control manually. | 368 // Drive congestion control manually. |
368 MockSendAlgorithm* send_algorithm = new StrictMock<MockSendAlgorithm>; | 369 MockSendAlgorithm* send_algorithm = new StrictMock<MockSendAlgorithm>; |
369 QuicConnectionPeer::SetSendAlgorithm(session_.connection(), send_algorithm); | 370 QuicConnectionPeer::SetSendAlgorithm(session_.connection(), send_algorithm); |
370 | 371 |
371 TestStream* stream2 = session_.CreateOutgoingDynamicStream(); | 372 TestStream* stream2 = session_.CreateOutgoingDynamicStream(); |
372 TestStream* stream4 = session_.CreateOutgoingDynamicStream(); | 373 TestStream* stream4 = session_.CreateOutgoingDynamicStream(); |
373 TestStream* stream6 = session_.CreateOutgoingDynamicStream(); | 374 TestStream* stream6 = session_.CreateOutgoingDynamicStream(); |
374 | 375 |
375 session_.MarkWriteBlocked(stream2->id(), kSomeMiddlePriority); | 376 session_.MarkConnectionLevelWriteBlocked(stream2->id(), kSomeMiddlePriority); |
376 session_.MarkWriteBlocked(stream6->id(), kSomeMiddlePriority); | 377 session_.MarkConnectionLevelWriteBlocked(stream6->id(), kSomeMiddlePriority); |
377 session_.MarkWriteBlocked(stream4->id(), kSomeMiddlePriority); | 378 session_.MarkConnectionLevelWriteBlocked(stream4->id(), kSomeMiddlePriority); |
378 | 379 |
379 EXPECT_CALL(*send_algorithm, TimeUntilSend(_, _, _)).WillRepeatedly( | 380 EXPECT_CALL(*send_algorithm, TimeUntilSend(_, _, _)).WillRepeatedly( |
380 Return(QuicTime::Delta::Zero())); | 381 Return(QuicTime::Delta::Zero())); |
381 EXPECT_CALL(*send_algorithm, GetCongestionWindow()) | 382 EXPECT_CALL(*send_algorithm, GetCongestionWindow()) |
382 .WillRepeatedly(Return(kMaxPacketSize * 10)); | 383 .WillRepeatedly(Return(kMaxPacketSize * 10)); |
383 EXPECT_CALL(*stream2, OnCanWrite()) | 384 EXPECT_CALL(*stream2, OnCanWrite()) |
384 .WillOnce(testing::IgnoreResult(Invoke(CreateFunctor( | 385 .WillOnce(testing::IgnoreResult(Invoke(CreateFunctor( |
385 &session_, &TestSession::SendStreamData, stream2->id())))); | 386 &session_, &TestSession::SendStreamData, stream2->id())))); |
386 EXPECT_CALL(*stream4, OnCanWrite()) | 387 EXPECT_CALL(*stream4, OnCanWrite()) |
387 .WillOnce(testing::IgnoreResult(Invoke(CreateFunctor( | 388 .WillOnce(testing::IgnoreResult(Invoke(CreateFunctor( |
(...skipping 18 matching lines...) Expand all Loading... |
406 InSequence s; | 407 InSequence s; |
407 | 408 |
408 // Drive congestion control manually. | 409 // Drive congestion control manually. |
409 MockSendAlgorithm* send_algorithm = new StrictMock<MockSendAlgorithm>; | 410 MockSendAlgorithm* send_algorithm = new StrictMock<MockSendAlgorithm>; |
410 QuicConnectionPeer::SetSendAlgorithm(session_.connection(), send_algorithm); | 411 QuicConnectionPeer::SetSendAlgorithm(session_.connection(), send_algorithm); |
411 | 412 |
412 TestStream* stream2 = session_.CreateOutgoingDynamicStream(); | 413 TestStream* stream2 = session_.CreateOutgoingDynamicStream(); |
413 TestStream* stream4 = session_.CreateOutgoingDynamicStream(); | 414 TestStream* stream4 = session_.CreateOutgoingDynamicStream(); |
414 TestStream* stream6 = session_.CreateOutgoingDynamicStream(); | 415 TestStream* stream6 = session_.CreateOutgoingDynamicStream(); |
415 | 416 |
416 session_.MarkWriteBlocked(stream2->id(), kSomeMiddlePriority); | 417 session_.MarkConnectionLevelWriteBlocked(stream2->id(), kSomeMiddlePriority); |
417 session_.MarkWriteBlocked(stream6->id(), kSomeMiddlePriority); | 418 session_.MarkConnectionLevelWriteBlocked(stream6->id(), kSomeMiddlePriority); |
418 session_.MarkWriteBlocked(stream4->id(), kSomeMiddlePriority); | 419 session_.MarkConnectionLevelWriteBlocked(stream4->id(), kSomeMiddlePriority); |
419 | 420 |
420 StreamBlocker stream2_blocker(&session_, stream2->id()); | 421 StreamBlocker stream2_blocker(&session_, stream2->id()); |
421 EXPECT_CALL(*send_algorithm, TimeUntilSend(_, _, _)).WillOnce(Return( | 422 EXPECT_CALL(*send_algorithm, TimeUntilSend(_, _, _)).WillOnce(Return( |
422 QuicTime::Delta::Zero())); | 423 QuicTime::Delta::Zero())); |
423 EXPECT_CALL(*stream2, OnCanWrite()); | 424 EXPECT_CALL(*stream2, OnCanWrite()); |
424 EXPECT_CALL(*send_algorithm, TimeUntilSend(_, _, _)).WillOnce(Return( | 425 EXPECT_CALL(*send_algorithm, TimeUntilSend(_, _, _)).WillOnce(Return( |
425 QuicTime::Delta::Zero())); | 426 QuicTime::Delta::Zero())); |
426 EXPECT_CALL(*stream6, OnCanWrite()); | 427 EXPECT_CALL(*stream6, OnCanWrite()); |
427 EXPECT_CALL(*send_algorithm, TimeUntilSend(_, _, _)).WillOnce(Return( | 428 EXPECT_CALL(*send_algorithm, TimeUntilSend(_, _, _)).WillOnce(Return( |
428 QuicTime::Delta::Infinite())); | 429 QuicTime::Delta::Infinite())); |
(...skipping 16 matching lines...) Expand all Loading... |
445 session_.OnCanWrite(); | 446 session_.OnCanWrite(); |
446 EXPECT_FALSE(session_.WillingAndAbleToWrite()); | 447 EXPECT_FALSE(session_.WillingAndAbleToWrite()); |
447 } | 448 } |
448 | 449 |
449 TEST_P(QuicSessionTestServer, BufferedHandshake) { | 450 TEST_P(QuicSessionTestServer, BufferedHandshake) { |
450 EXPECT_FALSE(session_.HasPendingHandshake()); // Default value. | 451 EXPECT_FALSE(session_.HasPendingHandshake()); // Default value. |
451 | 452 |
452 // Test that blocking other streams does not change our status. | 453 // Test that blocking other streams does not change our status. |
453 TestStream* stream2 = session_.CreateOutgoingDynamicStream(); | 454 TestStream* stream2 = session_.CreateOutgoingDynamicStream(); |
454 StreamBlocker stream2_blocker(&session_, stream2->id()); | 455 StreamBlocker stream2_blocker(&session_, stream2->id()); |
455 stream2_blocker.MarkWriteBlocked(); | 456 stream2_blocker.MarkConnectionLevelWriteBlocked(); |
456 EXPECT_FALSE(session_.HasPendingHandshake()); | 457 EXPECT_FALSE(session_.HasPendingHandshake()); |
457 | 458 |
458 TestStream* stream3 = session_.CreateOutgoingDynamicStream(); | 459 TestStream* stream3 = session_.CreateOutgoingDynamicStream(); |
459 StreamBlocker stream3_blocker(&session_, stream3->id()); | 460 StreamBlocker stream3_blocker(&session_, stream3->id()); |
460 stream3_blocker.MarkWriteBlocked(); | 461 stream3_blocker.MarkConnectionLevelWriteBlocked(); |
461 EXPECT_FALSE(session_.HasPendingHandshake()); | 462 EXPECT_FALSE(session_.HasPendingHandshake()); |
462 | 463 |
463 // Blocking (due to buffering of) the Crypto stream is detected. | 464 // Blocking (due to buffering of) the Crypto stream is detected. |
464 session_.MarkWriteBlocked(kCryptoStreamId, kHighestPriority); | 465 session_.MarkConnectionLevelWriteBlocked(kCryptoStreamId, kHighestPriority); |
465 EXPECT_TRUE(session_.HasPendingHandshake()); | 466 EXPECT_TRUE(session_.HasPendingHandshake()); |
466 | 467 |
467 TestStream* stream4 = session_.CreateOutgoingDynamicStream(); | 468 TestStream* stream4 = session_.CreateOutgoingDynamicStream(); |
468 StreamBlocker stream4_blocker(&session_, stream4->id()); | 469 StreamBlocker stream4_blocker(&session_, stream4->id()); |
469 stream4_blocker.MarkWriteBlocked(); | 470 stream4_blocker.MarkConnectionLevelWriteBlocked(); |
470 EXPECT_TRUE(session_.HasPendingHandshake()); | 471 EXPECT_TRUE(session_.HasPendingHandshake()); |
471 | 472 |
472 InSequence s; | 473 InSequence s; |
473 // Force most streams to re-register, which is common scenario when we block | 474 // Force most streams to re-register, which is common scenario when we block |
474 // the Crypto stream, and only the crypto stream can "really" write. | 475 // the Crypto stream, and only the crypto stream can "really" write. |
475 | 476 |
476 // Due to prioritization, we *should* be asked to write the crypto stream | 477 // Due to prioritization, we *should* be asked to write the crypto stream |
477 // first. | 478 // first. |
478 // Don't re-register the crypto stream (which signals complete writing). | 479 // Don't re-register the crypto stream (which signals complete writing). |
479 TestCryptoStream* crypto_stream = session_.GetCryptoStream(); | 480 TestCryptoStream* crypto_stream = session_.GetCryptoStream(); |
480 EXPECT_CALL(*crypto_stream, OnCanWrite()); | 481 EXPECT_CALL(*crypto_stream, OnCanWrite()); |
481 | 482 |
482 // Re-register all other streams, to show they weren't able to proceed. | 483 // Re-register all other streams, to show they weren't able to proceed. |
483 EXPECT_CALL(*stream2, OnCanWrite()) | 484 EXPECT_CALL(*stream2, OnCanWrite()) |
484 .WillOnce(Invoke(&stream2_blocker, &StreamBlocker::MarkWriteBlocked)); | 485 .WillOnce(Invoke(&stream2_blocker, |
| 486 &StreamBlocker::MarkConnectionLevelWriteBlocked)); |
485 EXPECT_CALL(*stream3, OnCanWrite()) | 487 EXPECT_CALL(*stream3, OnCanWrite()) |
486 .WillOnce(Invoke(&stream3_blocker, &StreamBlocker::MarkWriteBlocked)); | 488 .WillOnce(Invoke(&stream3_blocker, |
| 489 &StreamBlocker::MarkConnectionLevelWriteBlocked)); |
487 EXPECT_CALL(*stream4, OnCanWrite()) | 490 EXPECT_CALL(*stream4, OnCanWrite()) |
488 .WillOnce(Invoke(&stream4_blocker, &StreamBlocker::MarkWriteBlocked)); | 491 .WillOnce(Invoke(&stream4_blocker, |
| 492 &StreamBlocker::MarkConnectionLevelWriteBlocked)); |
489 | 493 |
490 session_.OnCanWrite(); | 494 session_.OnCanWrite(); |
491 EXPECT_TRUE(session_.WillingAndAbleToWrite()); | 495 EXPECT_TRUE(session_.WillingAndAbleToWrite()); |
492 EXPECT_FALSE(session_.HasPendingHandshake()); // Crypto stream wrote. | 496 EXPECT_FALSE(session_.HasPendingHandshake()); // Crypto stream wrote. |
493 } | 497 } |
494 | 498 |
495 TEST_P(QuicSessionTestServer, OnCanWriteWithClosedStream) { | 499 TEST_P(QuicSessionTestServer, OnCanWriteWithClosedStream) { |
496 TestStream* stream2 = session_.CreateOutgoingDynamicStream(); | 500 TestStream* stream2 = session_.CreateOutgoingDynamicStream(); |
497 TestStream* stream4 = session_.CreateOutgoingDynamicStream(); | 501 TestStream* stream4 = session_.CreateOutgoingDynamicStream(); |
498 TestStream* stream6 = session_.CreateOutgoingDynamicStream(); | 502 TestStream* stream6 = session_.CreateOutgoingDynamicStream(); |
499 | 503 |
500 session_.MarkWriteBlocked(stream2->id(), kSomeMiddlePriority); | 504 session_.MarkConnectionLevelWriteBlocked(stream2->id(), kSomeMiddlePriority); |
501 session_.MarkWriteBlocked(stream6->id(), kSomeMiddlePriority); | 505 session_.MarkConnectionLevelWriteBlocked(stream6->id(), kSomeMiddlePriority); |
502 session_.MarkWriteBlocked(stream4->id(), kSomeMiddlePriority); | 506 session_.MarkConnectionLevelWriteBlocked(stream4->id(), kSomeMiddlePriority); |
503 CloseStream(stream6->id()); | 507 CloseStream(stream6->id()); |
504 | 508 |
505 InSequence s; | 509 InSequence s; |
506 EXPECT_CALL(*stream2, OnCanWrite()); | 510 EXPECT_CALL(*stream2, OnCanWrite()); |
507 EXPECT_CALL(*stream4, OnCanWrite()); | 511 EXPECT_CALL(*stream4, OnCanWrite()); |
508 session_.OnCanWrite(); | 512 session_.OnCanWrite(); |
509 EXPECT_FALSE(session_.WillingAndAbleToWrite()); | 513 EXPECT_FALSE(session_.WillingAndAbleToWrite()); |
510 } | 514 } |
511 | 515 |
512 TEST_P(QuicSessionTestServer, OnCanWriteLimitsNumWritesIfFlowControlBlocked) { | 516 TEST_P(QuicSessionTestServer, OnCanWriteLimitsNumWritesIfFlowControlBlocked) { |
513 // Ensure connection level flow control blockage. | 517 // Ensure connection level flow control blockage. |
514 QuicFlowControllerPeer::SetSendWindowOffset(session_.flow_controller(), 0); | 518 QuicFlowControllerPeer::SetSendWindowOffset(session_.flow_controller(), 0); |
515 EXPECT_TRUE(session_.flow_controller()->IsBlocked()); | 519 EXPECT_TRUE(session_.flow_controller()->IsBlocked()); |
516 EXPECT_TRUE(session_.IsConnectionFlowControlBlocked()); | 520 EXPECT_TRUE(session_.IsConnectionFlowControlBlocked()); |
517 EXPECT_FALSE(session_.IsStreamFlowControlBlocked()); | 521 EXPECT_FALSE(session_.IsStreamFlowControlBlocked()); |
518 | 522 |
519 // Mark the crypto and headers streams as write blocked, we expect them to be | 523 // Mark the crypto and headers streams as write blocked, we expect them to be |
520 // allowed to write later. | 524 // allowed to write later. |
521 session_.MarkWriteBlocked(kCryptoStreamId, kHighestPriority); | 525 session_.MarkConnectionLevelWriteBlocked(kCryptoStreamId, kHighestPriority); |
522 session_.MarkWriteBlocked(kHeadersStreamId, kHighestPriority); | 526 session_.MarkConnectionLevelWriteBlocked(kHeadersStreamId, kHighestPriority); |
523 | 527 |
524 // Create a data stream, and although it is write blocked we never expect it | 528 // Create a data stream, and although it is write blocked we never expect it |
525 // to be allowed to write as we are connection level flow control blocked. | 529 // to be allowed to write as we are connection level flow control blocked. |
526 TestStream* stream = session_.CreateOutgoingDynamicStream(); | 530 TestStream* stream = session_.CreateOutgoingDynamicStream(); |
527 session_.MarkWriteBlocked(stream->id(), kSomeMiddlePriority); | 531 session_.MarkConnectionLevelWriteBlocked(stream->id(), kSomeMiddlePriority); |
528 EXPECT_CALL(*stream, OnCanWrite()).Times(0); | 532 EXPECT_CALL(*stream, OnCanWrite()).Times(0); |
529 | 533 |
530 // The crypto and headers streams should be called even though we are | 534 // The crypto and headers streams should be called even though we are |
531 // connection flow control blocked. | 535 // connection flow control blocked. |
532 TestCryptoStream* crypto_stream = session_.GetCryptoStream(); | 536 TestCryptoStream* crypto_stream = session_.GetCryptoStream(); |
533 EXPECT_CALL(*crypto_stream, OnCanWrite()).Times(1); | 537 EXPECT_CALL(*crypto_stream, OnCanWrite()).Times(1); |
534 TestHeadersStream* headers_stream = new TestHeadersStream(&session_); | 538 TestHeadersStream* headers_stream = new TestHeadersStream(&session_); |
535 QuicSpdySessionPeer::SetHeadersStream(&session_, headers_stream); | 539 QuicSpdySessionPeer::SetHeadersStream(&session_, headers_stream); |
536 EXPECT_CALL(*headers_stream, OnCanWrite()).Times(1); | 540 EXPECT_CALL(*headers_stream, OnCanWrite()).Times(1); |
537 | 541 |
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1012 EXPECT_TRUE(QuicSessionPeer::IsStreamImplicitlyCreated(&session_, 4)); | 1016 EXPECT_TRUE(QuicSessionPeer::IsStreamImplicitlyCreated(&session_, 4)); |
1013 ASSERT_TRUE(session_.GetIncomingDynamicStream(2) != nullptr); | 1017 ASSERT_TRUE(session_.GetIncomingDynamicStream(2) != nullptr); |
1014 ASSERT_TRUE(session_.GetIncomingDynamicStream(4) != nullptr); | 1018 ASSERT_TRUE(session_.GetIncomingDynamicStream(4) != nullptr); |
1015 // And 5 should be not implicitly created. | 1019 // And 5 should be not implicitly created. |
1016 EXPECT_FALSE(QuicSessionPeer::IsStreamImplicitlyCreated(&session_, 5)); | 1020 EXPECT_FALSE(QuicSessionPeer::IsStreamImplicitlyCreated(&session_, 5)); |
1017 } | 1021 } |
1018 | 1022 |
1019 } // namespace | 1023 } // namespace |
1020 } // namespace test | 1024 } // namespace test |
1021 } // namespace net | 1025 } // namespace net |
OLD | NEW |