summaryrefslogtreecommitdiffstats
path: root/net/spdy/spdy_test_util.cc
diff options
context:
space:
mode:
authorerikchen@google.com <erikchen@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-18 18:33:27 +0000
committererikchen@google.com <erikchen@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-18 18:33:27 +0000
commit3b78284325c04007a09ba8b47ac2980997e39e1d (patch)
tree10c1d14f07aa4c43f133820d7cf561071838e66e /net/spdy/spdy_test_util.cc
parentcce6f1b3b3d54334bf116084fadfe5b828c87227 (diff)
downloadchromium_src-3b78284325c04007a09ba8b47ac2980997e39e1d.zip
chromium_src-3b78284325c04007a09ba8b47ac2980997e39e1d.tar.gz
chromium_src-3b78284325c04007a09ba8b47ac2980997e39e1d.tar.bz2
Added a new MockSocket that enforces ordering of reads/writes.
Re-enabled two broken SPDY tests, using new MockSocket. All SPDY tests should eventually convert to using this new object. TEST=none BUG=none Review URL: http://codereview.chromium.org/3179016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56560 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/spdy/spdy_test_util.cc')
-rw-r--r--net/spdy/spdy_test_util.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/net/spdy/spdy_test_util.cc b/net/spdy/spdy_test_util.cc
index 35e9968..f57fb18 100644
--- a/net/spdy/spdy_test_util.cc
+++ b/net/spdy/spdy_test_util.cc
@@ -701,8 +701,13 @@ MockWrite CreateMockWrite(const spdy::SpdyFrame& req) {
// Create a MockWrite from the given SpdyFrame and sequence number.
MockWrite CreateMockWrite(const spdy::SpdyFrame& req, int seq) {
+ return CreateMockWrite(req, seq, true);
+}
+
+// Create a MockWrite from the given SpdyFrame and sequence number.
+MockWrite CreateMockWrite(const spdy::SpdyFrame& req, int seq, bool async) {
return MockWrite(
- true, req.data(), req.length() + spdy::SpdyFrame::size(), seq);
+ async, req.data(), req.length() + spdy::SpdyFrame::size(), seq);
}
// Create a MockRead from the given SpdyFrame.
@@ -713,8 +718,13 @@ MockRead CreateMockRead(const spdy::SpdyFrame& resp) {
// Create a MockRead from the given SpdyFrame and sequence number.
MockRead CreateMockRead(const spdy::SpdyFrame& resp, int seq) {
+ return CreateMockRead(resp, seq, true);
+}
+
+// Create a MockRead from the given SpdyFrame and sequence number.
+MockRead CreateMockRead(const spdy::SpdyFrame& resp, int seq, bool async) {
return MockRead(
- true, resp.data(), resp.length() + spdy::SpdyFrame::size(), seq);
+ async, resp.data(), resp.length() + spdy::SpdyFrame::size(), seq);
}
// Combines the given SpdyFrames into the given char array and returns