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

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

Issue 1979763002: Landing Recent QUIC changes until Sun May 8 00:39:29 2016 +0000 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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_framer_test.cc ('k') | net/quic/quic_http_stream_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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_headers_stream.h" 5 #include "net/quic/quic_headers_stream.h"
6 6
7 #include "net/quic/quic_utils.h" 7 #include "net/quic/quic_utils.h"
8 #include "net/quic/spdy_utils.h" 8 #include "net/quic/spdy_utils.h"
9 #include "net/quic/test_tools/quic_connection_peer.h" 9 #include "net/quic/test_tools/quic_connection_peer.h"
10 #include "net/quic/test_tools/quic_spdy_session_peer.h" 10 #include "net/quic/test_tools/quic_spdy_session_peer.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 params.push_back(TestParams(version, Perspective::IS_CLIENT)); 116 params.push_back(TestParams(version, Perspective::IS_CLIENT));
117 params.push_back(TestParams(version, Perspective::IS_SERVER)); 117 params.push_back(TestParams(version, Perspective::IS_SERVER));
118 } 118 }
119 FLAGS_quic_supports_push_promise = true; 119 FLAGS_quic_supports_push_promise = true;
120 return params; 120 return params;
121 } 121 }
122 122
123 class QuicHeadersStreamTest : public ::testing::TestWithParam<TestParams> { 123 class QuicHeadersStreamTest : public ::testing::TestWithParam<TestParams> {
124 public: 124 public:
125 QuicHeadersStreamTest() 125 QuicHeadersStreamTest()
126 : connection_(new StrictMock<MockConnection>(&helper_, 126 : connection_(new StrictMock<MockQuicConnection>(&helper_,
127 &alarm_factory_, 127 &alarm_factory_,
128 perspective(), 128 perspective(),
129 GetVersion())), 129 GetVersion())),
130 session_(connection_), 130 session_(connection_),
131 headers_stream_(QuicSpdySessionPeer::GetHeadersStream(&session_)), 131 headers_stream_(QuicSpdySessionPeer::GetHeadersStream(&session_)),
132 body_("hello world"), 132 body_("hello world"),
133 stream_frame_(kHeadersStreamId, /*fin=*/false, /*offset=*/0, ""), 133 stream_frame_(kHeadersStreamId, /*fin=*/false, /*offset=*/0, ""),
134 next_promised_stream_id_(2) { 134 next_promised_stream_id_(2) {
135 FLAGS_quic_always_log_bugs_for_tests = true; 135 FLAGS_quic_always_log_bugs_for_tests = true;
136 headers_[":version"] = "HTTP/1.1"; 136 headers_[":version"] = "HTTP/1.1";
137 headers_[":status"] = "200 Ok"; 137 headers_[":status"] = "200 Ok";
138 headers_["content-length"] = "11"; 138 headers_["content-length"] = "11";
139 framer_ = std::unique_ptr<SpdyFramer>(new SpdyFramer(HTTP2)); 139 framer_ = std::unique_ptr<SpdyFramer>(new SpdyFramer(HTTP2));
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 228
229 void TearDownLocalConnectionState() { 229 void TearDownLocalConnectionState() {
230 QuicConnectionPeer::TearDownLocalConnectionState(connection_); 230 QuicConnectionPeer::TearDownLocalConnectionState(connection_);
231 } 231 }
232 232
233 QuicStreamId NextPromisedStreamId() { return next_promised_stream_id_ += 2; } 233 QuicStreamId NextPromisedStreamId() { return next_promised_stream_id_ += 2; }
234 234
235 static const bool kFrameComplete = true; 235 static const bool kFrameComplete = true;
236 static const bool kHasPriority = true; 236 static const bool kHasPriority = true;
237 237
238 MockConnectionHelper helper_; 238 MockQuicConnectionHelper helper_;
239 MockAlarmFactory alarm_factory_; 239 MockAlarmFactory alarm_factory_;
240 StrictMock<MockConnection>* connection_; 240 StrictMock<MockQuicConnection>* connection_;
241 StrictMock<MockQuicSpdySession> session_; 241 StrictMock<MockQuicSpdySession> session_;
242 QuicHeadersStream* headers_stream_; 242 QuicHeadersStream* headers_stream_;
243 SpdyHeaderBlock headers_; 243 SpdyHeaderBlock headers_;
244 string body_; 244 string body_;
245 string saved_data_; 245 string saved_data_;
246 string saved_header_data_; 246 string saved_header_data_;
247 std::unique_ptr<SpdyFramer> framer_; 247 std::unique_ptr<SpdyFramer> framer_;
248 StrictMock<MockVisitor> visitor_; 248 StrictMock<MockVisitor> visitor_;
249 QuicStreamFrame stream_frame_; 249 QuicStreamFrame stream_frame_;
250 QuicStreamId next_promised_stream_id_; 250 QuicStreamId next_promised_stream_id_;
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 SpdyHeadersIR headers_frame(stream_id); 322 SpdyHeadersIR headers_frame(stream_id);
323 headers_frame.set_header_block(headers_); 323 headers_frame.set_header_block(headers_);
324 headers_frame.set_fin(fin); 324 headers_frame.set_fin(fin);
325 frame = framer_->SerializeFrame(headers_frame); 325 frame = framer_->SerializeFrame(headers_frame);
326 } 326 }
327 EXPECT_CALL(session_, OnStreamHeaders(stream_id, _)) 327 EXPECT_CALL(session_, OnStreamHeaders(stream_id, _))
328 .WillRepeatedly(WithArgs<1>(Invoke( 328 .WillRepeatedly(WithArgs<1>(Invoke(
329 this, &QuicHeadersStreamTest::SaveHeaderDataStringPiece))); 329 this, &QuicHeadersStreamTest::SaveHeaderDataStringPiece)));
330 EXPECT_CALL(session_, 330 EXPECT_CALL(session_,
331 OnStreamHeadersComplete(stream_id, fin, frame.size())); 331 OnStreamHeadersComplete(stream_id, fin, frame.size()));
332 stream_frame_.frame_buffer = frame.data(); 332 stream_frame_.data_buffer = frame.data();
333 stream_frame_.frame_length = frame.size(); 333 stream_frame_.data_length = frame.size();
334 headers_stream_->OnStreamFrame(stream_frame_); 334 headers_stream_->OnStreamFrame(stream_frame_);
335 stream_frame_.offset += frame.size(); 335 stream_frame_.offset += frame.size();
336 CheckHeaders(); 336 CheckHeaders();
337 } 337 }
338 } 338 }
339 } 339 }
340 } 340 }
341 341
342 TEST_P(QuicHeadersStreamTest, ProcessPushPromise) { 342 TEST_P(QuicHeadersStreamTest, ProcessPushPromise) {
343 if (perspective() == Perspective::IS_SERVER) 343 if (perspective() == Perspective::IS_SERVER)
(...skipping 10 matching lines...) Expand all
354 "PUSH_PROMISE not supported.", _)) 354 "PUSH_PROMISE not supported.", _))
355 .WillRepeatedly(InvokeWithoutArgs( 355 .WillRepeatedly(InvokeWithoutArgs(
356 this, &QuicHeadersStreamTest::TearDownLocalConnectionState)); 356 this, &QuicHeadersStreamTest::TearDownLocalConnectionState));
357 } else { 357 } else {
358 EXPECT_CALL(session_, OnPromiseHeaders(stream_id, _)) 358 EXPECT_CALL(session_, OnPromiseHeaders(stream_id, _))
359 .WillRepeatedly(WithArgs<1>( 359 .WillRepeatedly(WithArgs<1>(
360 Invoke(this, &QuicHeadersStreamTest::SaveHeaderDataStringPiece))); 360 Invoke(this, &QuicHeadersStreamTest::SaveHeaderDataStringPiece)));
361 EXPECT_CALL(session_, OnPromiseHeadersComplete( 361 EXPECT_CALL(session_, OnPromiseHeadersComplete(
362 stream_id, promised_stream_id, frame.size())); 362 stream_id, promised_stream_id, frame.size()));
363 } 363 }
364 stream_frame_.frame_buffer = frame.data(); 364 stream_frame_.data_buffer = frame.data();
365 stream_frame_.frame_length = frame.size(); 365 stream_frame_.data_length = frame.size();
366 headers_stream_->OnStreamFrame(stream_frame_); 366 headers_stream_->OnStreamFrame(stream_frame_);
367 if (perspective() == Perspective::IS_CLIENT) { 367 if (perspective() == Perspective::IS_CLIENT) {
368 stream_frame_.offset += frame.size(); 368 stream_frame_.offset += frame.size();
369 CheckHeaders(); 369 CheckHeaders();
370 } 370 }
371 } 371 }
372 } 372 }
373 373
374 TEST_P(QuicHeadersStreamTest, EmptyHeaderHOLBlockedTime) { 374 TEST_P(QuicHeadersStreamTest, EmptyHeaderHOLBlockedTime) {
375 if (!FLAGS_quic_measure_headers_hol_blocking_time) { 375 if (!FLAGS_quic_measure_headers_hol_blocking_time) {
(...skipping 15 matching lines...) Expand all
391 EXPECT_CALL(session_, OnStreamHeadersPriority(stream_id, 0)); 391 EXPECT_CALL(session_, OnStreamHeadersPriority(stream_id, 0));
392 } else { 392 } else {
393 SpdyHeadersIR headers_frame(stream_id); 393 SpdyHeadersIR headers_frame(stream_id);
394 headers_frame.set_header_block(headers_); 394 headers_frame.set_header_block(headers_);
395 headers_frame.set_fin(fin); 395 headers_frame.set_fin(fin);
396 frame = framer_->SerializeFrame(headers_frame); 396 frame = framer_->SerializeFrame(headers_frame);
397 } 397 }
398 EXPECT_CALL(session_, OnStreamHeaders(stream_id, _)); 398 EXPECT_CALL(session_, OnStreamHeaders(stream_id, _));
399 EXPECT_CALL(session_, 399 EXPECT_CALL(session_,
400 OnStreamHeadersComplete(stream_id, fin, frame.size())); 400 OnStreamHeadersComplete(stream_id, fin, frame.size()));
401 stream_frame_.frame_buffer = frame.data(); 401 stream_frame_.data_buffer = frame.data();
402 stream_frame_.frame_length = frame.size(); 402 stream_frame_.data_length = frame.size();
403 headers_stream_->OnStreamFrame(stream_frame_); 403 headers_stream_->OnStreamFrame(stream_frame_);
404 connection_->AdvanceTime(QuicTime::Delta::FromMilliseconds(1)); 404 connection_->AdvanceTime(QuicTime::Delta::FromMilliseconds(1));
405 stream_frame_.offset += frame.size(); 405 stream_frame_.offset += frame.size();
406 } 406 }
407 } 407 }
408 408
409 TEST_P(QuicHeadersStreamTest, NonEmptyHeaderHOLBlockedTime) { 409 TEST_P(QuicHeadersStreamTest, NonEmptyHeaderHOLBlockedTime) {
410 if (!FLAGS_quic_measure_headers_hol_blocking_time) { 410 if (!FLAGS_quic_measure_headers_hol_blocking_time) {
411 return; 411 return;
412 } 412 }
(...skipping 14 matching lines...) Expand all
427 frames[stream_num] = framer_->SerializeFrame(headers_frame); 427 frames[stream_num] = framer_->SerializeFrame(headers_frame);
428 EXPECT_CALL(session_, OnStreamHeadersPriority(stream_id, 0)).Times(1); 428 EXPECT_CALL(session_, OnStreamHeadersPriority(stream_id, 0)).Times(1);
429 } else { 429 } else {
430 SpdyHeadersIR headers_frame(stream_id); 430 SpdyHeadersIR headers_frame(stream_id);
431 headers_frame.set_header_block(headers_); 431 headers_frame.set_header_block(headers_);
432 headers_frame.set_fin(fin); 432 headers_frame.set_fin(fin);
433 frames[stream_num] = framer_->SerializeFrame(headers_frame); 433 frames[stream_num] = framer_->SerializeFrame(headers_frame);
434 } 434 }
435 stream_frames[stream_num].stream_id = stream_frame_.stream_id; 435 stream_frames[stream_num].stream_id = stream_frame_.stream_id;
436 stream_frames[stream_num].offset = stream_frame_.offset; 436 stream_frames[stream_num].offset = stream_frame_.offset;
437 stream_frames[stream_num].frame_buffer = frames[stream_num].data(); 437 stream_frames[stream_num].data_buffer = frames[stream_num].data();
438 stream_frames[stream_num].frame_length = frames[stream_num].size(); 438 stream_frames[stream_num].data_length = frames[stream_num].size();
439 DVLOG(1) << "make frame for stream " << stream_num << " offset " 439 DVLOG(1) << "make frame for stream " << stream_num << " offset "
440 << stream_frames[stream_num].offset; 440 << stream_frames[stream_num].offset;
441 stream_frame_.offset += frames[stream_num].size(); 441 stream_frame_.offset += frames[stream_num].size();
442 EXPECT_CALL(session_, OnStreamHeaders(stream_id, _)).Times(1); 442 EXPECT_CALL(session_, OnStreamHeaders(stream_id, _)).Times(1);
443 EXPECT_CALL(session_, OnStreamHeadersComplete(stream_id, fin, _)) 443 EXPECT_CALL(session_, OnStreamHeadersComplete(stream_id, fin, _))
444 .Times(1); 444 .Times(1);
445 } 445 }
446 } 446 }
447 447
448 // Actually writing the frames in reverse order will cause HOL blocking. 448 // Actually writing the frames in reverse order will cause HOL blocking.
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 SpdyHeadersIR headers_frame(stream_id); 480 SpdyHeadersIR headers_frame(stream_id);
481 headers_frame.set_header_block(headers_); 481 headers_frame.set_header_block(headers_);
482 headers_frame.set_fin(fin); 482 headers_frame.set_fin(fin);
483 frame = framer_->SerializeFrame(headers_frame); 483 frame = framer_->SerializeFrame(headers_frame);
484 } 484 }
485 EXPECT_CALL(session_, OnStreamHeaders(stream_id, _)) 485 EXPECT_CALL(session_, OnStreamHeaders(stream_id, _))
486 .WillRepeatedly(WithArgs<1>(Invoke( 486 .WillRepeatedly(WithArgs<1>(Invoke(
487 this, &QuicHeadersStreamTest::SaveHeaderDataStringPiece))); 487 this, &QuicHeadersStreamTest::SaveHeaderDataStringPiece)));
488 EXPECT_CALL(session_, 488 EXPECT_CALL(session_,
489 OnStreamHeadersComplete(stream_id, fin, frame.size())); 489 OnStreamHeadersComplete(stream_id, fin, frame.size()));
490 stream_frame_.frame_buffer = frame.data(); 490 stream_frame_.data_buffer = frame.data();
491 stream_frame_.frame_length = frame.size(); 491 stream_frame_.data_length = frame.size();
492 headers_stream_->OnStreamFrame(stream_frame_); 492 headers_stream_->OnStreamFrame(stream_frame_);
493 stream_frame_.offset += frame.size(); 493 stream_frame_.offset += frame.size();
494 CheckHeaders(); 494 CheckHeaders();
495 } 495 }
496 } 496 }
497 } 497 }
498 } 498 }
499 499
500 TEST_P(QuicHeadersStreamTest, ProcessBadData) { 500 TEST_P(QuicHeadersStreamTest, ProcessBadData) {
501 const char kBadData[] = "blah blah blah"; 501 const char kBadData[] = "blah blah blah";
502 EXPECT_CALL(*connection_, 502 EXPECT_CALL(*connection_,
503 CloseConnection(QUIC_INVALID_HEADERS_STREAM_DATA, _, _)) 503 CloseConnection(QUIC_INVALID_HEADERS_STREAM_DATA, _, _))
504 .Times(::testing::AnyNumber()); 504 .Times(::testing::AnyNumber());
505 stream_frame_.frame_buffer = kBadData; 505 stream_frame_.data_buffer = kBadData;
506 stream_frame_.frame_length = strlen(kBadData); 506 stream_frame_.data_length = strlen(kBadData);
507 headers_stream_->OnStreamFrame(stream_frame_); 507 headers_stream_->OnStreamFrame(stream_frame_);
508 } 508 }
509 509
510 TEST_P(QuicHeadersStreamTest, ProcessSpdyDataFrame) { 510 TEST_P(QuicHeadersStreamTest, ProcessSpdyDataFrame) {
511 SpdyDataIR data(2, ""); 511 SpdyDataIR data(2, "");
512 SpdySerializedFrame frame(framer_->SerializeFrame(data)); 512 SpdySerializedFrame frame(framer_->SerializeFrame(data));
513 EXPECT_CALL(*connection_, CloseConnection(QUIC_INVALID_HEADERS_STREAM_DATA, 513 EXPECT_CALL(*connection_, CloseConnection(QUIC_INVALID_HEADERS_STREAM_DATA,
514 "SPDY DATA frame received.", _)) 514 "SPDY DATA frame received.", _))
515 .WillOnce(InvokeWithoutArgs( 515 .WillOnce(InvokeWithoutArgs(
516 this, &QuicHeadersStreamTest::TearDownLocalConnectionState)); 516 this, &QuicHeadersStreamTest::TearDownLocalConnectionState));
517 stream_frame_.frame_buffer = frame.data(); 517 stream_frame_.data_buffer = frame.data();
518 stream_frame_.frame_length = frame.size(); 518 stream_frame_.data_length = frame.size();
519 headers_stream_->OnStreamFrame(stream_frame_); 519 headers_stream_->OnStreamFrame(stream_frame_);
520 } 520 }
521 521
522 TEST_P(QuicHeadersStreamTest, ProcessSpdyRstStreamFrame) { 522 TEST_P(QuicHeadersStreamTest, ProcessSpdyRstStreamFrame) {
523 SpdyRstStreamIR data(2, RST_STREAM_PROTOCOL_ERROR); 523 SpdyRstStreamIR data(2, RST_STREAM_PROTOCOL_ERROR);
524 SpdySerializedFrame frame(framer_->SerializeFrame(data)); 524 SpdySerializedFrame frame(framer_->SerializeFrame(data));
525 EXPECT_CALL(*connection_, 525 EXPECT_CALL(*connection_,
526 CloseConnection(QUIC_INVALID_HEADERS_STREAM_DATA, 526 CloseConnection(QUIC_INVALID_HEADERS_STREAM_DATA,
527 "SPDY RST_STREAM frame received.", _)) 527 "SPDY RST_STREAM frame received.", _))
528 .WillOnce(InvokeWithoutArgs( 528 .WillOnce(InvokeWithoutArgs(
529 this, &QuicHeadersStreamTest::TearDownLocalConnectionState)); 529 this, &QuicHeadersStreamTest::TearDownLocalConnectionState));
530 stream_frame_.frame_buffer = frame.data(); 530 stream_frame_.data_buffer = frame.data();
531 stream_frame_.frame_length = frame.size(); 531 stream_frame_.data_length = frame.size();
532 headers_stream_->OnStreamFrame(stream_frame_); 532 headers_stream_->OnStreamFrame(stream_frame_);
533 } 533 }
534 534
535 TEST_P(QuicHeadersStreamTest, ProcessSpdySettingsFrame) { 535 TEST_P(QuicHeadersStreamTest, ProcessSpdySettingsFrame) {
536 SpdySettingsIR data; 536 SpdySettingsIR data;
537 data.AddSetting(SETTINGS_HEADER_TABLE_SIZE, true, true, 0); 537 data.AddSetting(SETTINGS_HEADER_TABLE_SIZE, true, true, 0);
538 SpdySerializedFrame frame(framer_->SerializeFrame(data)); 538 SpdySerializedFrame frame(framer_->SerializeFrame(data));
539 EXPECT_CALL(*connection_, CloseConnection(QUIC_INVALID_HEADERS_STREAM_DATA, 539 EXPECT_CALL(*connection_, CloseConnection(QUIC_INVALID_HEADERS_STREAM_DATA,
540 "SPDY SETTINGS frame received.", _)) 540 "SPDY SETTINGS frame received.", _))
541 .WillOnce(InvokeWithoutArgs( 541 .WillOnce(InvokeWithoutArgs(
542 this, &QuicHeadersStreamTest::TearDownLocalConnectionState)); 542 this, &QuicHeadersStreamTest::TearDownLocalConnectionState));
543 stream_frame_.frame_buffer = frame.data(); 543 stream_frame_.data_buffer = frame.data();
544 stream_frame_.frame_length = frame.size(); 544 stream_frame_.data_length = frame.size();
545 headers_stream_->OnStreamFrame(stream_frame_); 545 headers_stream_->OnStreamFrame(stream_frame_);
546 } 546 }
547 547
548 TEST_P(QuicHeadersStreamTest, ProcessSpdyPingFrame) { 548 TEST_P(QuicHeadersStreamTest, ProcessSpdyPingFrame) {
549 SpdyPingIR data(1); 549 SpdyPingIR data(1);
550 SpdySerializedFrame frame(framer_->SerializeFrame(data)); 550 SpdySerializedFrame frame(framer_->SerializeFrame(data));
551 EXPECT_CALL(*connection_, CloseConnection(QUIC_INVALID_HEADERS_STREAM_DATA, 551 EXPECT_CALL(*connection_, CloseConnection(QUIC_INVALID_HEADERS_STREAM_DATA,
552 "SPDY PING frame received.", _)) 552 "SPDY PING frame received.", _))
553 .WillOnce(InvokeWithoutArgs( 553 .WillOnce(InvokeWithoutArgs(
554 this, &QuicHeadersStreamTest::TearDownLocalConnectionState)); 554 this, &QuicHeadersStreamTest::TearDownLocalConnectionState));
555 stream_frame_.frame_buffer = frame.data(); 555 stream_frame_.data_buffer = frame.data();
556 stream_frame_.frame_length = frame.size(); 556 stream_frame_.data_length = frame.size();
557 headers_stream_->OnStreamFrame(stream_frame_); 557 headers_stream_->OnStreamFrame(stream_frame_);
558 } 558 }
559 559
560 TEST_P(QuicHeadersStreamTest, ProcessSpdyGoAwayFrame) { 560 TEST_P(QuicHeadersStreamTest, ProcessSpdyGoAwayFrame) {
561 SpdyGoAwayIR data(1, GOAWAY_PROTOCOL_ERROR, "go away"); 561 SpdyGoAwayIR data(1, GOAWAY_PROTOCOL_ERROR, "go away");
562 SpdySerializedFrame frame(framer_->SerializeFrame(data)); 562 SpdySerializedFrame frame(framer_->SerializeFrame(data));
563 EXPECT_CALL(*connection_, CloseConnection(QUIC_INVALID_HEADERS_STREAM_DATA, 563 EXPECT_CALL(*connection_, CloseConnection(QUIC_INVALID_HEADERS_STREAM_DATA,
564 "SPDY GOAWAY frame received.", _)) 564 "SPDY GOAWAY frame received.", _))
565 .WillOnce(InvokeWithoutArgs( 565 .WillOnce(InvokeWithoutArgs(
566 this, &QuicHeadersStreamTest::TearDownLocalConnectionState)); 566 this, &QuicHeadersStreamTest::TearDownLocalConnectionState));
567 stream_frame_.frame_buffer = frame.data(); 567 stream_frame_.data_buffer = frame.data();
568 stream_frame_.frame_length = frame.size(); 568 stream_frame_.data_length = frame.size();
569 headers_stream_->OnStreamFrame(stream_frame_); 569 headers_stream_->OnStreamFrame(stream_frame_);
570 } 570 }
571 571
572 TEST_P(QuicHeadersStreamTest, ProcessSpdyWindowUpdateFrame) { 572 TEST_P(QuicHeadersStreamTest, ProcessSpdyWindowUpdateFrame) {
573 SpdyWindowUpdateIR data(1, 1); 573 SpdyWindowUpdateIR data(1, 1);
574 SpdySerializedFrame frame(framer_->SerializeFrame(data)); 574 SpdySerializedFrame frame(framer_->SerializeFrame(data));
575 EXPECT_CALL(*connection_, 575 EXPECT_CALL(*connection_,
576 CloseConnection(QUIC_INVALID_HEADERS_STREAM_DATA, 576 CloseConnection(QUIC_INVALID_HEADERS_STREAM_DATA,
577 "SPDY WINDOW_UPDATE frame received.", _)) 577 "SPDY WINDOW_UPDATE frame received.", _))
578 .WillOnce(InvokeWithoutArgs( 578 .WillOnce(InvokeWithoutArgs(
579 this, &QuicHeadersStreamTest::TearDownLocalConnectionState)); 579 this, &QuicHeadersStreamTest::TearDownLocalConnectionState));
580 stream_frame_.frame_buffer = frame.data(); 580 stream_frame_.data_buffer = frame.data();
581 stream_frame_.frame_length = frame.size(); 581 stream_frame_.data_length = frame.size();
582 headers_stream_->OnStreamFrame(stream_frame_); 582 headers_stream_->OnStreamFrame(stream_frame_);
583 } 583 }
584 584
585 TEST_P(QuicHeadersStreamTest, NoConnectionLevelFlowControl) { 585 TEST_P(QuicHeadersStreamTest, NoConnectionLevelFlowControl) {
586 EXPECT_FALSE(ReliableQuicStreamPeer::StreamContributesToConnectionFlowControl( 586 EXPECT_FALSE(ReliableQuicStreamPeer::StreamContributesToConnectionFlowControl(
587 headers_stream_)); 587 headers_stream_));
588 } 588 }
589 589
590 } // namespace 590 } // namespace
591 } // namespace test 591 } // namespace test
592 } // namespace net 592 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_framer_test.cc ('k') | net/quic/quic_http_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698