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

Unified Diff: net/http/http_network_transaction_unittest.cc

Issue 1852423004: Implement SpdySerializedFrame move semantics. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months 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/http/bidirectional_stream_unittest.cc ('k') | net/http/http_proxy_client_socket_pool_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_network_transaction_unittest.cc
diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc
index 3ebe1cb4e08c14493fdb51e155d268b8c12640ed..6be19d7e4081579c862a5fc9fd6198bc2033ac46 100644
--- a/net/http/http_network_transaction_unittest.cc
+++ b/net/http/http_network_transaction_unittest.cc
@@ -1437,11 +1437,11 @@ void HttpNetworkTransactionTest::PreconnectErrorResendRequestTest(
session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl2);
// SPDY versions of the request and response.
- scoped_ptr<SpdyFrame> spdy_request(spdy_util_.ConstructSpdyGet(
+ scoped_ptr<SpdySerializedFrame> spdy_request(spdy_util_.ConstructSpdyGet(
request.url.spec().c_str(), 1, DEFAULT_PRIORITY));
- scoped_ptr<SpdyFrame> spdy_response(
+ scoped_ptr<SpdySerializedFrame> spdy_response(
spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1));
- scoped_ptr<SpdyFrame> spdy_data(
+ scoped_ptr<SpdySerializedFrame> spdy_data(
spdy_util_.ConstructSpdyBodyFrame(1, "hello", 5, true));
// HTTP/1.1 versions of the request and response.
@@ -4215,12 +4215,14 @@ TEST_P(HttpNetworkTransactionTest, HttpsProxySpdyGet) {
scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
// fetch http://www.example.org/ via SPDY
- scoped_ptr<SpdyFrame> req(
+ scoped_ptr<SpdySerializedFrame> req(
spdy_util_.ConstructSpdyGet(nullptr, 0, 1, LOWEST, false));
MockWrite spdy_writes[] = {CreateMockWrite(*req, 0)};
- scoped_ptr<SpdyFrame> resp(spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1));
- scoped_ptr<SpdyFrame> data(spdy_util_.ConstructSpdyBodyFrame(1, true));
+ scoped_ptr<SpdySerializedFrame> resp(
+ spdy_util_.ConstructSpdyGetSynReply(nullptr, 0, 1));
+ scoped_ptr<SpdySerializedFrame> data(
+ spdy_util_.ConstructSpdyBodyFrame(1, true));
MockRead spdy_reads[] = {
CreateMockRead(*resp, 1), CreateMockRead(*data, 2), MockRead(ASYNC, 0, 3),
};
@@ -4275,12 +4277,14 @@ TEST_P(HttpNetworkTransactionTest, HttpsProxySpdyGetWithSessionRace) {
scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
// Fetch http://www.example.org/ through the SPDY proxy.
- scoped_ptr<SpdyFrame> req(
+ scoped_ptr<SpdySerializedFrame> req(
spdy_util_.ConstructSpdyGet(nullptr, 0, 1, LOWEST, false));
MockWrite spdy_writes[] = {CreateMockWrite(*req, 0)};
- scoped_ptr<SpdyFrame> resp(spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1));
- scoped_ptr<SpdyFrame> data(spdy_util_.ConstructSpdyBodyFrame(1, true));
+ scoped_ptr<SpdySerializedFrame> resp(
+ spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1));
+ scoped_ptr<SpdySerializedFrame> data(
+ spdy_util_.ConstructSpdyBodyFrame(1, true));
MockRead spdy_reads[] = {
CreateMockRead(*resp, 1), CreateMockRead(*data, 2), MockRead(ASYNC, 0, 3),
};
@@ -4345,18 +4349,16 @@ TEST_P(HttpNetworkTransactionTest, HttpsProxySpdyGetWithProxyAuth) {
// The first request will be a bare GET, the second request will be a
// GET with a Proxy-Authorization header.
- scoped_ptr<SpdyFrame> req_get(
+ scoped_ptr<SpdySerializedFrame> req_get(
spdy_util_.ConstructSpdyGet(nullptr, 0, 1, LOWEST, false));
spdy_util_.UpdateWithStreamDestruction(1);
const char* const kExtraAuthorizationHeaders[] = {
"proxy-authorization", "Basic Zm9vOmJhcg=="
};
- scoped_ptr<SpdyFrame> req_get_authorization(
+ scoped_ptr<SpdySerializedFrame> req_get_authorization(
spdy_util_.ConstructSpdyGet(kExtraAuthorizationHeaders,
- arraysize(kExtraAuthorizationHeaders) / 2,
- 3,
- LOWEST,
- false));
+ arraysize(kExtraAuthorizationHeaders) / 2, 3,
+ LOWEST, false));
MockWrite spdy_writes[] = {
CreateMockWrite(*req_get, 0), CreateMockWrite(*req_get_authorization, 3),
};
@@ -4367,16 +4369,16 @@ TEST_P(HttpNetworkTransactionTest, HttpsProxySpdyGetWithProxyAuth) {
const char* const kExtraAuthenticationHeaders[] = {
"proxy-authenticate", "Basic realm=\"MyRealm1\""
};
- scoped_ptr<SpdyFrame> resp_authentication(
+ scoped_ptr<SpdySerializedFrame> resp_authentication(
spdy_util_.ConstructSpdySynReplyError(
- "407 Proxy Authentication Required",
- kExtraAuthenticationHeaders, arraysize(kExtraAuthenticationHeaders)/2,
- 1));
- scoped_ptr<SpdyFrame> body_authentication(
+ "407 Proxy Authentication Required", kExtraAuthenticationHeaders,
+ arraysize(kExtraAuthenticationHeaders) / 2, 1));
+ scoped_ptr<SpdySerializedFrame> body_authentication(
spdy_util_.ConstructSpdyBodyFrame(1, true));
- scoped_ptr<SpdyFrame> resp_data(
+ scoped_ptr<SpdySerializedFrame> resp_data(
spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 3));
- scoped_ptr<SpdyFrame> body_data(spdy_util_.ConstructSpdyBodyFrame(3, true));
+ scoped_ptr<SpdySerializedFrame> body_data(
+ spdy_util_.ConstructSpdyBodyFrame(3, true));
MockRead spdy_reads[] = {
CreateMockRead(*resp_authentication, 1),
CreateMockRead(*body_authentication, 2),
@@ -4447,7 +4449,7 @@ TEST_P(HttpNetworkTransactionTest, HttpsProxySpdyConnectHttps) {
new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
// CONNECT to www.example.org:443 via SPDY
- scoped_ptr<SpdyFrame> connect(spdy_util_.ConstructSpdyConnect(
+ scoped_ptr<SpdySerializedFrame> connect(spdy_util_.ConstructSpdyConnect(
NULL, 0, 1, LOWEST, HostPortPair("www.example.org", 443)));
// fetch https://www.example.org/ via HTTP
@@ -4455,17 +4457,17 @@ TEST_P(HttpNetworkTransactionTest, HttpsProxySpdyConnectHttps) {
"GET / HTTP/1.1\r\n"
"Host: www.example.org\r\n"
"Connection: keep-alive\r\n\r\n";
- scoped_ptr<SpdyFrame> wrapped_get(
+ scoped_ptr<SpdySerializedFrame> wrapped_get(
spdy_util_.ConstructSpdyBodyFrame(1, get, strlen(get), false));
- scoped_ptr<SpdyFrame> conn_resp(
+ scoped_ptr<SpdySerializedFrame> conn_resp(
spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1));
const char resp[] = "HTTP/1.1 200 OK\r\n"
"Content-Length: 10\r\n\r\n";
- scoped_ptr<SpdyFrame> wrapped_get_resp(
+ scoped_ptr<SpdySerializedFrame> wrapped_get_resp(
spdy_util_.ConstructSpdyBodyFrame(1, resp, strlen(resp), false));
- scoped_ptr<SpdyFrame> wrapped_body(
+ scoped_ptr<SpdySerializedFrame> wrapped_body(
spdy_util_.ConstructSpdyBodyFrame(1, "1234567890", 10, false));
- scoped_ptr<SpdyFrame> window_update(
+ scoped_ptr<SpdySerializedFrame> window_update(
spdy_util_.ConstructSpdyWindowUpdate(1, wrapped_get_resp->size()));
MockWrite spdy_writes[] = {
@@ -4533,26 +4535,27 @@ TEST_P(HttpNetworkTransactionTest, HttpsProxySpdyConnectSpdy) {
new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
// CONNECT to www.example.org:443 via SPDY
- scoped_ptr<SpdyFrame> connect(spdy_util_.ConstructSpdyConnect(
+ scoped_ptr<SpdySerializedFrame> connect(spdy_util_.ConstructSpdyConnect(
NULL, 0, 1, LOWEST, HostPortPair("www.example.org", 443)));
// fetch https://www.example.org/ via SPDY
const char kMyUrl[] = "https://www.example.org/";
- scoped_ptr<SpdyFrame> get(
+ scoped_ptr<SpdySerializedFrame> get(
spdy_util_wrapped.ConstructSpdyGet(kMyUrl, 1, LOWEST));
- scoped_ptr<SpdyFrame> wrapped_get(
+ scoped_ptr<SpdySerializedFrame> wrapped_get(
spdy_util_.ConstructWrappedSpdyFrame(get, 1));
- scoped_ptr<SpdyFrame> conn_resp(
+ scoped_ptr<SpdySerializedFrame> conn_resp(
spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1));
- scoped_ptr<SpdyFrame> get_resp(
+ scoped_ptr<SpdySerializedFrame> get_resp(
spdy_util_wrapped.ConstructSpdyGetSynReply(NULL, 0, 1));
- scoped_ptr<SpdyFrame> wrapped_get_resp(
+ scoped_ptr<SpdySerializedFrame> wrapped_get_resp(
spdy_util_.ConstructWrappedSpdyFrame(get_resp, 1));
- scoped_ptr<SpdyFrame> body(spdy_util_wrapped.ConstructSpdyBodyFrame(1, true));
- scoped_ptr<SpdyFrame> wrapped_body(
+ scoped_ptr<SpdySerializedFrame> body(
+ spdy_util_wrapped.ConstructSpdyBodyFrame(1, true));
+ scoped_ptr<SpdySerializedFrame> wrapped_body(
spdy_util_.ConstructWrappedSpdyFrame(body, 1));
- scoped_ptr<SpdyFrame> window_update_get_resp(
+ scoped_ptr<SpdySerializedFrame> window_update_get_resp(
spdy_util_.ConstructSpdyWindowUpdate(1, wrapped_get_resp->size()));
- scoped_ptr<SpdyFrame> window_update_body(
+ scoped_ptr<SpdySerializedFrame> window_update_body(
spdy_util_.ConstructSpdyWindowUpdate(1, wrapped_body->size()));
MockWrite spdy_writes[] = {
@@ -4624,17 +4627,19 @@ TEST_P(HttpNetworkTransactionTest, HttpsProxySpdyConnectFailure) {
new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
// CONNECT to www.example.org:443 via SPDY
- scoped_ptr<SpdyFrame> connect(spdy_util_.ConstructSpdyConnect(
+ scoped_ptr<SpdySerializedFrame> connect(spdy_util_.ConstructSpdyConnect(
NULL, 0, 1, LOWEST, HostPortPair("www.example.org", 443)));
- scoped_ptr<SpdyFrame> get(
+ scoped_ptr<SpdySerializedFrame> get(
spdy_util_.ConstructSpdyRstStream(1, RST_STREAM_CANCEL));
MockWrite spdy_writes[] = {
CreateMockWrite(*connect, 0), CreateMockWrite(*get, 2),
};
- scoped_ptr<SpdyFrame> resp(spdy_util_.ConstructSpdySynReplyError(1));
- scoped_ptr<SpdyFrame> data(spdy_util_.ConstructSpdyBodyFrame(1, true));
+ scoped_ptr<SpdySerializedFrame> resp(
+ spdy_util_.ConstructSpdySynReplyError(1));
+ scoped_ptr<SpdySerializedFrame> data(
+ spdy_util_.ConstructSpdyBodyFrame(1, true));
MockRead spdy_reads[] = {
CreateMockRead(*resp, 1, ASYNC), MockRead(ASYNC, 0, 3),
};
@@ -4683,9 +4688,9 @@ TEST_P(HttpNetworkTransactionTest,
request2.load_flags = 0;
// CONNECT to www.example.org:443 via SPDY.
- scoped_ptr<SpdyFrame> connect1(spdy_util_.ConstructSpdyConnect(
+ scoped_ptr<SpdySerializedFrame> connect1(spdy_util_.ConstructSpdyConnect(
NULL, 0, 1, LOWEST, HostPortPair("www.example.org", 443)));
- scoped_ptr<SpdyFrame> conn_resp1(
+ scoped_ptr<SpdySerializedFrame> conn_resp1(
spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1));
// Fetch https://www.example.org/ via HTTP.
@@ -4693,15 +4698,15 @@ TEST_P(HttpNetworkTransactionTest,
"GET / HTTP/1.1\r\n"
"Host: www.example.org\r\n"
"Connection: keep-alive\r\n\r\n";
- scoped_ptr<SpdyFrame> wrapped_get1(
+ scoped_ptr<SpdySerializedFrame> wrapped_get1(
spdy_util_.ConstructSpdyBodyFrame(1, get1, strlen(get1), false));
const char resp1[] = "HTTP/1.1 200 OK\r\n"
"Content-Length: 1\r\n\r\n";
- scoped_ptr<SpdyFrame> wrapped_get_resp1(
+ scoped_ptr<SpdySerializedFrame> wrapped_get_resp1(
spdy_util_.ConstructSpdyBodyFrame(1, resp1, strlen(resp1), false));
- scoped_ptr<SpdyFrame> wrapped_body1(
+ scoped_ptr<SpdySerializedFrame> wrapped_body1(
spdy_util_.ConstructSpdyBodyFrame(1, "1", 1, false));
- scoped_ptr<SpdyFrame> window_update(
+ scoped_ptr<SpdySerializedFrame> window_update(
spdy_util_.ConstructSpdyWindowUpdate(1, wrapped_get_resp1->size()));
// CONNECT to mail.example.org:443 via SPDY.
@@ -4714,10 +4719,10 @@ TEST_P(HttpNetworkTransactionTest,
connect2_block[spdy_util_.GetHostKey()] = "mail.example.org";
connect2_block[spdy_util_.GetPathKey()] = "mail.example.org:443";
}
- scoped_ptr<SpdyFrame> connect2(
+ scoped_ptr<SpdySerializedFrame> connect2(
spdy_util_.ConstructSpdySyn(3, connect2_block, LOWEST, false));
- scoped_ptr<SpdyFrame> conn_resp2(
+ scoped_ptr<SpdySerializedFrame> conn_resp2(
spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 3));
// Fetch https://mail.example.org/ via HTTP.
@@ -4725,13 +4730,13 @@ TEST_P(HttpNetworkTransactionTest,
"GET / HTTP/1.1\r\n"
"Host: mail.example.org\r\n"
"Connection: keep-alive\r\n\r\n";
- scoped_ptr<SpdyFrame> wrapped_get2(
+ scoped_ptr<SpdySerializedFrame> wrapped_get2(
spdy_util_.ConstructSpdyBodyFrame(3, get2, strlen(get2), false));
const char resp2[] = "HTTP/1.1 200 OK\r\n"
"Content-Length: 2\r\n\r\n";
- scoped_ptr<SpdyFrame> wrapped_get_resp2(
+ scoped_ptr<SpdySerializedFrame> wrapped_get_resp2(
spdy_util_.ConstructSpdyBodyFrame(3, resp2, strlen(resp2), false));
- scoped_ptr<SpdyFrame> wrapped_body2(
+ scoped_ptr<SpdySerializedFrame> wrapped_body2(
spdy_util_.ConstructSpdyBodyFrame(3, "22", 2, false));
MockWrite spdy_writes[] = {
@@ -4825,9 +4830,9 @@ TEST_P(HttpNetworkTransactionTest,
request2.load_flags = 0;
// CONNECT to www.example.org:443 via SPDY.
- scoped_ptr<SpdyFrame> connect1(spdy_util_.ConstructSpdyConnect(
+ scoped_ptr<SpdySerializedFrame> connect1(spdy_util_.ConstructSpdyConnect(
NULL, 0, 1, LOWEST, HostPortPair("www.example.org", 443)));
- scoped_ptr<SpdyFrame> conn_resp1(
+ scoped_ptr<SpdySerializedFrame> conn_resp1(
spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1));
// Fetch https://www.example.org/ via HTTP.
@@ -4835,15 +4840,15 @@ TEST_P(HttpNetworkTransactionTest,
"GET / HTTP/1.1\r\n"
"Host: www.example.org\r\n"
"Connection: keep-alive\r\n\r\n";
- scoped_ptr<SpdyFrame> wrapped_get1(
+ scoped_ptr<SpdySerializedFrame> wrapped_get1(
spdy_util_.ConstructSpdyBodyFrame(1, get1, strlen(get1), false));
const char resp1[] = "HTTP/1.1 200 OK\r\n"
"Content-Length: 1\r\n\r\n";
- scoped_ptr<SpdyFrame> wrapped_get_resp1(
+ scoped_ptr<SpdySerializedFrame> wrapped_get_resp1(
spdy_util_.ConstructSpdyBodyFrame(1, resp1, strlen(resp1), false));
- scoped_ptr<SpdyFrame> wrapped_body1(
+ scoped_ptr<SpdySerializedFrame> wrapped_body1(
spdy_util_.ConstructSpdyBodyFrame(1, "1", 1, false));
- scoped_ptr<SpdyFrame> window_update(
+ scoped_ptr<SpdySerializedFrame> window_update(
spdy_util_.ConstructSpdyWindowUpdate(1, wrapped_get_resp1->size()));
// Fetch https://www.example.org/2 via HTTP.
@@ -4851,13 +4856,13 @@ TEST_P(HttpNetworkTransactionTest,
"GET /2 HTTP/1.1\r\n"
"Host: www.example.org\r\n"
"Connection: keep-alive\r\n\r\n";
- scoped_ptr<SpdyFrame> wrapped_get2(
+ scoped_ptr<SpdySerializedFrame> wrapped_get2(
spdy_util_.ConstructSpdyBodyFrame(1, get2, strlen(get2), false));
const char resp2[] = "HTTP/1.1 200 OK\r\n"
"Content-Length: 2\r\n\r\n";
- scoped_ptr<SpdyFrame> wrapped_get_resp2(
+ scoped_ptr<SpdySerializedFrame> wrapped_get_resp2(
spdy_util_.ConstructSpdyBodyFrame(1, resp2, strlen(resp2), false));
- scoped_ptr<SpdyFrame> wrapped_body2(
+ scoped_ptr<SpdySerializedFrame> wrapped_body2(
spdy_util_.ConstructSpdyBodyFrame(1, "22", 2, false));
MockWrite spdy_writes[] = {
@@ -4950,22 +4955,22 @@ TEST_P(HttpNetworkTransactionTest, HttpsProxySpdyLoadTimingTwoHttpRequests) {
// http://www.example.org/
scoped_ptr<SpdyHeaderBlock> headers(
spdy_util_.ConstructGetHeaderBlockForProxy("http://www.example.org/"));
- scoped_ptr<SpdyFrame> get1(
+ scoped_ptr<SpdySerializedFrame> get1(
spdy_util_.ConstructSpdySyn(1, *headers, LOWEST, true));
- scoped_ptr<SpdyFrame> get_resp1(
+ scoped_ptr<SpdySerializedFrame> get_resp1(
spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1));
- scoped_ptr<SpdyFrame> body1(
+ scoped_ptr<SpdySerializedFrame> body1(
spdy_util_.ConstructSpdyBodyFrame(1, "1", 1, true));
spdy_util_.UpdateWithStreamDestruction(1);
// http://mail.example.org/
scoped_ptr<SpdyHeaderBlock> headers2(
spdy_util_.ConstructGetHeaderBlockForProxy("http://mail.example.org/"));
- scoped_ptr<SpdyFrame> get2(
+ scoped_ptr<SpdySerializedFrame> get2(
spdy_util_.ConstructSpdySyn(3, *headers2, LOWEST, true));
- scoped_ptr<SpdyFrame> get_resp2(
+ scoped_ptr<SpdySerializedFrame> get_resp2(
spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 3));
- scoped_ptr<SpdyFrame> body2(
+ scoped_ptr<SpdySerializedFrame> body2(
spdy_util_.ConstructSpdyBodyFrame(3, "22", 2, true));
MockWrite spdy_writes[] = {
@@ -7396,9 +7401,9 @@ TEST_P(HttpNetworkTransactionTest, RedirectOfHttpsConnectViaSpdyProxy) {
request.url = GURL("https://www.example.org/");
request.load_flags = 0;
- scoped_ptr<SpdyFrame> conn(spdy_util_.ConstructSpdyConnect(
+ scoped_ptr<SpdySerializedFrame> conn(spdy_util_.ConstructSpdyConnect(
NULL, 0, 1, LOWEST, HostPortPair("www.example.org", 443)));
- scoped_ptr<SpdyFrame> goaway(
+ scoped_ptr<SpdySerializedFrame> goaway(
spdy_util_.ConstructSpdyRstStream(1, RST_STREAM_CANCEL));
MockWrite data_writes[] = {
CreateMockWrite(*conn.get(), 0, SYNCHRONOUS),
@@ -7409,9 +7414,8 @@ TEST_P(HttpNetworkTransactionTest, RedirectOfHttpsConnectViaSpdyProxy) {
"location",
"http://login.example.com/",
};
- scoped_ptr<SpdyFrame> resp(
- spdy_util_.ConstructSpdySynReplyError("302 Redirect", kExtraHeaders,
- arraysize(kExtraHeaders)/2, 1));
+ scoped_ptr<SpdySerializedFrame> resp(spdy_util_.ConstructSpdySynReplyError(
+ "302 Redirect", kExtraHeaders, arraysize(kExtraHeaders) / 2, 1));
MockRead data_reads[] = {
CreateMockRead(*resp.get(), 1), MockRead(ASYNC, 0, 3), // EOF
};
@@ -7500,9 +7504,9 @@ TEST_P(HttpNetworkTransactionTest,
request.url = GURL("https://www.example.org/");
request.load_flags = 0;
- scoped_ptr<SpdyFrame> conn(spdy_util_.ConstructSpdyConnect(
+ scoped_ptr<SpdySerializedFrame> conn(spdy_util_.ConstructSpdyConnect(
NULL, 0, 1, LOWEST, HostPortPair("www.example.org", 443)));
- scoped_ptr<SpdyFrame> rst(
+ scoped_ptr<SpdySerializedFrame> rst(
spdy_util_.ConstructSpdyRstStream(1, RST_STREAM_CANCEL));
MockWrite data_writes[] = {
CreateMockWrite(*conn.get(), 0), CreateMockWrite(*rst.get(), 3),
@@ -7512,12 +7516,10 @@ TEST_P(HttpNetworkTransactionTest,
"location",
"http://login.example.com/",
};
- scoped_ptr<SpdyFrame> resp(
- spdy_util_.ConstructSpdySynReplyError("404 Not Found", kExtraHeaders,
- arraysize(kExtraHeaders)/2, 1));
- scoped_ptr<SpdyFrame> body(
- spdy_util_.ConstructSpdyBodyFrame(
- 1, "The host does not exist", 23, true));
+ scoped_ptr<SpdySerializedFrame> resp(spdy_util_.ConstructSpdySynReplyError(
+ "404 Not Found", kExtraHeaders, arraysize(kExtraHeaders) / 2, 1));
+ scoped_ptr<SpdySerializedFrame> body(spdy_util_.ConstructSpdyBodyFrame(
+ 1, "The host does not exist", 23, true));
MockRead data_reads[] = {
CreateMockRead(*resp.get(), 1),
CreateMockRead(*body.get(), 2),
@@ -7564,9 +7566,9 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthSpdyProxy) {
scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
// Since we have proxy, should try to establish tunnel.
- scoped_ptr<SpdyFrame> req(spdy_util_.ConstructSpdyConnect(
+ scoped_ptr<SpdySerializedFrame> req(spdy_util_.ConstructSpdyConnect(
NULL, 0, 1, LOWEST, HostPortPair("www.example.org", 443)));
- scoped_ptr<SpdyFrame> rst(
+ scoped_ptr<SpdySerializedFrame> rst(
spdy_util_.ConstructSpdyRstStream(1, RST_STREAM_CANCEL));
spdy_util_.UpdateWithStreamDestruction(1);
@@ -7575,7 +7577,7 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthSpdyProxy) {
const char* const kAuthCredentials[] = {
"proxy-authorization", "Basic Zm9vOmJhcg==",
};
- scoped_ptr<SpdyFrame> connect2(spdy_util_.ConstructSpdyConnect(
+ scoped_ptr<SpdySerializedFrame> connect2(spdy_util_.ConstructSpdyConnect(
kAuthCredentials, arraysize(kAuthCredentials) / 2, 3, LOWEST,
HostPortPair("www.example.org", 443)));
// fetch https://www.example.org/ via HTTP
@@ -7583,7 +7585,7 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthSpdyProxy) {
"GET / HTTP/1.1\r\n"
"Host: www.example.org\r\n"
"Connection: keep-alive\r\n\r\n";
- scoped_ptr<SpdyFrame> wrapped_get(
+ scoped_ptr<SpdySerializedFrame> wrapped_get(
spdy_util_.ConstructSpdyBodyFrame(3, get, strlen(get), false));
MockWrite spdy_writes[] = {
@@ -7599,17 +7601,18 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthSpdyProxy) {
const char* const kAuthChallenge[] = {
"proxy-authenticate", "Basic realm=\"MyRealm1\"",
};
- scoped_ptr<SpdyFrame> conn_auth_resp(spdy_util_.ConstructSpdySynReplyError(
- kAuthStatus, kAuthChallenge, arraysize(kAuthChallenge) / 2, 1));
+ scoped_ptr<SpdySerializedFrame> conn_auth_resp(
+ spdy_util_.ConstructSpdySynReplyError(kAuthStatus, kAuthChallenge,
+ arraysize(kAuthChallenge) / 2, 1));
- scoped_ptr<SpdyFrame> conn_resp(
+ scoped_ptr<SpdySerializedFrame> conn_resp(
spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 3));
const char resp[] = "HTTP/1.1 200 OK\r\n"
"Content-Length: 5\r\n\r\n";
- scoped_ptr<SpdyFrame> wrapped_get_resp(
+ scoped_ptr<SpdySerializedFrame> wrapped_get_resp(
spdy_util_.ConstructSpdyBodyFrame(3, resp, strlen(resp), false));
- scoped_ptr<SpdyFrame> wrapped_body(
+ scoped_ptr<SpdySerializedFrame> wrapped_body(
spdy_util_.ConstructSpdyBodyFrame(3, "hello", 5, false));
MockRead spdy_reads[] = {
CreateMockRead(*conn_auth_resp, 1, ASYNC),
@@ -7712,29 +7715,25 @@ TEST_P(HttpNetworkTransactionTest, CrossOriginSPDYProxyPush) {
scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
- scoped_ptr<SpdyFrame> stream1_syn(
+ scoped_ptr<SpdySerializedFrame> stream1_syn(
spdy_util_.ConstructSpdyGet(nullptr, 0, 1, LOWEST, false));
MockWrite spdy_writes[] = {
CreateMockWrite(*stream1_syn, 0, ASYNC),
};
- scoped_ptr<SpdyFrame>
- stream1_reply(spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1));
+ scoped_ptr<SpdySerializedFrame> stream1_reply(
+ spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1));
- scoped_ptr<SpdyFrame>
- stream1_body(spdy_util_.ConstructSpdyBodyFrame(1, true));
+ scoped_ptr<SpdySerializedFrame> stream1_body(
+ spdy_util_.ConstructSpdyBodyFrame(1, true));
- scoped_ptr<SpdyFrame>
- stream2_syn(spdy_util_.ConstructSpdyPush(NULL,
- 0,
- 2,
- 1,
- "http://www.another-origin.com/foo.dat"));
+ scoped_ptr<SpdySerializedFrame> stream2_syn(spdy_util_.ConstructSpdyPush(
+ NULL, 0, 2, 1, "http://www.another-origin.com/foo.dat"));
const char kPushedData[] = "pushed";
- scoped_ptr<SpdyFrame> stream2_body(
- spdy_util_.ConstructSpdyBodyFrame(
- 2, kPushedData, strlen(kPushedData), true));
+ scoped_ptr<SpdySerializedFrame> stream2_body(
+ spdy_util_.ConstructSpdyBodyFrame(2, kPushedData, strlen(kPushedData),
+ true));
MockRead spdy_reads[] = {
CreateMockRead(*stream1_reply, 1, ASYNC),
@@ -7829,28 +7828,24 @@ TEST_P(HttpNetworkTransactionTest, CrossOriginProxyPushCorrectness) {
scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
- scoped_ptr<SpdyFrame> stream1_syn(
+ scoped_ptr<SpdySerializedFrame> stream1_syn(
spdy_util_.ConstructSpdyGet(nullptr, 0, 1, LOWEST, false));
- scoped_ptr<SpdyFrame> push_rst(
+ scoped_ptr<SpdySerializedFrame> push_rst(
spdy_util_.ConstructSpdyRstStream(2, RST_STREAM_REFUSED_STREAM));
MockWrite spdy_writes[] = {
CreateMockWrite(*stream1_syn, 0, ASYNC), CreateMockWrite(*push_rst, 3),
};
- scoped_ptr<SpdyFrame>
- stream1_reply(spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1));
+ scoped_ptr<SpdySerializedFrame> stream1_reply(
+ spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1));
- scoped_ptr<SpdyFrame>
- stream1_body(spdy_util_.ConstructSpdyBodyFrame(1, true));
+ scoped_ptr<SpdySerializedFrame> stream1_body(
+ spdy_util_.ConstructSpdyBodyFrame(1, true));
- scoped_ptr<SpdyFrame>
- stream2_syn(spdy_util_.ConstructSpdyPush(NULL,
- 0,
- 2,
- 1,
- "https://www.another-origin.com/foo.dat"));
+ scoped_ptr<SpdySerializedFrame> stream2_syn(spdy_util_.ConstructSpdyPush(
+ NULL, 0, 2, 1, "https://www.another-origin.com/foo.dat"));
MockRead spdy_reads[] = {
CreateMockRead(*stream1_reply, 1, ASYNC),
@@ -7915,26 +7910,26 @@ TEST_P(HttpNetworkTransactionTest, SameOriginProxyPushCorrectness) {
scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
- scoped_ptr<SpdyFrame> stream1_syn(
+ scoped_ptr<SpdySerializedFrame> stream1_syn(
spdy_util_.ConstructSpdyGet(nullptr, 0, 1, LOWEST, false));
MockWrite spdy_writes[] = {
CreateMockWrite(*stream1_syn, 0, ASYNC),
};
- scoped_ptr<SpdyFrame> stream1_reply(
+ scoped_ptr<SpdySerializedFrame> stream1_reply(
spdy_util_.ConstructSpdyGetSynReply(nullptr, 0, 1));
- scoped_ptr<SpdyFrame> stream2_syn(spdy_util_.ConstructSpdyPush(
+ scoped_ptr<SpdySerializedFrame> stream2_syn(spdy_util_.ConstructSpdyPush(
nullptr, 0, 2, 1, "https://myproxy:70/foo.dat"));
- scoped_ptr<SpdyFrame> stream1_body(
+ scoped_ptr<SpdySerializedFrame> stream1_body(
spdy_util_.ConstructSpdyBodyFrame(1, true));
- scoped_ptr<SpdyFrame> stream2_reply(
+ scoped_ptr<SpdySerializedFrame> stream2_reply(
spdy_util_.ConstructSpdyGetSynReply(nullptr, 0, 1));
- scoped_ptr<SpdyFrame> stream2_body(
+ scoped_ptr<SpdySerializedFrame> stream2_body(
spdy_util_.ConstructSpdyBodyFrame(1, true));
MockRead spdy_reads[] = {
@@ -10686,12 +10681,14 @@ TEST_P(HttpNetworkTransactionTest, UseAlternateProtocolForNpnSpdy) {
ASSERT_TRUE(ssl.cert.get());
session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl);
- scoped_ptr<SpdyFrame> req(
+ scoped_ptr<SpdySerializedFrame> req(
spdy_util_.ConstructSpdyGet(nullptr, 0, 1, LOWEST, true));
MockWrite spdy_writes[] = {CreateMockWrite(*req, 0)};
- scoped_ptr<SpdyFrame> resp(spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1));
- scoped_ptr<SpdyFrame> data(spdy_util_.ConstructSpdyBodyFrame(1, true));
+ scoped_ptr<SpdySerializedFrame> resp(
+ spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1));
+ scoped_ptr<SpdySerializedFrame> data(
+ spdy_util_.ConstructSpdyBodyFrame(1, true));
MockRead spdy_reads[] = {
CreateMockRead(*resp, 1), CreateMockRead(*data, 2), MockRead(ASYNC, 0, 3),
};
@@ -10787,17 +10784,21 @@ TEST_P(HttpNetworkTransactionTest, AlternateProtocolWithSpdyLateBinding) {
ASSERT_TRUE(ssl.cert.get());
session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl);
- scoped_ptr<SpdyFrame> req1(
+ scoped_ptr<SpdySerializedFrame> req1(
spdy_util_.ConstructSpdyGet(nullptr, 0, 1, LOWEST, true));
- scoped_ptr<SpdyFrame> req2(
+ scoped_ptr<SpdySerializedFrame> req2(
spdy_util_.ConstructSpdyGet(nullptr, 0, 3, LOWEST, true));
MockWrite spdy_writes[] = {
CreateMockWrite(*req1, 0), CreateMockWrite(*req2, 1),
};
- scoped_ptr<SpdyFrame> resp1(spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1));
- scoped_ptr<SpdyFrame> data1(spdy_util_.ConstructSpdyBodyFrame(1, true));
- scoped_ptr<SpdyFrame> resp2(spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 3));
- scoped_ptr<SpdyFrame> data2(spdy_util_.ConstructSpdyBodyFrame(3, true));
+ scoped_ptr<SpdySerializedFrame> resp1(
+ spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1));
+ scoped_ptr<SpdySerializedFrame> data1(
+ spdy_util_.ConstructSpdyBodyFrame(1, true));
+ scoped_ptr<SpdySerializedFrame> resp2(
+ spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 3));
+ scoped_ptr<SpdySerializedFrame> data2(
+ spdy_util_.ConstructSpdyBodyFrame(3, true));
MockRead spdy_reads[] = {
CreateMockRead(*resp1, 2),
CreateMockRead(*data1, 3),
@@ -11038,7 +11039,7 @@ TEST_P(HttpNetworkTransactionTest,
ASSERT_TRUE(ssl.cert.get());
session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl);
- scoped_ptr<SpdyFrame> req(
+ scoped_ptr<SpdySerializedFrame> req(
spdy_util_.ConstructSpdyGet(nullptr, 0, 1, LOWEST, true));
MockWrite spdy_writes[] = {
MockWrite(ASYNC, 0,
@@ -11050,8 +11051,10 @@ TEST_P(HttpNetworkTransactionTest,
const char kCONNECTResponse[] = "HTTP/1.1 200 Connected\r\n\r\n";
- scoped_ptr<SpdyFrame> resp(spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1));
- scoped_ptr<SpdyFrame> data(spdy_util_.ConstructSpdyBodyFrame(1, true));
+ scoped_ptr<SpdySerializedFrame> resp(
+ spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1));
+ scoped_ptr<SpdySerializedFrame> data(
+ spdy_util_.ConstructSpdyBodyFrame(1, true));
MockRead spdy_reads[] = {
MockRead(ASYNC, 1, kCONNECTResponse), CreateMockRead(*resp.get(), 3),
CreateMockRead(*data.get(), 4), MockRead(SYNCHRONOUS, ERR_IO_PENDING, 5),
@@ -11148,12 +11151,14 @@ TEST_P(HttpNetworkTransactionTest,
ASSERT_TRUE(ssl.cert.get());
session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl);
- scoped_ptr<SpdyFrame> req(
+ scoped_ptr<SpdySerializedFrame> req(
spdy_util_.ConstructSpdyGet(nullptr, 0, 1, LOWEST, true));
MockWrite spdy_writes[] = {CreateMockWrite(*req, 0)};
- scoped_ptr<SpdyFrame> resp(spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1));
- scoped_ptr<SpdyFrame> data(spdy_util_.ConstructSpdyBodyFrame(1, true));
+ scoped_ptr<SpdySerializedFrame> resp(
+ spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1));
+ scoped_ptr<SpdySerializedFrame> data(
+ spdy_util_.ConstructSpdyBodyFrame(1, true));
MockRead spdy_reads[] = {
CreateMockRead(*resp, 1), CreateMockRead(*data, 2), MockRead(ASYNC, 0, 3),
};
@@ -11896,7 +11901,7 @@ TEST_P(HttpNetworkTransactionTest, SpdyPostNPNServerHangup) {
ssl.SetNextProto(GetProtocol());
session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl);
- scoped_ptr<SpdyFrame> req(
+ scoped_ptr<SpdySerializedFrame> req(
spdy_util_.ConstructSpdyGet(nullptr, 0, 1, LOWEST, true));
MockWrite spdy_writes[] = {CreateMockWrite(*req, 1)};
@@ -12005,10 +12010,12 @@ TEST_P(HttpNetworkTransactionTest, SpdyAlternateProtocolThroughProxy) {
// retry-http-when-alternate-protocol fails logic kicks in, which was more
// complicated to set up expectations for than the SPDY session.
- scoped_ptr<SpdyFrame> req(
+ scoped_ptr<SpdySerializedFrame> req(
spdy_util_.ConstructSpdyGet(nullptr, 0, 1, LOWEST, true));
- scoped_ptr<SpdyFrame> resp(spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1));
- scoped_ptr<SpdyFrame> data(spdy_util_.ConstructSpdyBodyFrame(1, true));
+ scoped_ptr<SpdySerializedFrame> resp(
+ spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1));
+ scoped_ptr<SpdySerializedFrame> data(
+ spdy_util_.ConstructSpdyBodyFrame(1, true));
MockWrite data_writes_2[] = {
// First connection attempt without Proxy-Authorization.
@@ -12464,12 +12471,14 @@ TEST_P(HttpNetworkTransactionTest, ProxyTunnelGetHangup) {
// Test for crbug.com/55424.
TEST_P(HttpNetworkTransactionTest, PreconnectWithExistingSpdySession) {
- scoped_ptr<SpdyFrame> req(
+ scoped_ptr<SpdySerializedFrame> req(
spdy_util_.ConstructSpdyGet("https://www.example.org", 1, LOWEST));
MockWrite spdy_writes[] = {CreateMockWrite(*req, 0)};
- scoped_ptr<SpdyFrame> resp(spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1));
- scoped_ptr<SpdyFrame> data(spdy_util_.ConstructSpdyBodyFrame(1, true));
+ scoped_ptr<SpdySerializedFrame> resp(
+ spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1));
+ scoped_ptr<SpdySerializedFrame> data(
+ spdy_util_.ConstructSpdyBodyFrame(1, true));
MockRead spdy_reads[] = {
CreateMockRead(*resp, 1), CreateMockRead(*data, 2), MockRead(ASYNC, 0, 3),
};
@@ -12887,21 +12896,21 @@ TEST_P(HttpNetworkTransactionTest, UseIPConnectionPooling) {
ssl.SetNextProto(GetProtocol());
session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl);
- scoped_ptr<SpdyFrame> host1_req(
+ scoped_ptr<SpdySerializedFrame> host1_req(
spdy_util_.ConstructSpdyGet("https://www.example.org", 1, LOWEST));
spdy_util_.UpdateWithStreamDestruction(1);
- scoped_ptr<SpdyFrame> host2_req(
+ scoped_ptr<SpdySerializedFrame> host2_req(
spdy_util_.ConstructSpdyGet("https://www.gmail.com", 3, LOWEST));
MockWrite spdy_writes[] = {
CreateMockWrite(*host1_req, 0), CreateMockWrite(*host2_req, 3),
};
- scoped_ptr<SpdyFrame> host1_resp(
+ scoped_ptr<SpdySerializedFrame> host1_resp(
spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1));
- scoped_ptr<SpdyFrame> host1_resp_body(
+ scoped_ptr<SpdySerializedFrame> host1_resp_body(
spdy_util_.ConstructSpdyBodyFrame(1, true));
- scoped_ptr<SpdyFrame> host2_resp(
+ scoped_ptr<SpdySerializedFrame> host2_resp(
spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 3));
- scoped_ptr<SpdyFrame> host2_resp_body(
+ scoped_ptr<SpdySerializedFrame> host2_resp_body(
spdy_util_.ConstructSpdyBodyFrame(3, true));
MockRead spdy_reads[] = {
CreateMockRead(*host1_resp, 1),
@@ -12985,21 +12994,21 @@ TEST_P(HttpNetworkTransactionTest, UseIPConnectionPoolingAfterResolution) {
ssl.SetNextProto(GetProtocol());
session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl);
- scoped_ptr<SpdyFrame> host1_req(
+ scoped_ptr<SpdySerializedFrame> host1_req(
spdy_util_.ConstructSpdyGet("https://www.example.org", 1, LOWEST));
spdy_util_.UpdateWithStreamDestruction(1);
- scoped_ptr<SpdyFrame> host2_req(
+ scoped_ptr<SpdySerializedFrame> host2_req(
spdy_util_.ConstructSpdyGet("https://www.gmail.com", 3, LOWEST));
MockWrite spdy_writes[] = {
CreateMockWrite(*host1_req, 0), CreateMockWrite(*host2_req, 3),
};
- scoped_ptr<SpdyFrame> host1_resp(
+ scoped_ptr<SpdySerializedFrame> host1_resp(
spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1));
- scoped_ptr<SpdyFrame> host1_resp_body(
+ scoped_ptr<SpdySerializedFrame> host1_resp_body(
spdy_util_.ConstructSpdyBodyFrame(1, true));
- scoped_ptr<SpdyFrame> host2_resp(
+ scoped_ptr<SpdySerializedFrame> host2_resp(
spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 3));
- scoped_ptr<SpdyFrame> host2_resp_body(
+ scoped_ptr<SpdySerializedFrame> host2_resp_body(
spdy_util_.ConstructSpdyBodyFrame(3, true));
MockRead spdy_reads[] = {
CreateMockRead(*host1_resp, 1),
@@ -13114,21 +13123,21 @@ TEST_P(HttpNetworkTransactionTest,
ssl.SetNextProto(GetProtocol());
session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl);
- scoped_ptr<SpdyFrame> host1_req(
+ scoped_ptr<SpdySerializedFrame> host1_req(
spdy_util_.ConstructSpdyGet("https://www.example.org", 1, LOWEST));
spdy_util_.UpdateWithStreamDestruction(1);
- scoped_ptr<SpdyFrame> host2_req(
+ scoped_ptr<SpdySerializedFrame> host2_req(
spdy_util_.ConstructSpdyGet("https://www.gmail.com", 3, LOWEST));
MockWrite spdy_writes[] = {
CreateMockWrite(*host1_req, 0), CreateMockWrite(*host2_req, 3),
};
- scoped_ptr<SpdyFrame> host1_resp(
+ scoped_ptr<SpdySerializedFrame> host1_resp(
spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1));
- scoped_ptr<SpdyFrame> host1_resp_body(
+ scoped_ptr<SpdySerializedFrame> host1_resp_body(
spdy_util_.ConstructSpdyBodyFrame(1, true));
- scoped_ptr<SpdyFrame> host2_resp(
+ scoped_ptr<SpdySerializedFrame> host2_resp(
spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 3));
- scoped_ptr<SpdyFrame> host2_resp_body(
+ scoped_ptr<SpdySerializedFrame> host2_resp_body(
spdy_util_.ConstructSpdyBodyFrame(3, true));
MockRead spdy_reads[] = {
CreateMockRead(*host1_resp, 1),
@@ -13202,15 +13211,17 @@ TEST_P(HttpNetworkTransactionTest, DoNotUseSpdySessionForHttp) {
const std::string http_url = "http://www.example.org:8080/";
// SPDY GET for HTTPS URL
- scoped_ptr<SpdyFrame> req1(
+ scoped_ptr<SpdySerializedFrame> req1(
spdy_util_.ConstructSpdyGet(https_url.c_str(), 1, LOWEST));
MockWrite writes1[] = {
CreateMockWrite(*req1, 0),
};
- scoped_ptr<SpdyFrame> resp1(spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1));
- scoped_ptr<SpdyFrame> body1(spdy_util_.ConstructSpdyBodyFrame(1, true));
+ scoped_ptr<SpdySerializedFrame> resp1(
+ spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1));
+ scoped_ptr<SpdySerializedFrame> body1(
+ spdy_util_.ConstructSpdyBodyFrame(1, true));
MockRead reads1[] = {CreateMockRead(*resp1, 1), CreateMockRead(*body1, 2),
MockRead(SYNCHRONOUS, ERR_IO_PENDING, 3)};
@@ -13303,12 +13314,12 @@ class AltSvcCertificateVerificationTest : public HttpNetworkTransactionTest {
url1.append(origin.host());
url1.append(":443");
- scoped_ptr<SpdyFrame> req0;
- scoped_ptr<SpdyFrame> req1;
- scoped_ptr<SpdyFrame> resp0;
- scoped_ptr<SpdyFrame> body0;
- scoped_ptr<SpdyFrame> resp1;
- scoped_ptr<SpdyFrame> body1;
+ scoped_ptr<SpdySerializedFrame> req0;
+ scoped_ptr<SpdySerializedFrame> req1;
+ scoped_ptr<SpdySerializedFrame> resp0;
+ scoped_ptr<SpdySerializedFrame> body0;
+ scoped_ptr<SpdySerializedFrame> resp1;
+ scoped_ptr<SpdySerializedFrame> body1;
std::vector<MockWrite> writes;
std::vector<MockRead> reads;
@@ -13723,11 +13734,11 @@ TEST_P(HttpNetworkTransactionTest, DoNotUseSpdySessionForHttpOverTunnel) {
// SPDY GET for HTTPS URL (through CONNECT tunnel)
const HostPortPair host_port_pair("www.example.org", 8080);
- scoped_ptr<SpdyFrame> connect(
+ scoped_ptr<SpdySerializedFrame> connect(
spdy_util_.ConstructSpdyConnect(NULL, 0, 1, LOWEST, host_port_pair));
- scoped_ptr<SpdyFrame> req1(
+ scoped_ptr<SpdySerializedFrame> req1(
spdy_util_wrapped.ConstructSpdyGet(https_url.c_str(), 1, LOWEST));
- scoped_ptr<SpdyFrame> wrapped_req1(
+ scoped_ptr<SpdySerializedFrame> wrapped_req1(
spdy_util_.ConstructWrappedSpdyFrame(req1, 1));
// SPDY GET for HTTP URL (through the proxy, but not the tunnel).
@@ -13737,7 +13748,7 @@ TEST_P(HttpNetworkTransactionTest, DoNotUseSpdySessionForHttpOverTunnel) {
req2_block[spdy_util_.GetHostKey()] = "www.example.org:8080";
req2_block[spdy_util_.GetSchemeKey()] = "http";
req2_block[spdy_util_.GetPathKey()] = "/";
- scoped_ptr<SpdyFrame> req2(
+ scoped_ptr<SpdySerializedFrame> req2(
spdy_util_.ConstructSpdySyn(3, req2_block, MEDIUM, true));
MockWrite writes1[] = {
@@ -13745,18 +13756,20 @@ TEST_P(HttpNetworkTransactionTest, DoNotUseSpdySessionForHttpOverTunnel) {
CreateMockWrite(*req2, 6),
};
- scoped_ptr<SpdyFrame> conn_resp(
+ scoped_ptr<SpdySerializedFrame> conn_resp(
spdy_util_.ConstructSpdyGetSynReply(nullptr, 0, 1));
- scoped_ptr<SpdyFrame> resp1(
+ scoped_ptr<SpdySerializedFrame> resp1(
spdy_util_wrapped.ConstructSpdyGetSynReply(nullptr, 0, 1));
- scoped_ptr<SpdyFrame> body1(
+ scoped_ptr<SpdySerializedFrame> body1(
spdy_util_wrapped.ConstructSpdyBodyFrame(1, true));
- scoped_ptr<SpdyFrame> wrapped_resp1(
+ scoped_ptr<SpdySerializedFrame> wrapped_resp1(
spdy_util_wrapped.ConstructWrappedSpdyFrame(resp1, 1));
- scoped_ptr<SpdyFrame> wrapped_body1(
+ scoped_ptr<SpdySerializedFrame> wrapped_body1(
spdy_util_wrapped.ConstructWrappedSpdyFrame(body1, 1));
- scoped_ptr<SpdyFrame> resp2(spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 3));
- scoped_ptr<SpdyFrame> body2(spdy_util_.ConstructSpdyBodyFrame(3, true));
+ scoped_ptr<SpdySerializedFrame> resp2(
+ spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 3));
+ scoped_ptr<SpdySerializedFrame> body2(
+ spdy_util_.ConstructSpdyBodyFrame(3, true));
MockRead reads1[] = {
CreateMockRead(*conn_resp, 1),
MockRead(ASYNC, ERR_IO_PENDING, 3),
@@ -13849,15 +13862,17 @@ TEST_P(HttpNetworkTransactionTest, DoNotUseSpdySessionIfCertDoesNotMatch) {
// SPDY GET for HTTP URL (through SPDY proxy)
scoped_ptr<SpdyHeaderBlock> headers(
spdy_util_.ConstructGetHeaderBlockForProxy("http://www.example.org/"));
- scoped_ptr<SpdyFrame> req1(
+ scoped_ptr<SpdySerializedFrame> req1(
spdy_util_.ConstructSpdySyn(1, *headers, LOWEST, true));
MockWrite writes1[] = {
CreateMockWrite(*req1, 0),
};
- scoped_ptr<SpdyFrame> resp1(spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1));
- scoped_ptr<SpdyFrame> body1(spdy_util_.ConstructSpdyBodyFrame(1, true));
+ scoped_ptr<SpdySerializedFrame> resp1(
+ spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1));
+ scoped_ptr<SpdySerializedFrame> body1(
+ spdy_util_.ConstructSpdyBodyFrame(1, true));
MockRead reads1[] = {
MockRead(ASYNC, ERR_IO_PENDING, 1), CreateMockRead(*resp1, 2),
CreateMockRead(*body1, 3), MockRead(ASYNC, OK, 4), // EOF
@@ -13872,16 +13887,17 @@ TEST_P(HttpNetworkTransactionTest, DoNotUseSpdySessionIfCertDoesNotMatch) {
data1.set_connect_data(connect_data1);
// SPDY GET for HTTPS URL (direct)
- scoped_ptr<SpdyFrame> req2(
+ scoped_ptr<SpdySerializedFrame> req2(
spdy_util_secure.ConstructSpdyGet(url2.c_str(), 1, MEDIUM));
MockWrite writes2[] = {
CreateMockWrite(*req2, 0),
};
- scoped_ptr<SpdyFrame> resp2(
+ scoped_ptr<SpdySerializedFrame> resp2(
spdy_util_secure.ConstructSpdyGetSynReply(NULL, 0, 1));
- scoped_ptr<SpdyFrame> body2(spdy_util_secure.ConstructSpdyBodyFrame(1, true));
+ scoped_ptr<SpdySerializedFrame> body2(
+ spdy_util_secure.ConstructSpdyBodyFrame(1, true));
MockRead reads2[] = {CreateMockRead(*resp2, 1), CreateMockRead(*body2, 2),
MockRead(ASYNC, OK, 3)};
@@ -13966,14 +13982,16 @@ TEST_P(HttpNetworkTransactionTest, ErrorSocketNotConnected) {
SequencedSocketData data1(reads1, arraysize(reads1), NULL, 0);
- scoped_ptr<SpdyFrame> req2(
+ scoped_ptr<SpdySerializedFrame> req2(
spdy_util_.ConstructSpdyGet(https_url.c_str(), 1, MEDIUM));
MockWrite writes2[] = {
CreateMockWrite(*req2, 0),
};
- scoped_ptr<SpdyFrame> resp2(spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1));
- scoped_ptr<SpdyFrame> body2(spdy_util_.ConstructSpdyBodyFrame(1, true));
+ scoped_ptr<SpdySerializedFrame> resp2(
+ spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1));
+ scoped_ptr<SpdySerializedFrame> body2(
+ spdy_util_.ConstructSpdyBodyFrame(1, true));
MockRead reads2[] = {
CreateMockRead(*resp2, 1),
CreateMockRead(*body2, 2),
@@ -14040,14 +14058,14 @@ TEST_P(HttpNetworkTransactionTest, CloseIdleSpdySessionToOpenNewOne) {
session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl1);
session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl2);
- scoped_ptr<SpdyFrame> host1_req(
+ scoped_ptr<SpdySerializedFrame> host1_req(
spdy_util_.ConstructSpdyGet("https://www.a.com", 1, DEFAULT_PRIORITY));
MockWrite spdy1_writes[] = {
CreateMockWrite(*host1_req, 0),
};
- scoped_ptr<SpdyFrame> host1_resp(
+ scoped_ptr<SpdySerializedFrame> host1_resp(
spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1));
- scoped_ptr<SpdyFrame> host1_resp_body(
+ scoped_ptr<SpdySerializedFrame> host1_resp_body(
spdy_util_.ConstructSpdyBodyFrame(1, true));
MockRead spdy1_reads[] = {
CreateMockRead(*host1_resp, 1), CreateMockRead(*host1_resp_body, 2),
@@ -14062,14 +14080,14 @@ TEST_P(HttpNetworkTransactionTest, CloseIdleSpdySessionToOpenNewOne) {
arraysize(spdy1_writes)));
session_deps_.socket_factory->AddSocketDataProvider(spdy1_data.get());
- scoped_ptr<SpdyFrame> host2_req(
+ scoped_ptr<SpdySerializedFrame> host2_req(
spdy_util_2.ConstructSpdyGet("https://www.b.com", 1, DEFAULT_PRIORITY));
MockWrite spdy2_writes[] = {
CreateMockWrite(*host2_req, 0),
};
- scoped_ptr<SpdyFrame> host2_resp(
+ scoped_ptr<SpdySerializedFrame> host2_resp(
spdy_util_2.ConstructSpdyGetSynReply(NULL, 0, 1));
- scoped_ptr<SpdyFrame> host2_resp_body(
+ scoped_ptr<SpdySerializedFrame> host2_resp_body(
spdy_util_2.ConstructSpdyBodyFrame(1, true));
MockRead spdy2_reads[] = {
CreateMockRead(*host2_resp, 1), CreateMockRead(*host2_resp_body, 2),
@@ -15934,9 +15952,10 @@ TEST_P(HttpNetworkTransactionTest, TokenBindingSpdy) {
ssl.SetNextProto(GetProtocol());
session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl);
- scoped_ptr<SpdyFrame> resp(
+ scoped_ptr<SpdySerializedFrame> resp(
spdy_util_.ConstructSpdyGetSynReply(nullptr, 0, 1));
- scoped_ptr<SpdyFrame> body(spdy_util_.ConstructSpdyBodyFrame(1, true));
+ scoped_ptr<SpdySerializedFrame> body(
+ spdy_util_.ConstructSpdyBodyFrame(1, true));
MockRead reads[] = {CreateMockRead(*resp), CreateMockRead(*body),
MockRead(ASYNC, ERR_IO_PENDING)};
StaticSocketDataProvider data(reads, arraysize(reads), nullptr, 0);
« no previous file with comments | « net/http/bidirectional_stream_unittest.cc ('k') | net/http/http_proxy_client_socket_pool_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698