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

Side by Side Diff: net/tools/quic/quic_simple_server_session_test.cc

Issue 2536033004: Remove uses of gfe2::test::GenerateBody from QUIC code and use the string fill constructor instead. (Closed)
Patch Set: 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
« no previous file with comments | « net/tools/quic/end_to_end_test.cc ('k') | no next file » | 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/tools/quic/quic_simple_server_session.h" 5 #include "net/tools/quic/quic_simple_server_session.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 SpdyHeaderBlock request_headers; 469 SpdyHeaderBlock request_headers;
470 string resource_host = "www.google.com"; 470 string resource_host = "www.google.com";
471 string partial_push_resource_path = "/server_push_src"; 471 string partial_push_resource_path = "/server_push_src";
472 std::list<QuicInMemoryCache::ServerPushInfo> push_resources; 472 std::list<QuicInMemoryCache::ServerPushInfo> push_resources;
473 string scheme = "http"; 473 string scheme = "http";
474 for (unsigned int i = 1; i <= num_resources; ++i) { 474 for (unsigned int i = 1; i <= num_resources; ++i) {
475 QuicStreamId stream_id = i * 2; 475 QuicStreamId stream_id = i * 2;
476 string path = partial_push_resource_path + base::UintToString(i); 476 string path = partial_push_resource_path + base::UintToString(i);
477 string url = scheme + "://" + resource_host + path; 477 string url = scheme + "://" + resource_host + path;
478 GURL resource_url = GURL(url); 478 GURL resource_url = GURL(url);
479 string body; 479 string body(body_size, 'a');
480 GenerateBody(&body, body_size);
481 in_memory_cache_.AddSimpleResponse(resource_host, path, 200, body); 480 in_memory_cache_.AddSimpleResponse(resource_host, path, 200, body);
482 push_resources.push_back(QuicInMemoryCache::ServerPushInfo( 481 push_resources.push_back(QuicInMemoryCache::ServerPushInfo(
483 resource_url, SpdyHeaderBlock(), kDefaultPriority, body)); 482 resource_url, SpdyHeaderBlock(), kDefaultPriority, body));
484 // PUSH_PROMISED are sent for all the resources. 483 // PUSH_PROMISED are sent for all the resources.
485 EXPECT_CALL(*headers_stream_, 484 EXPECT_CALL(*headers_stream_,
486 WritePushPromiseMock(kClientDataStreamId1, stream_id, _)); 485 WritePushPromiseMock(kClientDataStreamId1, stream_id, _));
487 if (i <= kMaxStreamsForTest) { 486 if (i <= kMaxStreamsForTest) {
488 // |kMaxStreamsForTest| promised responses should be sent. 487 // |kMaxStreamsForTest| promised responses should be sent.
489 EXPECT_CALL( 488 EXPECT_CALL(
490 *headers_stream_, 489 *headers_stream_,
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 .WillOnce(Return(QuicConsumedData(kStreamFlowControlWindowSize, false))); 622 .WillOnce(Return(QuicConsumedData(kStreamFlowControlWindowSize, false)));
624 623
625 EXPECT_CALL(*connection_, SendBlocked(stream_to_open)); 624 EXPECT_CALL(*connection_, SendBlocked(stream_to_open));
626 QuicRstStreamFrame rst(stream_got_reset, QUIC_STREAM_CANCELLED, 0); 625 QuicRstStreamFrame rst(stream_got_reset, QUIC_STREAM_CANCELLED, 0);
627 visitor_->OnRstStream(rst); 626 visitor_->OnRstStream(rst);
628 } 627 }
629 628
630 } // namespace 629 } // namespace
631 } // namespace test 630 } // namespace test
632 } // namespace net 631 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/end_to_end_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698