From 23e482282908db700994bb3e35a6e08b926852c4 Mon Sep 17 00:00:00 2001 From: "akalin@chromium.org" Date: Fri, 14 Jun 2013 16:08:02 +0000 Subject: Merge the HttpNetworkTransaction tests and parametrize them on a NextProto Add (partial) support for SPDY/3.1 and SPDY/4a2 for HttpNetworkTransaction unit tests. BUG=226192 Review URL: https://chromiumcodereview.appspot.com/17028007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@206424 0039d316-1c4b-4281-b951-d872f2087c98 --- net/spdy/spdy_test_util_common.cc | 16 ++++++++++++++++ net/spdy/spdy_test_util_common.h | 7 +++++++ 2 files changed, 23 insertions(+) (limited to 'net/spdy') diff --git a/net/spdy/spdy_test_util_common.cc b/net/spdy/spdy_test_util_common.cc index 8ad49cc..ae9cc01 100644 --- a/net/spdy/spdy_test_util_common.cc +++ b/net/spdy/spdy_test_util_common.cc @@ -562,6 +562,22 @@ scoped_ptr SpdyTestUtil::ConstructGetHeaderBlock( return header_block.Pass(); } +scoped_ptr SpdyTestUtil::ConstructGetHeaderBlockForProxy( + base::StringPiece url) const { + std::string scheme, host, path; + ParseUrl(url.data(), &scheme, &host, &path); + const char* const headers[] = { + GetMethodKey(), "GET", + GetPathKey(), is_spdy2() ? url.data() : path.c_str(), + GetHostKey(), host.c_str(), + GetSchemeKey(), scheme.c_str(), + GetVersionKey(), "HTTP/1.1" + }; + scoped_ptr header_block(new SpdyHeaderBlock()); + AppendToHeaderBlock(headers, arraysize(headers) / 2, header_block.get()); + return header_block.Pass(); +} + scoped_ptr SpdyTestUtil::ConstructPostHeaderBlock( base::StringPiece url, int64 content_length) const { diff --git a/net/spdy/spdy_test_util_common.h b/net/spdy/spdy_test_util_common.h index 5595d9c..0a685d0 100644 --- a/net/spdy/spdy_test_util_common.h +++ b/net/spdy/spdy_test_util_common.h @@ -257,6 +257,8 @@ class SpdyTestUtil { scoped_ptr ConstructGetHeaderBlock( base::StringPiece url) const; + scoped_ptr ConstructGetHeaderBlockForProxy( + base::StringPiece url) const; scoped_ptr ConstructPostHeaderBlock( base::StringPiece url, int64 content_length) const; @@ -352,6 +354,11 @@ class SpdyTestUtil { SpdyStreamId stream_id, RequestPriority request_priority) const; + SpdyFrame* ConstructSpdyGetForProxy(const char* const url, + bool compressed, + SpdyStreamId stream_id, + RequestPriority request_priority) const; + // Constructs a standard SPDY GET SYN frame, optionally compressed. // |extra_headers| are the extra header-value pairs, which typically // will vary the most between calls. If |direct| is false, the -- cgit v1.1