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

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

Issue 2591143003: Add QuicStrCat. (Closed)
Patch Set: correct quic_client_bin.cc Created 4 years 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 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/core/quic_headers_stream.h" 5 #include "net/quic/core/quic_headers_stream.h"
6 6
7 #include <ostream> 7 #include <ostream>
8 #include <string> 8 #include <string>
9 #include <tuple> 9 #include <tuple>
10 #include <utility> 10 #include <utility>
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 // SETTINGS_INITIAL_WINDOW_SIZE, SETTINGS_ENABLE_PUSH and 770 // SETTINGS_INITIAL_WINDOW_SIZE, SETTINGS_ENABLE_PUSH and
771 // SETTINGS_MAX_FRAME_SIZE. 771 // SETTINGS_MAX_FRAME_SIZE.
772 data.AddSetting(SETTINGS_MAX_CONCURRENT_STREAMS, 100); 772 data.AddSetting(SETTINGS_MAX_CONCURRENT_STREAMS, 100);
773 data.AddSetting(SETTINGS_INITIAL_WINDOW_SIZE, 100); 773 data.AddSetting(SETTINGS_INITIAL_WINDOW_SIZE, 100);
774 data.AddSetting(SETTINGS_ENABLE_PUSH, 1); 774 data.AddSetting(SETTINGS_ENABLE_PUSH, 1);
775 data.AddSetting(SETTINGS_MAX_FRAME_SIZE, 1250); 775 data.AddSetting(SETTINGS_MAX_FRAME_SIZE, 1250);
776 SpdySerializedFrame frame(framer_->SerializeFrame(data)); 776 SpdySerializedFrame frame(framer_->SerializeFrame(data));
777 EXPECT_CALL( 777 EXPECT_CALL(
778 *connection_, 778 *connection_,
779 CloseConnection(QUIC_INVALID_HEADERS_STREAM_DATA, 779 CloseConnection(QUIC_INVALID_HEADERS_STREAM_DATA,
780 "Unsupported field of HTTP/2 SETTINGS frame: " + 780 QuicStrCat("Unsupported field of HTTP/2 SETTINGS frame: ",
781 base::IntToString(SETTINGS_MAX_CONCURRENT_STREAMS), 781 SETTINGS_MAX_CONCURRENT_STREAMS),
782 _)); 782 _));
783 EXPECT_CALL( 783 EXPECT_CALL(
784 *connection_, 784 *connection_,
785 CloseConnection(QUIC_INVALID_HEADERS_STREAM_DATA, 785 CloseConnection(QUIC_INVALID_HEADERS_STREAM_DATA,
786 "Unsupported field of HTTP/2 SETTINGS frame: " + 786 QuicStrCat("Unsupported field of HTTP/2 SETTINGS frame: ",
787 base::IntToString(SETTINGS_INITIAL_WINDOW_SIZE), 787 SETTINGS_INITIAL_WINDOW_SIZE),
788 _)); 788 _));
789 if (!FLAGS_quic_enable_server_push_by_default || 789 if (!FLAGS_quic_enable_server_push_by_default ||
790 session_.perspective() == Perspective::IS_CLIENT) { 790 session_.perspective() == Perspective::IS_CLIENT) {
791 EXPECT_CALL(*connection_, 791 EXPECT_CALL(*connection_,
792 CloseConnection(QUIC_INVALID_HEADERS_STREAM_DATA, 792 CloseConnection(
793 "Unsupported field of HTTP/2 SETTINGS frame: " + 793 QUIC_INVALID_HEADERS_STREAM_DATA,
794 base::IntToString(SETTINGS_ENABLE_PUSH), 794 QuicStrCat("Unsupported field of HTTP/2 SETTINGS frame: ",
795 _)); 795 SETTINGS_ENABLE_PUSH),
796 _));
796 } 797 }
797 EXPECT_CALL(*connection_, 798 EXPECT_CALL(
798 CloseConnection(QUIC_INVALID_HEADERS_STREAM_DATA, 799 *connection_,
799 "Unsupported field of HTTP/2 SETTINGS frame: " + 800 CloseConnection(QUIC_INVALID_HEADERS_STREAM_DATA,
800 base::IntToString(SETTINGS_MAX_FRAME_SIZE), 801 QuicStrCat("Unsupported field of HTTP/2 SETTINGS frame: ",
801 _)); 802 SETTINGS_MAX_FRAME_SIZE),
803 _));
802 stream_frame_.data_buffer = frame.data(); 804 stream_frame_.data_buffer = frame.data();
803 stream_frame_.data_length = frame.size(); 805 stream_frame_.data_length = frame.size();
804 headers_stream_->OnStreamFrame(stream_frame_); 806 headers_stream_->OnStreamFrame(stream_frame_);
805 } 807 }
806 808
807 TEST_P(QuicHeadersStreamTest, ProcessSpdyPingFrame) { 809 TEST_P(QuicHeadersStreamTest, ProcessSpdyPingFrame) {
808 SpdyPingIR data(1); 810 SpdyPingIR data(1);
809 SpdySerializedFrame frame(framer_->SerializeFrame(data)); 811 SpdySerializedFrame frame(framer_->SerializeFrame(data));
810 EXPECT_CALL(*connection_, CloseConnection(QUIC_INVALID_HEADERS_STREAM_DATA, 812 EXPECT_CALL(*connection_, CloseConnection(QUIC_INVALID_HEADERS_STREAM_DATA,
811 "SPDY PING frame received.", _)) 813 "SPDY PING frame received.", _))
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
1045 consumed_data = headers_stream_->WritevStreamData( 1047 consumed_data = headers_stream_->WritevStreamData(
1046 id, MakeIOVector(data, &iov), offset, fin, nullptr); 1048 id, MakeIOVector(data, &iov), offset, fin, nullptr);
1047 1049
1048 EXPECT_EQ(consumed_data.bytes_consumed, 0u); 1050 EXPECT_EQ(consumed_data.bytes_consumed, 0u);
1049 EXPECT_EQ(consumed_data.fin_consumed, false); 1051 EXPECT_EQ(consumed_data.fin_consumed, false);
1050 } 1052 }
1051 1053
1052 } // namespace 1054 } // namespace
1053 } // namespace test 1055 } // namespace test
1054 } // namespace net 1056 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698