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

Unified Diff: net/spdy/spdy_network_transaction_unittest.cc

Issue 357513003: Stop using SpdySynStreamIR for SPDY 4. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: WebSocket test fix. Created 6 years, 6 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/spdy/spdy_framer_test.cc ('k') | net/spdy/spdy_proxy_client_socket_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_network_transaction_unittest.cc
diff --git a/net/spdy/spdy_network_transaction_unittest.cc b/net/spdy/spdy_network_transaction_unittest.cc
index a1971ecceea89ec7516118e9f2cf73fb1e56da7a..6b4c050f1b5d562cc7dce7bb61ddb5d18730fe39 100644
--- a/net/spdy/spdy_network_transaction_unittest.cc
+++ b/net/spdy/spdy_network_transaction_unittest.cc
@@ -1677,24 +1677,10 @@ TEST_P(SpdyNetworkTransactionTest, Put) {
request.method = "PUT";
request.url = GURL("http://www.google.com/");
- const SpdyHeaderInfo kSynStartHeader = {
- SYN_STREAM, // Kind = Syn
- 1, // Stream ID
- 0, // Associated stream ID
- ConvertRequestPriorityToSpdyPriority(
- LOWEST, spdy_util_.spdy_version()),
- kSpdyCredentialSlotUnused,
- CONTROL_FLAG_FIN, // Control Flags
- false, // Compressed
- RST_STREAM_INVALID, // Status
- NULL, // Data
- 0, // Length
- DATA_FLAG_NONE // Data Flags
- };
scoped_ptr<SpdyHeaderBlock> put_headers(
spdy_util_.ConstructPutHeaderBlock("http://www.google.com", 0));
- scoped_ptr<SpdyFrame> req(spdy_util_.ConstructSpdyFrame(
- kSynStartHeader, put_headers.Pass()));
+ scoped_ptr<SpdyFrame> req(
+ spdy_util_.ConstructSpdySyn(1, *put_headers, LOWEST, false, true));
MockWrite writes[] = {
CreateMockWrite(*req),
};
@@ -1725,24 +1711,10 @@ TEST_P(SpdyNetworkTransactionTest, Head) {
request.method = "HEAD";
request.url = GURL("http://www.google.com/");
- const SpdyHeaderInfo kSynStartHeader = {
- SYN_STREAM, // Kind = Syn
- 1, // Stream ID
- 0, // Associated stream ID
- ConvertRequestPriorityToSpdyPriority(
- LOWEST, spdy_util_.spdy_version()),
- kSpdyCredentialSlotUnused,
- CONTROL_FLAG_FIN, // Control Flags
- false, // Compressed
- RST_STREAM_INVALID, // Status
- NULL, // Data
- 0, // Length
- DATA_FLAG_NONE // Data Flags
- };
scoped_ptr<SpdyHeaderBlock> head_headers(
spdy_util_.ConstructHeadHeaderBlock("http://www.google.com", 0));
- scoped_ptr<SpdyFrame> req(spdy_util_.ConstructSpdyFrame(
- kSynStartHeader, head_headers.Pass()));
+ scoped_ptr<SpdyFrame> req(
+ spdy_util_.ConstructSpdySyn(1, *head_headers, LOWEST, false, true));
MockWrite writes[] = {
CreateMockWrite(*req),
};
@@ -1980,13 +1952,10 @@ TEST_P(SpdyNetworkTransactionTest, NullPost) {
// When request.upload_data_stream is NULL for post, content-length is
// expected to be 0.
- SpdySynStreamIR syn_ir(1);
- syn_ir.set_name_value_block(
- *spdy_util_.ConstructPostHeaderBlock(kRequestUrl, 0));
- syn_ir.set_fin(true); // No body.
- syn_ir.set_priority(ConvertRequestPriorityToSpdyPriority(
- LOWEST, spdy_util_.spdy_version()));
- scoped_ptr<SpdyFrame> req(framer.SerializeFrame(syn_ir));
+ scoped_ptr<SpdyHeaderBlock> req_block(
+ spdy_util_.ConstructPostHeaderBlock(kRequestUrl, 0));
+ scoped_ptr<SpdyFrame> req(
+ spdy_util_.ConstructSpdySyn(1, *req_block, LOWEST, false, true));
MockWrite writes[] = {
CreateMockWrite(*req),
@@ -2027,13 +1996,10 @@ TEST_P(SpdyNetworkTransactionTest, EmptyPost) {
const uint64 kContentLength = 0;
- SpdySynStreamIR syn_ir(1);
- syn_ir.set_name_value_block(
- *spdy_util_.ConstructPostHeaderBlock(kRequestUrl, kContentLength));
- syn_ir.set_fin(true); // No body.
- syn_ir.set_priority(ConvertRequestPriorityToSpdyPriority(
- LOWEST, spdy_util_.spdy_version()));
- scoped_ptr<SpdyFrame> req(framer.SerializeFrame(syn_ir));
+ scoped_ptr<SpdyHeaderBlock> req_block(
+ spdy_util_.ConstructPostHeaderBlock(kRequestUrl, kContentLength));
+ scoped_ptr<SpdyFrame> req(
+ spdy_util_.ConstructSpdySyn(1, *req_block, LOWEST, false, true));
MockWrite writes[] = {
CreateMockWrite(*req),
@@ -2484,7 +2450,6 @@ TEST_P(SpdyNetworkTransactionTest, DeleteSessionOnReadCallback) {
// Send a spdy request to www.google.com that gets redirected to www.foo.com.
TEST_P(SpdyNetworkTransactionTest, RedirectGetRequest) {
- const SpdyHeaderInfo kSynStartHeader = spdy_util_.MakeSpdyHeader(SYN_STREAM);
scoped_ptr<SpdyHeaderBlock> headers(
spdy_util_.ConstructGetHeaderBlock("http://www.google.com/"));
(*headers)["user-agent"] = "";
@@ -2495,10 +2460,10 @@ TEST_P(SpdyNetworkTransactionTest, RedirectGetRequest) {
(*headers2)["accept-encoding"] = "gzip,deflate";
// Setup writes/reads to www.google.com
- scoped_ptr<SpdyFrame> req(spdy_util_.ConstructSpdyFrame(
- kSynStartHeader, headers.Pass()));
- scoped_ptr<SpdyFrame> req2(spdy_util_.ConstructSpdyFrame(
- kSynStartHeader, headers2.Pass()));
+ scoped_ptr<SpdyFrame> req(
+ spdy_util_.ConstructSpdySyn(1, *headers, LOWEST, false, true));
+ scoped_ptr<SpdyFrame> req2(
+ spdy_util_.ConstructSpdySyn(1, *headers2, LOWEST, false, true));
scoped_ptr<SpdyFrame> resp(spdy_util_.ConstructSpdyGetSynReplyRedirect(1));
MockWrite writes[] = {
CreateMockWrite(*req, 1),
@@ -2563,8 +2528,6 @@ TEST_P(SpdyNetworkTransactionTest, RedirectGetRequest) {
// Send a spdy request to www.google.com. Get a pushed stream that redirects to
// www.foo.com.
TEST_P(SpdyNetworkTransactionTest, RedirectServerPush) {
- const SpdyHeaderInfo kSynStartHeader = spdy_util_.MakeSpdyHeader(SYN_STREAM);
-
scoped_ptr<SpdyHeaderBlock> headers(
spdy_util_.ConstructGetHeaderBlock("http://www.google.com/"));
(*headers)["user-agent"] = "";
@@ -2572,7 +2535,7 @@ TEST_P(SpdyNetworkTransactionTest, RedirectServerPush) {
// Setup writes/reads to www.google.com
scoped_ptr<SpdyFrame> req(
- spdy_util_.ConstructSpdyFrame(kSynStartHeader, headers.Pass()));
+ spdy_util_.ConstructSpdySyn(1, *headers, LOWEST, false, true));
scoped_ptr<SpdyFrame> resp(spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1));
scoped_ptr<SpdyFrame> rep(
spdy_util_.ConstructSpdyPush(NULL,
@@ -2603,7 +2566,7 @@ TEST_P(SpdyNetworkTransactionTest, RedirectServerPush) {
(*headers2)["user-agent"] = "";
(*headers2)["accept-encoding"] = "gzip,deflate";
scoped_ptr<SpdyFrame> req2(
- spdy_util_.ConstructSpdyFrame(kSynStartHeader, headers2.Pass()));
+ spdy_util_.ConstructSpdySyn(1, *headers2, LOWEST, false, true));
scoped_ptr<SpdyFrame> resp2(spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1));
scoped_ptr<SpdyFrame> body2(spdy_util_.ConstructSpdyBodyFrame(1, true));
MockWrite writes2[] = {
« no previous file with comments | « net/spdy/spdy_framer_test.cc ('k') | net/spdy/spdy_proxy_client_socket_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698