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

Unified Diff: net/quic/core/quic_spdy_stream_test.cc

Issue 2547583002: Landing Recent QUIC changes until Fri Nov 18 23:21:04 2016 +0000 (Closed)
Patch Set: Remove explicit HTTP/2 enum usage 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/core/quic_spdy_stream.h ('k') | net/quic/core/quic_stream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/quic_spdy_stream_test.cc
diff --git a/net/quic/core/quic_spdy_stream_test.cc b/net/quic/core/quic_spdy_stream_test.cc
index f91f88abd041ee663fba61977e2cf8d1f50fee6b..2ac223e3a3aac97029c0c5ffc45a51b2ee18372c 100644
--- a/net/quic/core/quic_spdy_stream_test.cc
+++ b/net/quic/core/quic_spdy_stream_test.cc
@@ -388,9 +388,8 @@ TEST_P(QuicSpdyStreamTest, StreamFlowControlBlocked) {
// Try to send more data than the flow control limit allows.
string headers = SpdyUtils::SerializeUncompressedHeaders(headers_);
- string body;
const uint64_t kOverflow = 15;
- GenerateBody(&body, kWindow + kOverflow);
+ string body(kWindow + kOverflow, 'a');
EXPECT_CALL(*connection_, SendBlocked(kClientDataStreamId1));
EXPECT_CALL(*session_, WritevData(_, _, _, _, _, _))
@@ -427,8 +426,8 @@ TEST_P(QuicSpdyStreamTest, StreamFlowControlNoWindowUpdateIfNotConsumed) {
stream_->flow_controller()));
// Stream receives enough data to fill a fraction of the receive window.
- string body;
- GenerateBody(&body, kWindow / 3);
+ string body(kWindow / 3, 'a');
+ auto headers = AsHeaderList(headers_);
ProcessHeaders(false, headers_);
QuicStreamFrame frame1(kClientDataStreamId1, false, 0, StringPiece(body));
@@ -463,8 +462,7 @@ TEST_P(QuicSpdyStreamTest, StreamFlowControlWindowUpdate) {
stream_->flow_controller()));
// Stream receives enough data to fill a fraction of the receive window.
- string body;
- GenerateBody(&body, kWindow / 3);
+ string body(kWindow / 3, 'a');
ProcessHeaders(false, headers_);
stream_->ConsumeHeaderList();
@@ -521,8 +519,7 @@ TEST_P(QuicSpdyStreamTest, ConnectionFlowControlWindowUpdate) {
// Each stream gets a quarter window of data. This should not trigger a
// WINDOW_UPDATE for either stream, nor for the connection.
- string body;
- GenerateBody(&body, kWindow / 4);
+ string body(kWindow / 4, 'a');
QuicStreamFrame frame1(kClientDataStreamId1, false, 0, StringPiece(body));
stream_->OnStreamFrame(frame1);
QuicStreamFrame frame2(kClientDataStreamId2, false, 0, StringPiece(body));
@@ -558,8 +555,7 @@ TEST_P(QuicSpdyStreamTest, StreamFlowControlViolation) {
ProcessHeaders(false, headers_);
// Receive data to overflow the window, violating flow control.
- string body;
- GenerateBody(&body, kWindow + 1);
+ string body(kWindow + 1, 'a');
QuicStreamFrame frame(kClientDataStreamId1, false, 0, StringPiece(body));
EXPECT_CALL(*connection_,
CloseConnection(QUIC_FLOW_CONTROL_RECEIVED_TOO_MUCH_DATA, _, _));
@@ -596,8 +592,7 @@ TEST_P(QuicSpdyStreamTest, ConnectionFlowControlViolation) {
ProcessHeaders(false, headers_);
// Send enough data to overflow the connection level flow control window.
- string body;
- GenerateBody(&body, kConnectionWindow + 1);
+ string body(kConnectionWindow + 1, 'a');
EXPECT_LT(body.size(), kStreamWindow);
QuicStreamFrame frame(kClientDataStreamId1, false, 0, StringPiece(body));
« no previous file with comments | « net/quic/core/quic_spdy_stream.h ('k') | net/quic/core/quic_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698