diff options
author | ttuttle@chromium.org <ttuttle@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-15 21:29:20 +0000 |
---|---|---|
committer | ttuttle@chromium.org <ttuttle@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-15 21:29:20 +0000 |
commit | c10b208557384ab926cfcef64cf02065e412d2ce (patch) | |
tree | 54defd8fad0b47da67016f4dfa97253626b5e2d9 /net/http | |
parent | eb5ba476096c25a8f27d87042e193ba84fa57def (diff) | |
download | chromium_src-c10b208557384ab926cfcef64cf02065e412d2ce.zip chromium_src-c10b208557384ab926cfcef64cf02065e412d2ce.tar.gz chromium_src-c10b208557384ab926cfcef64cf02065e412d2ce.tar.bz2 |
Merge framer-based Construct* functions to SpdyTestUtil
Merge several of the Construct* functions that just call through into the
framer into SpdyTestUtil.
BUG=226192
Review URL: https://chromiumcodereview.appspot.com/15112006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@200353 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http')
4 files changed, 40 insertions, 26 deletions
diff --git a/net/http/http_network_transaction_spdy2_unittest.cc b/net/http/http_network_transaction_spdy2_unittest.cc index 445e812..1b8b8bf 100644 --- a/net/http/http_network_transaction_spdy2_unittest.cc +++ b/net/http/http_network_transaction_spdy2_unittest.cc @@ -2812,7 +2812,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, HttpsProxySpdyConnectHttps) { scoped_ptr<SpdyFrame> wrapped_body( ConstructSpdyBodyFrame(1, "1234567890", 10, false)); scoped_ptr<SpdyFrame> window_update( - ConstructSpdyWindowUpdate(1, wrapped_get_resp->size())); + spdy_util_.ConstructSpdyWindowUpdate(1, wrapped_get_resp->size())); MockWrite spdy_writes[] = { CreateMockWrite(*connect, 1), @@ -2893,9 +2893,9 @@ TEST_F(HttpNetworkTransactionSpdy2Test, HttpsProxySpdyConnectSpdy) { scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); scoped_ptr<SpdyFrame> wrapped_body(ConstructWrappedSpdyFrame(body, 1)); scoped_ptr<SpdyFrame> window_update_get_resp( - ConstructSpdyWindowUpdate(1, wrapped_get_resp->size())); + spdy_util_.ConstructSpdyWindowUpdate(1, wrapped_get_resp->size())); scoped_ptr<SpdyFrame> window_update_body( - ConstructSpdyWindowUpdate(1, wrapped_body->size())); + spdy_util_.ConstructSpdyWindowUpdate(1, wrapped_body->size())); MockWrite spdy_writes[] = { CreateMockWrite(*connect, 1), @@ -2965,7 +2965,8 @@ TEST_F(HttpNetworkTransactionSpdy2Test, HttpsProxySpdyConnectFailure) { // CONNECT to www.google.com:443 via SPDY scoped_ptr<SpdyFrame> connect(ConstructSpdyConnect(NULL, 0, 1)); - scoped_ptr<SpdyFrame> get(ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); + scoped_ptr<SpdyFrame> get( + spdy_util_.ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); MockWrite spdy_writes[] = { CreateMockWrite(*connect, 1), @@ -3040,7 +3041,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, ConstructSpdyBodyFrame(1, resp1, strlen(resp1), false)); scoped_ptr<SpdyFrame> wrapped_body1(ConstructSpdyBodyFrame(1, "1", 1, false)); scoped_ptr<SpdyFrame> window_update( - ConstructSpdyWindowUpdate(1, wrapped_get_resp1->size())); + spdy_util_.ConstructSpdyWindowUpdate(1, wrapped_get_resp1->size())); // CONNECT to news.google.com:443 via SPDY. const char* const kConnectHeaders2[] = { @@ -3195,7 +3196,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, ConstructSpdyBodyFrame(1, resp1, strlen(resp1), false)); scoped_ptr<SpdyFrame> wrapped_body1(ConstructSpdyBodyFrame(1, "1", 1, false)); scoped_ptr<SpdyFrame> window_update( - ConstructSpdyWindowUpdate(1, wrapped_get_resp1->size())); + spdy_util_.ConstructSpdyWindowUpdate(1, wrapped_get_resp1->size())); // Fetch https://www.google.com/2 via HTTP. const char get2[] = "GET /2 HTTP/1.1\r\n" @@ -5668,7 +5669,8 @@ TEST_F(HttpNetworkTransactionSpdy2Test, RedirectOfHttpsConnectViaSpdyProxy) { request.load_flags = 0; scoped_ptr<SpdyFrame> conn(ConstructSpdyConnect(NULL, 0, 1)); - scoped_ptr<SpdyFrame> goaway(ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); + scoped_ptr<SpdyFrame> goaway( + spdy_util_.ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); MockWrite data_writes[] = { CreateMockWrite(*conn.get(), 0, SYNCHRONOUS), }; @@ -5774,7 +5776,8 @@ TEST_F(HttpNetworkTransactionSpdy2Test, request.load_flags = 0; scoped_ptr<SpdyFrame> conn(ConstructSpdyConnect(NULL, 0, 1)); - scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); + scoped_ptr<SpdyFrame> rst( + spdy_util_.ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); MockWrite data_writes[] = { CreateMockWrite(*conn.get(), 0, SYNCHRONOUS), CreateMockWrite(*rst.get(), 3, SYNCHRONOUS), @@ -5838,7 +5841,8 @@ TEST_F(HttpNetworkTransactionSpdy2Test, BasicAuthSpdyProxy) { // Since we have proxy, should try to establish tunnel. scoped_ptr<SpdyFrame> req(ConstructSpdyConnect(NULL, 0, 1)); - scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); + scoped_ptr<SpdyFrame> rst( + spdy_util_.ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); // After calling trans->RestartWithAuth(), this is the request we should // be issuing -- the final header line contains the credentials. @@ -6111,7 +6115,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, CrossOriginProxyPushCorrectness) { stream1_syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST, false)); scoped_ptr<SpdyFrame> push_rst( - ConstructSpdyRstStream(2, RST_STREAM_REFUSED_STREAM)); + spdy_util_.ConstructSpdyRstStream(2, RST_STREAM_REFUSED_STREAM)); MockWrite spdy_writes[] = { CreateMockWrite(*stream1_syn, 1, ASYNC), diff --git a/net/http/http_network_transaction_spdy3_unittest.cc b/net/http/http_network_transaction_spdy3_unittest.cc index 45f79e5..173b16f 100644 --- a/net/http/http_network_transaction_spdy3_unittest.cc +++ b/net/http/http_network_transaction_spdy3_unittest.cc @@ -2813,7 +2813,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, HttpsProxySpdyConnectHttps) { scoped_ptr<SpdyFrame> wrapped_body( ConstructSpdyBodyFrame(1, "1234567890", 10, false)); scoped_ptr<SpdyFrame> window_update( - ConstructSpdyWindowUpdate(1, wrapped_get_resp->size())); + spdy_util_.ConstructSpdyWindowUpdate(1, wrapped_get_resp->size())); MockWrite spdy_writes[] = { CreateMockWrite(*connect, 1), @@ -2894,9 +2894,9 @@ TEST_F(HttpNetworkTransactionSpdy3Test, HttpsProxySpdyConnectSpdy) { scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); scoped_ptr<SpdyFrame> wrapped_body(ConstructWrappedSpdyFrame(body, 1)); scoped_ptr<SpdyFrame> window_update_get_resp( - ConstructSpdyWindowUpdate(1, wrapped_get_resp->size())); + spdy_util_.ConstructSpdyWindowUpdate(1, wrapped_get_resp->size())); scoped_ptr<SpdyFrame> window_update_body( - ConstructSpdyWindowUpdate(1, wrapped_body->size())); + spdy_util_.ConstructSpdyWindowUpdate(1, wrapped_body->size())); MockWrite spdy_writes[] = { CreateMockWrite(*connect, 1), @@ -2966,7 +2966,8 @@ TEST_F(HttpNetworkTransactionSpdy3Test, HttpsProxySpdyConnectFailure) { // CONNECT to www.google.com:443 via SPDY scoped_ptr<SpdyFrame> connect(ConstructSpdyConnect(NULL, 0, 1)); - scoped_ptr<SpdyFrame> get(ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); + scoped_ptr<SpdyFrame> get( + spdy_util_.ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); MockWrite spdy_writes[] = { CreateMockWrite(*connect, 1), @@ -3041,7 +3042,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, ConstructSpdyBodyFrame(1, resp1, strlen(resp1), false)); scoped_ptr<SpdyFrame> wrapped_body1(ConstructSpdyBodyFrame(1, "1", 1, false)); scoped_ptr<SpdyFrame> window_update( - ConstructSpdyWindowUpdate(1, wrapped_get_resp1->size())); + spdy_util_.ConstructSpdyWindowUpdate(1, wrapped_get_resp1->size())); // CONNECT to news.google.com:443 via SPDY. const char* const kConnectHeaders2[] = { @@ -3196,7 +3197,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, ConstructSpdyBodyFrame(1, resp1, strlen(resp1), false)); scoped_ptr<SpdyFrame> wrapped_body1(ConstructSpdyBodyFrame(1, "1", 1, false)); scoped_ptr<SpdyFrame> window_update( - ConstructSpdyWindowUpdate(1, wrapped_get_resp1->size())); + spdy_util_.ConstructSpdyWindowUpdate(1, wrapped_get_resp1->size())); // Fetch https://www.google.com/2 via HTTP. const char get2[] = "GET /2 HTTP/1.1\r\n" @@ -5654,7 +5655,8 @@ TEST_F(HttpNetworkTransactionSpdy3Test, RedirectOfHttpsConnectViaSpdyProxy) { request.load_flags = 0; scoped_ptr<SpdyFrame> conn(ConstructSpdyConnect(NULL, 0, 1)); - scoped_ptr<SpdyFrame> goaway(ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); + scoped_ptr<SpdyFrame> goaway( + spdy_util_.ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); MockWrite data_writes[] = { CreateMockWrite(*conn.get(), 0, SYNCHRONOUS), }; @@ -5760,7 +5762,8 @@ TEST_F(HttpNetworkTransactionSpdy3Test, request.load_flags = 0; scoped_ptr<SpdyFrame> conn(ConstructSpdyConnect(NULL, 0, 1)); - scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); + scoped_ptr<SpdyFrame> rst( + spdy_util_.ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); MockWrite data_writes[] = { CreateMockWrite(*conn.get(), 0, SYNCHRONOUS), CreateMockWrite(*rst.get(), 3, SYNCHRONOUS), @@ -5824,7 +5827,8 @@ TEST_F(HttpNetworkTransactionSpdy3Test, BasicAuthSpdyProxy) { // Since we have proxy, should try to establish tunnel. scoped_ptr<SpdyFrame> req(ConstructSpdyConnect(NULL, 0, 1)); - scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); + scoped_ptr<SpdyFrame> rst( + spdy_util_.ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); // After calling trans->RestartWithAuth(), this is the request we should // be issuing -- the final header line contains the credentials. @@ -6096,7 +6100,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, CrossOriginProxyPushCorrectness) { stream1_syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST, false)); scoped_ptr<SpdyFrame> push_rst( - ConstructSpdyRstStream(2, RST_STREAM_REFUSED_STREAM)); + spdy_util_.ConstructSpdyRstStream(2, RST_STREAM_REFUSED_STREAM)); MockWrite spdy_writes[] = { CreateMockWrite(*stream1_syn, 1, ASYNC), diff --git a/net/http/http_proxy_client_socket_pool_spdy2_unittest.cc b/net/http/http_proxy_client_socket_pool_spdy2_unittest.cc index ae40ab0..75393d1 100644 --- a/net/http/http_proxy_client_socket_pool_spdy2_unittest.cc +++ b/net/http/http_proxy_client_socket_pool_spdy2_unittest.cc @@ -248,7 +248,8 @@ TEST_P(HttpProxyClientSocketPoolSpdy2Test, NeedAuth) { MockRead(ASYNC, 4, "0123456789"), }; scoped_ptr<SpdyFrame> req(ConstructSpdyConnect(NULL, 0, 1)); - scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); + scoped_ptr<SpdyFrame> rst( + spdy_util_.ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); MockWrite spdy_writes[] = { CreateMockWrite(*req, 0, ASYNC), CreateMockWrite(*rst, 2, ASYNC), @@ -494,7 +495,8 @@ TEST_P(HttpProxyClientSocketPoolSpdy2Test, TunnelSetupError) { }; scoped_ptr<SpdyFrame> req(ConstructSpdyConnect(kAuthHeaders, kAuthHeadersSize, 1)); - scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); + scoped_ptr<SpdyFrame> rst( + spdy_util_.ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); MockWrite spdy_writes[] = { CreateMockWrite(*req, 0, ASYNC), CreateMockWrite(*rst, 2, ASYNC), @@ -544,7 +546,8 @@ TEST_P(HttpProxyClientSocketPoolSpdy2Test, TunnelSetupRedirect) { }; scoped_ptr<SpdyFrame> req( ConstructSpdyConnect(kAuthHeaders, kAuthHeadersSize, 1)); - scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); + scoped_ptr<SpdyFrame> rst( + spdy_util_.ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); MockWrite spdy_writes[] = { CreateMockWrite(*req, 0, ASYNC), diff --git a/net/http/http_proxy_client_socket_pool_spdy3_unittest.cc b/net/http/http_proxy_client_socket_pool_spdy3_unittest.cc index 9b87544..e90dbb9 100644 --- a/net/http/http_proxy_client_socket_pool_spdy3_unittest.cc +++ b/net/http/http_proxy_client_socket_pool_spdy3_unittest.cc @@ -248,7 +248,8 @@ TEST_P(HttpProxyClientSocketPoolSpdy3Test, NeedAuth) { MockRead(ASYNC, 4, "0123456789"), }; scoped_ptr<SpdyFrame> req(ConstructSpdyConnect(NULL, 0, 1)); - scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); + scoped_ptr<SpdyFrame> rst( + spdy_util_.ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); MockWrite spdy_writes[] = { CreateMockWrite(*req, 0, ASYNC), CreateMockWrite(*rst, 2, ASYNC), @@ -495,7 +496,8 @@ TEST_P(HttpProxyClientSocketPoolSpdy3Test, TunnelSetupError) { }; scoped_ptr<SpdyFrame> req(ConstructSpdyConnect(kAuthHeaders, kAuthHeadersSize, 1)); - scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); + scoped_ptr<SpdyFrame> rst( + spdy_util_.ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); MockWrite spdy_writes[] = { CreateMockWrite(*req, 0, ASYNC), CreateMockWrite(*rst, 2, ASYNC), @@ -545,7 +547,8 @@ TEST_P(HttpProxyClientSocketPoolSpdy3Test, TunnelSetupRedirect) { }; scoped_ptr<SpdyFrame> req( ConstructSpdyConnect(kAuthHeaders, kAuthHeadersSize, 1)); - scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); + scoped_ptr<SpdyFrame> rst( + spdy_util_.ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); MockWrite spdy_writes[] = { CreateMockWrite(*req, 0, ASYNC), |