| Index: net/tools/quic/end_to_end_test.cc
|
| diff --git a/net/tools/quic/end_to_end_test.cc b/net/tools/quic/end_to_end_test.cc
|
| index f84531ffc4f7744f67f965a8b9000ff35e86468a..24fa074171eb3ccaf5bad0b3a1f2131d8ceeea6d 100644
|
| --- a/net/tools/quic/end_to_end_test.cc
|
| +++ b/net/tools/quic/end_to_end_test.cc
|
| @@ -732,8 +732,7 @@ TEST_P(EndToEndTest, LargePostNoPacketLoss) {
|
| client_->client()->WaitForCryptoHandshakeConfirmed();
|
|
|
| // 1 MB body.
|
| - string body;
|
| - GenerateBody(&body, 1024 * 1024);
|
| + string body(1024 * 1024, 'a');
|
| SpdyHeaderBlock headers;
|
| headers[":method"] = "POST";
|
| headers[":path"] = "/foo";
|
| @@ -754,8 +753,7 @@ TEST_P(EndToEndTest, LargePostNoPacketLoss1sRTT) {
|
| client_->client()->WaitForCryptoHandshakeConfirmed();
|
|
|
| // 100 KB body.
|
| - string body;
|
| - GenerateBody(&body, 100 * 1024);
|
| + string body(100 * 1024, 'a');
|
| SpdyHeaderBlock headers;
|
| headers[":method"] = "POST";
|
| headers[":path"] = "/foo";
|
| @@ -783,8 +781,7 @@ TEST_P(EndToEndTest, LargePostWithPacketLoss) {
|
| SetPacketLossPercentage(30);
|
|
|
| // 10 KB body.
|
| - string body;
|
| - GenerateBody(&body, 1024 * 10);
|
| + string body(1024 * 10, 'a');
|
| SpdyHeaderBlock headers;
|
| headers[":method"] = "POST";
|
| headers[":path"] = "/foo";
|
| @@ -812,8 +809,7 @@ TEST_P(EndToEndTest, LargePostWithPacketLossAndBlockedSocket) {
|
| client_writer_->set_fake_blocked_socket_percentage(10);
|
|
|
| // 10 KB body.
|
| - string body;
|
| - GenerateBody(&body, 1024 * 10);
|
| + string body(1024 * 10, 'a');
|
| SpdyHeaderBlock headers;
|
| headers[":method"] = "POST";
|
| headers[":path"] = "/foo";
|
| @@ -833,8 +829,7 @@ TEST_P(EndToEndTest, LargePostNoPacketLossWithDelayAndReordering) {
|
| SetReorderPercentage(30);
|
|
|
| // 1 MB body.
|
| - string body;
|
| - GenerateBody(&body, 1024 * 1024);
|
| + string body(1024 * 1024, 'a');
|
| SpdyHeaderBlock headers;
|
| headers[":method"] = "POST";
|
| headers[":path"] = "/foo";
|
| @@ -850,8 +845,7 @@ TEST_P(EndToEndTest, LargePostZeroRTTFailure) {
|
| // a 0-RTT handshake for the next request.
|
| ASSERT_TRUE(Initialize());
|
|
|
| - string body;
|
| - GenerateBody(&body, 20480);
|
| + string body(20480, 'a');
|
| SpdyHeaderBlock headers;
|
| headers[":method"] = "POST";
|
| headers[":path"] = "/foo";
|
| @@ -961,8 +955,7 @@ TEST_P(EndToEndTest, LargePostSynchronousRequest) {
|
| // a 0-RTT handshake for the next request.
|
| ASSERT_TRUE(Initialize());
|
|
|
| - string body;
|
| - GenerateBody(&body, 20480);
|
| + string body(20480, 'a');
|
| SpdyHeaderBlock headers;
|
| headers[":method"] = "POST";
|
| headers[":path"] = "/foo";
|
| @@ -1062,8 +1055,7 @@ TEST_P(EndToEndTest, LargePostSmallBandwidthLargeBuffer) {
|
| client_->client()->WaitForCryptoHandshakeConfirmed();
|
|
|
| // 1 MB body.
|
| - string body;
|
| - GenerateBody(&body, 1024 * 1024);
|
| + string body(1024 * 1024, 'a');
|
| SpdyHeaderBlock headers;
|
| headers[":method"] = "POST";
|
| headers[":path"] = "/foo";
|
| @@ -1121,8 +1113,7 @@ TEST_P(EndToEndTest, InvalidStream) {
|
| ASSERT_TRUE(Initialize());
|
| client_->client()->WaitForCryptoHandshakeConfirmed();
|
|
|
| - string body;
|
| - GenerateBody(&body, kMaxPacketSize);
|
| + string body(kMaxPacketSize, 'a');
|
| SpdyHeaderBlock headers;
|
| headers[":method"] = "POST";
|
| headers[":path"] = "/foo";
|
| @@ -1144,8 +1135,7 @@ TEST_P(EndToEndTest, LargeHeaders) {
|
| ASSERT_TRUE(Initialize());
|
| client_->client()->WaitForCryptoHandshakeConfirmed();
|
|
|
| - string body;
|
| - GenerateBody(&body, kMaxPacketSize);
|
| + string body(kMaxPacketSize, 'a');
|
| SpdyHeaderBlock headers;
|
| headers[":method"] = "POST";
|
| headers[":path"] = "/foo";
|
| @@ -1170,8 +1160,7 @@ TEST_P(EndToEndTest, EarlyResponseWithQuicStreamNoError) {
|
| ASSERT_TRUE(Initialize());
|
| client_->client()->WaitForCryptoHandshakeConfirmed();
|
|
|
| - string large_body;
|
| - GenerateBody(&large_body, 1024 * 1024);
|
| + string large_body(1024 * 1024, 'a');
|
| SpdyHeaderBlock headers;
|
| headers[":method"] = "POST";
|
| headers[":path"] = "/foo";
|
| @@ -1518,8 +1507,7 @@ TEST_P(EndToEndTest, MaxStreamsUberTest) {
|
| SetPacketLossPercentage(1);
|
| }
|
| ASSERT_TRUE(Initialize());
|
| - string large_body;
|
| - GenerateBody(&large_body, 10240);
|
| + string large_body(10240, 'a');
|
| int max_streams = 100;
|
|
|
| AddToCache("/large_response", 200, large_body);
|
| @@ -1539,8 +1527,7 @@ TEST_P(EndToEndTest, MaxStreamsUberTest) {
|
|
|
| TEST_P(EndToEndTest, StreamCancelErrorTest) {
|
| ASSERT_TRUE(Initialize());
|
| - string small_body;
|
| - GenerateBody(&small_body, 256);
|
| + string small_body(256, 'a');
|
|
|
| AddToCache("/small_response", 200, small_body);
|
|
|
| @@ -2256,8 +2243,7 @@ class ServerStreamThatSendsHugeResponse : public QuicSimpleServerStream {
|
| protected:
|
| void SendResponse() override {
|
| QuicInMemoryCache::Response response;
|
| - string body;
|
| - GenerateBody(&body, body_bytes_);
|
| + string body(body_bytes_, 'a');
|
| response.set_body(body);
|
| SendHeadersAndBodyAndTrailers(response.headers().Clone(), response.body(),
|
| response.trailers().Clone());
|
| @@ -2385,13 +2371,12 @@ TEST_P(EndToEndTest, EarlyResponseFinRecording) {
|
| // receive the FIN of the request
|
| // send the FIN of the response
|
|
|
| - string response_body;
|
| // The response body must be larger than the flow control window so the server
|
| // must receive a window update from the client before it can finish sending
|
| // it.
|
| uint32_t response_body_size =
|
| 2 * client_config_.GetInitialStreamFlowControlWindowToSend();
|
| - GenerateBody(&response_body, response_body_size);
|
| + string response_body(response_body_size, 'a');
|
|
|
| StreamWithErrorFactory stream_factory(response_body);
|
| SetSpdyStreamFactory(&stream_factory);
|
| @@ -2417,8 +2402,7 @@ TEST_P(EndToEndTest, EarlyResponseFinRecording) {
|
| // before the request FIN is processed but receive the request FIN before the
|
| // response is sent completely.
|
| const uint32_t kRequestBodySize = kMaxPacketSize + 10;
|
| - string request_body;
|
| - GenerateBody(&request_body, kRequestBodySize);
|
| + string request_body(kRequestBodySize, 'a');
|
|
|
| // Send the request.
|
| client_->SendMessage(headers, request_body);
|
| @@ -2536,7 +2520,7 @@ class EndToEndTestServerPush : public EndToEndTest {
|
| if (use_large_response) {
|
| // Generate a response common body larger than flow control window for
|
| // push response.
|
| - GenerateBody(&large_resource, resource_size);
|
| + large_resource = string(resource_size, 'a');
|
| }
|
| std::list<QuicInMemoryCache::ServerPushInfo> push_resources;
|
| for (size_t i = 0; i < num_resources; ++i) {
|
| @@ -2838,8 +2822,7 @@ TEST_P(EndToEndTest, DISABLED_TestHugePostWithPacketLoss) {
|
| // Request body size is 4G plus one more kSizeBytes.
|
| int64_t request_body_size_bytes = pow(2, 32) + kSizeBytes;
|
| ASSERT_LT(INT64_C(4294967296), request_body_size_bytes);
|
| - string body;
|
| - GenerateBody(&body, kSizeBytes);
|
| + string body(kSizeBytes, 'a');
|
|
|
| SpdyHeaderBlock headers;
|
| headers[":method"] = "POST";
|
|
|