diff options
author | mlloyd@chromium.org <mlloyd@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-12 19:29:40 +0000 |
---|---|---|
committer | mlloyd@chromium.org <mlloyd@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-12 19:29:40 +0000 |
commit | fabde3e594a91bd631691457826a0e16f64ca2a1 (patch) | |
tree | e1dd13e550e987fe2063efc5ff719222c3fc5490 /net/spdy/spdy_session_unittest.cc | |
parent | 6980dd1bd7e7c224e8b70a1c36541303be7093db (diff) | |
download | chromium_src-fabde3e594a91bd631691457826a0e16f64ca2a1.zip chromium_src-fabde3e594a91bd631691457826a0e16f64ca2a1.tar.gz chromium_src-fabde3e594a91bd631691457826a0e16f64ca2a1.tar.bz2 |
Remove hex frames from spdy_session_unittest.cc
BUG=None
TEST=net_unittests pass
Review URL: http://codereview.chromium.org/2896004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52118 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/spdy/spdy_session_unittest.cc')
-rw-r--r-- | net/spdy/spdy_session_unittest.cc | 37 |
1 files changed, 10 insertions, 27 deletions
diff --git a/net/spdy/spdy_session_unittest.cc b/net/spdy/spdy_session_unittest.cc index 1df4cbb..195fb10 100644 --- a/net/spdy/spdy_session_unittest.cc +++ b/net/spdy/spdy_session_unittest.cc @@ -99,20 +99,14 @@ TEST_F(SpdySessionTest, SpdyIOBuffer) { } } -static const unsigned char kGoAway[] = { - 0x80, 0x01, 0x00, 0x07, // header - 0x00, 0x00, 0x00, 0x04, // flags, len - 0x00, 0x00, 0x00, 0x00, // last-accepted-stream-id -}; - TEST_F(SpdySessionTest, GoAway) { SessionDependencies session_deps; session_deps.host_resolver->set_synchronous_mode(true); MockConnect connect_data(false, OK); + scoped_ptr<spdy::SpdyFrame> goaway(ConstructSpdyGoAway()); MockRead reads[] = { - MockRead(false, reinterpret_cast<const char*>(kGoAway), - arraysize(kGoAway)), + CreateMockRead(*goaway), MockRead(false, 0, 0) // EOF }; StaticSocketDataProvider data(reads, arraysize(reads), NULL, 0); @@ -160,35 +154,24 @@ TEST_F(SpdySessionTest, GoAway) { session2 = NULL; } -// kPush is a server-issued SYN_STREAM with stream id 2, and -// associated stream id 1. It also includes 3 headers of path, -// status, and HTTP version. -static const uint8 kPush[] = { - 0x80, 0x01, 0x00, 0x01, // SYN_STREAM for SPDY v1. - 0x00, 0x00, 0x00, 0x3b, // No flags 59 bytes after this 8 byte header. - 0x00, 0x00, 0x00, 0x02, // Stream ID of 2 - 0x00, 0x00, 0x00, 0x01, // Associate Stream ID of 1 - 0x00, 0x00, 0x00, 0x03, // Priority 0, 3 name/value pairs in block below. - 0x00, 0x04, 'p', 'a', 't', 'h', - 0x00, 0x07, '/', 'f', 'o', 'o', '.', 'j', 's', - 0x00, 0x06, 's', 't', 'a', 't', 'u', 's', - 0x00, 0x03, '2', '0', '0', - 0x00, 0x07, 'v', 'e', 'r', 's', 'i', 'o', 'n', - 0x00, 0x08, 'H', 'T', 'T', 'P', '/', '1', '.', '1', -}; - } // namespace TEST_F(SpdySessionTest, GetActivePushStream) { + spdy::SpdyFramer framer; SpdySessionTest::TurnOffCompression(); SessionDependencies session_deps; session_deps.host_resolver->set_synchronous_mode(true); MockConnect connect_data(false, OK); + spdy::SpdyHeaderBlock headers; + headers["path"] = "/foo.js"; + headers["status"] = "200"; + headers["version"] = "HTTP/1.1"; + scoped_ptr<spdy::SpdyFrame> push_syn(framer.CreateSynStream( + 2, 1, 0, spdy::CONTROL_FLAG_NONE, false, &headers)); MockRead reads[] = { - MockRead(false, reinterpret_cast<const char*>(kPush), - arraysize(kPush)), + CreateMockRead(*push_syn), MockRead(true, ERR_IO_PENDING, 0) // EOF }; StaticSocketDataProvider data(reads, arraysize(reads), NULL, 0); |