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

Unified Diff: net/tools/quic/end_to_end_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/tools/quic/chlo_extractor.h ('k') | net/tools/quic/quic_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..a8f09094b2722aac1d9b71d4a0199d53997efee9 100644
--- a/net/tools/quic/end_to_end_test.cc
+++ b/net/tools/quic/end_to_end_test.cc
@@ -26,7 +26,7 @@
#include "net/quic/core/quic_flags.h"
#include "net/quic/core/quic_framer.h"
#include "net/quic/core/quic_packet_creator.h"
-#include "net/quic/core/quic_protocol.h"
+#include "net/quic/core/quic_packets.h"
#include "net/quic/core/quic_server_id.h"
#include "net/quic/core/quic_session.h"
#include "net/quic/core/quic_utils.h"
@@ -44,7 +44,7 @@
#include "net/test/gtest_util.h"
#include "net/tools/epoll_server/epoll_server.h"
#include "net/tools/quic/quic_epoll_connection_helper.h"
-#include "net/tools/quic/quic_in_memory_cache.h"
+#include "net/tools/quic/quic_http_response_cache.h"
#include "net/tools/quic/quic_packet_writer_wrapper.h"
#include "net/tools/quic/quic_server.h"
#include "net/tools/quic/quic_simple_server_stream.h"
@@ -429,7 +429,7 @@ class EndToEndTest : public ::testing::TestWithParam<TestParams> {
auto test_server = new QuicTestServer(
CryptoTestUtils::ProofSourceForTesting(), server_config_,
- server_supported_versions_, &in_memory_cache_);
+ server_supported_versions_, &response_cache_);
server_thread_.reset(new ServerThread(test_server, server_address_));
if (chlo_multiplier_ != 0) {
server_thread_->server()->SetChloMultiplier(chlo_multiplier_);
@@ -466,8 +466,8 @@ class EndToEndTest : public ::testing::TestWithParam<TestParams> {
}
void AddToCache(StringPiece path, int response_code, StringPiece body) {
- in_memory_cache_.AddSimpleResponse(server_hostname_, path, response_code,
- body);
+ response_cache_.AddSimpleResponse(server_hostname_, path, response_code,
+ body);
}
void SetPacketLossPercentage(int32_t loss) {
@@ -557,7 +557,7 @@ class EndToEndTest : public ::testing::TestWithParam<TestParams> {
bool initialized_;
QuicSocketAddress server_address_;
string server_hostname_;
- QuicInMemoryCache in_memory_cache_;
+ QuicHttpResponseCache response_cache_;
std::unique_ptr<ServerThread> server_thread_;
std::unique_ptr<QuicTestClient> client_;
PacketDroppingTestWriter* client_writer_;
@@ -581,7 +581,7 @@ INSTANTIATE_TEST_CASE_P(EndToEndTests,
TEST_P(EndToEndTest, HandshakeSuccessful) {
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
QuicCryptoStream* crypto_stream =
QuicSessionPeer::GetCryptoStream(client_->client()->session());
QuicStreamSequencer* sequencer = QuicStreamPeer::sequencer(crypto_stream);
@@ -729,11 +729,10 @@ TEST_P(EndToEndTest, PostMissingBytes) {
TEST_P(EndToEndTest, LargePostNoPacketLoss) {
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(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";
@@ -751,11 +750,10 @@ TEST_P(EndToEndTest, LargePostNoPacketLoss1sRTT) {
ASSERT_TRUE(Initialize());
SetPacketSendDelay(QuicTime::Delta::FromMilliseconds(1000));
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(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";
@@ -779,12 +777,11 @@ TEST_P(EndToEndTest, LargePostWithPacketLoss) {
ASSERT_TRUE(Initialize());
// Wait for the server SHLO before upping the packet loss.
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
SetPacketLossPercentage(30);
// 10 KB body.
- string body;
- GenerateBody(&body, 1024 * 10);
+ string body(1024 * 10, 'a');
SpdyHeaderBlock headers;
headers[":method"] = "POST";
headers[":path"] = "/foo";
@@ -807,13 +804,12 @@ TEST_P(EndToEndTest, LargePostWithPacketLossAndBlockedSocket) {
ASSERT_TRUE(Initialize());
// Wait for the server SHLO before upping the packet loss.
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
SetPacketLossPercentage(10);
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";
@@ -827,14 +823,13 @@ TEST_P(EndToEndTest, LargePostWithPacketLossAndBlockedSocket) {
TEST_P(EndToEndTest, LargePostNoPacketLossWithDelayAndReordering) {
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
// Both of these must be called when the writer is not actively used.
SetPacketSendDelay(QuicTime::Delta::FromMilliseconds(2));
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";
@@ -1034,7 +1027,7 @@ TEST_P(EndToEndTest, SetInitialReceivedConnectionOptions) {
initial_received_options));
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
server_thread_->WaitForCryptoHandshakeConfirmed();
EXPECT_FALSE(server_config_.SetInitialReceivedConnectionOptions(
@@ -1059,11 +1052,10 @@ TEST_P(EndToEndTest, LargePostSmallBandwidthLargeBuffer) {
server_writer_->set_max_bandwidth_and_buffer_size(
QuicBandwidth::FromBytesPerSecond(256 * 1024), 256 * 1024);
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(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";
@@ -1084,7 +1076,7 @@ TEST_P(EndToEndTest, DoNotSetResumeWriteAlarmIfConnectionFlowControlBlocked) {
// an infinite loop in the EpollServer, as the alarm fires and is immediately
// rescheduled.
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
// Ensure both stream and connection level are flow control blocked by setting
// the send window offset to 0.
@@ -1119,10 +1111,9 @@ TEST_P(EndToEndTest, DoNotSetResumeWriteAlarmIfConnectionFlowControlBlocked) {
TEST_P(EndToEndTest, InvalidStream) {
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
- string body;
- GenerateBody(&body, kMaxPacketSize);
+ string body(kMaxPacketSize, 'a');
SpdyHeaderBlock headers;
headers[":method"] = "POST";
headers[":path"] = "/foo";
@@ -1142,10 +1133,9 @@ TEST_P(EndToEndTest, InvalidStream) {
// to send a request with overly large headers.
TEST_P(EndToEndTest, LargeHeaders) {
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
- string body;
- GenerateBody(&body, kMaxPacketSize);
+ string body(kMaxPacketSize, 'a');
SpdyHeaderBlock headers;
headers[":method"] = "POST";
headers[":path"] = "/foo";
@@ -1168,10 +1158,9 @@ TEST_P(EndToEndTest, LargeHeaders) {
TEST_P(EndToEndTest, EarlyResponseWithQuicStreamNoError) {
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(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";
@@ -1224,7 +1213,7 @@ TEST_P(EndToEndTest, NegotiateMaxOpenStreams) {
// Negotiate 1 max open stream.
client_config_.SetMaxStreamsPerConnection(1, 1);
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
if (negotiated_version_ > QUIC_VERSION_34) {
// Newer versions use max incoming dynamic streams.
@@ -1262,7 +1251,7 @@ TEST_P(EndToEndTest, MaxIncomingDynamicStreamsLimitRespected) {
server_config_.SetMaxIncomingDynamicStreamsToSend(
kServerMaxIncomingDynamicStreams);
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
if (negotiated_version_ <= QUIC_VERSION_34) {
// Earlier versions negotiated max open streams.
@@ -1303,7 +1292,7 @@ TEST_P(EndToEndTest, SetIndependentMaxIncomingDynamicStreamsLimits) {
server_config_.SetMaxIncomingDynamicStreamsToSend(
kServerMaxIncomingDynamicStreams);
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
if (negotiated_version_ <= QUIC_VERSION_34) {
// Earlier versions negotiated max open streams.
@@ -1328,7 +1317,7 @@ TEST_P(EndToEndTest, NegotiateCongestionControl) {
// static_cast here does not work.
FLAGS_quic_enable_multipath = false;
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
CongestionControlType expected_congestion_control_type = kReno;
switch (GetParam().congestion_control_tag) {
@@ -1362,7 +1351,7 @@ TEST_P(EndToEndTest, LimitMaxOpenStreams) {
client_config_.SetMaxStreamsPerConnection(10, 5);
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
if (negotiated_version_ > QUIC_VERSION_34) {
// No negotiated max streams beyond version 34.
return;
@@ -1377,7 +1366,7 @@ TEST_P(EndToEndTest, ClientSuggestsRTT) {
client_config_.SetInitialRoundTripTimeUsToSend(kInitialRTT);
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
server_thread_->WaitForCryptoHandshakeConfirmed();
// Pause the server so we can access the server's internals without races.
@@ -1404,7 +1393,7 @@ TEST_P(EndToEndTest, MaxInitialRTT) {
kMaxInitialRoundTripTimeUs);
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
server_thread_->WaitForCryptoHandshakeConfirmed();
// Pause the server so we can access the server's internals without races.
@@ -1434,7 +1423,7 @@ TEST_P(EndToEndTest, MinInitialRTT) {
client_config_.SetInitialRoundTripTimeUsToSend(0);
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
server_thread_->WaitForCryptoHandshakeConfirmed();
// Pause the server so we can access the server's internals without races.
@@ -1518,13 +1507,12 @@ 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);
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
SetPacketLossPercentage(10);
for (int i = 0; i < max_streams; ++i) {
@@ -1539,12 +1527,11 @@ 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);
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
QuicSession* session = client_->client()->session();
// Lose the request.
@@ -1672,7 +1659,7 @@ TEST_P(EndToEndTest, DifferentFlowControlWindows) {
ASSERT_TRUE(Initialize());
// Values are exchanged during crypto handshake, so wait for that to finish.
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
server_thread_->WaitForCryptoHandshakeConfirmed();
// Open a data stream to make sure the stream level flow control is updated.
@@ -1725,7 +1712,7 @@ TEST_P(EndToEndTest, HeadersAndCryptoStreamsNoConnectionFlowControl) {
// Wait for crypto handshake to finish. This should have contributed to the
// crypto stream flow control window, but not affected the session flow
// control window.
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
server_thread_->WaitForCryptoHandshakeConfirmed();
QuicCryptoStream* crypto_stream =
@@ -1768,7 +1755,7 @@ TEST_P(EndToEndTest, FlowControlsSynced) {
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
server_thread_->WaitForCryptoHandshakeConfirmed();
server_thread_->Pause();
@@ -1868,7 +1855,7 @@ TEST_P(EndToEndTest, AckNotifierWithPacketLossAndBlockedSocket) {
ASSERT_TRUE(Initialize());
// Wait for the server SHLO before upping the packet loss.
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
SetPacketLossPercentage(30);
client_writer_->set_fake_blocked_socket_percentage(10);
@@ -1940,7 +1927,7 @@ TEST_P(EndToEndTest, ServerSendPublicReset) {
TEST_P(EndToEndTest, ServerSendPublicResetWithDifferentConnectionId) {
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
// Send the public reset.
QuicConnectionId incorrect_connection_id =
@@ -2005,7 +1992,7 @@ TEST_P(EndToEndTest, ClientSendPublicResetWithDifferentConnectionId) {
TEST_P(EndToEndTest, ServerSendVersionNegotiationWithDifferentConnectionId) {
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
// Send the version negotiation packet.
QuicConnectionId incorrect_connection_id =
@@ -2147,9 +2134,9 @@ class ServerStreamWithErrorResponseBody : public QuicSimpleServerStream {
public:
ServerStreamWithErrorResponseBody(QuicStreamId id,
QuicSpdySession* session,
- QuicInMemoryCache* in_memory_cache,
+ QuicHttpResponseCache* response_cache,
string response_body)
- : QuicSimpleServerStream(id, session, in_memory_cache),
+ : QuicSimpleServerStream(id, session, response_cache),
response_body_(std::move(response_body)) {}
~ServerStreamWithErrorResponseBody() override {}
@@ -2179,8 +2166,8 @@ class StreamWithErrorFactory : public QuicTestServer::StreamFactory {
QuicSimpleServerStream* CreateStream(
QuicStreamId id,
QuicSpdySession* session,
- QuicInMemoryCache* in_memory_cache) override {
- return new ServerStreamWithErrorResponseBody(id, session, in_memory_cache,
+ QuicHttpResponseCache* response_cache) override {
+ return new ServerStreamWithErrorResponseBody(id, session, response_cache,
response_body_);
}
@@ -2193,8 +2180,8 @@ class ServerStreamThatDropsBody : public QuicSimpleServerStream {
public:
ServerStreamThatDropsBody(QuicStreamId id,
QuicSpdySession* session,
- QuicInMemoryCache* in_memory_cache)
- : QuicSimpleServerStream(id, session, in_memory_cache) {}
+ QuicHttpResponseCache* response_cache)
+ : QuicSimpleServerStream(id, session, response_cache) {}
~ServerStreamThatDropsBody() override {}
@@ -2236,8 +2223,8 @@ class ServerStreamThatDropsBodyFactory : public QuicTestServer::StreamFactory {
QuicSimpleServerStream* CreateStream(
QuicStreamId id,
QuicSpdySession* session,
- QuicInMemoryCache* in_memory_cache) override {
- return new ServerStreamThatDropsBody(id, session, in_memory_cache);
+ QuicHttpResponseCache* response_cache) override {
+ return new ServerStreamThatDropsBody(id, session, response_cache);
}
};
@@ -2246,18 +2233,17 @@ class ServerStreamThatSendsHugeResponse : public QuicSimpleServerStream {
public:
ServerStreamThatSendsHugeResponse(QuicStreamId id,
QuicSpdySession* session,
- QuicInMemoryCache* in_memory_cache,
+ QuicHttpResponseCache* response_cache,
int64_t body_bytes)
- : QuicSimpleServerStream(id, session, in_memory_cache),
+ : QuicSimpleServerStream(id, session, response_cache),
body_bytes_(body_bytes) {}
~ServerStreamThatSendsHugeResponse() override {}
protected:
void SendResponse() override {
- QuicInMemoryCache::Response response;
- string body;
- GenerateBody(&body, body_bytes_);
+ QuicHttpResponseCache::Response response;
+ string body(body_bytes_, 'a');
response.set_body(body);
SendHeadersAndBodyAndTrailers(response.headers().Clone(), response.body(),
response.trailers().Clone());
@@ -2280,8 +2266,8 @@ class ServerStreamThatSendsHugeResponseFactory
QuicSimpleServerStream* CreateStream(
QuicStreamId id,
QuicSpdySession* session,
- QuicInMemoryCache* in_memory_cache) override {
- return new ServerStreamThatSendsHugeResponse(id, session, in_memory_cache,
+ QuicHttpResponseCache* response_cache) override {
+ return new ServerStreamThatSendsHugeResponse(id, session, response_cache,
body_bytes_);
}
@@ -2385,20 +2371,19 @@ 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);
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
// A POST that gets an early error response, after the headers are received
// and before the body is received, due to invalid content-length.
@@ -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);
@@ -2453,7 +2437,7 @@ TEST_P(EndToEndTest, LargePostEarlyResponse) {
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
// POST to a URL that gets an early error response, after the headers are
// received and before the body is received.
@@ -2483,7 +2467,7 @@ TEST_P(EndToEndTest, LargePostEarlyResponse) {
TEST_P(EndToEndTest, Trailers) {
// Test sending and receiving HTTP/2 Trailers (trailing HEADERS frames).
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
// Set reordering to ensure that Trailers arriving before body is ok.
SetPacketSendDelay(QuicTime::Delta::FromMilliseconds(2));
@@ -2500,8 +2484,8 @@ TEST_P(EndToEndTest, Trailers) {
SpdyHeaderBlock trailers;
trailers["some-trailing-header"] = "trailing-header-value";
- in_memory_cache_.AddResponse(server_hostname_, "/trailer_url",
- std::move(headers), kBody, trailers.Clone());
+ response_cache_.AddResponse(server_hostname_, "/trailer_url",
+ std::move(headers), kBody, trailers.Clone());
EXPECT_EQ(kBody, client_->SendSynchronousRequest("/trailer_url"));
EXPECT_EQ("200", client_->response_headers()->find(":status")->second);
@@ -2536,9 +2520,9 @@ 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;
+ std::list<QuicHttpResponseCache::ServerPushInfo> push_resources;
for (size_t i = 0; i < num_resources; ++i) {
string url = push_urls[i];
GURL resource_url(url);
@@ -2549,11 +2533,11 @@ class EndToEndTestServerPush : public EndToEndTest {
response_headers[":version"] = "HTTP/1.1";
response_headers[":status"] = "200";
response_headers["content-length"] = IntToString(body.size());
- push_resources.push_back(QuicInMemoryCache::ServerPushInfo(
+ push_resources.push_back(QuicHttpResponseCache::ServerPushInfo(
resource_url, std::move(response_headers), kV3LowestPriority, body));
}
- in_memory_cache_.AddSimpleResponseWithServerPushResources(
+ response_cache_.AddSimpleResponseWithServerPushResources(
host, path, 200, response_body, push_resources);
}
};
@@ -2565,7 +2549,7 @@ INSTANTIATE_TEST_CASE_P(EndToEndTestsServerPush,
TEST_P(EndToEndTestServerPush, ServerPush) {
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
// Set reordering to ensure that body arriving before PUSH_PROMISE is ok.
SetPacketSendDelay(QuicTime::Delta::FromMilliseconds(2));
@@ -2612,7 +2596,7 @@ TEST_P(EndToEndTestServerPush, ServerPushUnderLimit) {
// them with requests later.
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
// Set reordering to ensure that body arriving before PUSH_PROMISE is ok.
SetPacketSendDelay(QuicTime::Delta::FromMilliseconds(2));
@@ -2659,7 +2643,7 @@ TEST_P(EndToEndTestServerPush, ServerPushOverLimitNonBlocking) {
// streams should still work because all response streams get closed
// immediately after pushing resources.
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
// Set reordering to ensure that body arriving before PUSH_PROMISE is ok.
SetPacketSendDelay(QuicTime::Delta::FromMilliseconds(2));
@@ -2717,7 +2701,7 @@ TEST_P(EndToEndTestServerPush, ServerPushOverLimitWithBlocking) {
kBodySize * kNumMaxStreams + 1024);
ASSERT_TRUE(Initialize());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
// Set reordering to ensure that body arriving before PUSH_PROMISE is ok.
SetPacketSendDelay(QuicTime::Delta::FromMilliseconds(2));
@@ -2830,7 +2814,7 @@ TEST_P(EndToEndTest, DISABLED_TestHugePostWithPacketLoss) {
// within a short time.
client_->epoll_server()->set_timeout_in_us(0);
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
SetPacketLossPercentage(1);
// To avoid storing the whole request body in memory, use a loop to repeatedly
// send body size of kSizeBytes until the whole request body size is reached.
@@ -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";
@@ -2888,7 +2871,7 @@ TEST_P(EndToEndTest, DISABLED_TestHugeResponseWithPacketLoss) {
initialized_ = true;
ASSERT_TRUE(client_->client()->connected());
- client_->client()->WaitForCryptoHandshakeConfirmed();
+ EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
SetPacketLossPercentage(1);
client_->SendRequest("/huge_response");
client_->WaitForResponse();
« no previous file with comments | « net/tools/quic/chlo_extractor.h ('k') | net/tools/quic/quic_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698