summaryrefslogtreecommitdiffstats
path: root/net/spdy/spdy_proxy_client_socket_unittest.cc
diff options
context:
space:
mode:
authorakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-16 21:34:00 +0000
committerakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-16 21:34:00 +0000
commit63cf10d7652388b9dd9d45f5648cbfaaa63f2232 (patch)
tree3d747f622ea8322ddecbe3eb99af9948a76c2e26 /net/spdy/spdy_proxy_client_socket_unittest.cc
parent3699af9fae872b8b9deee04cc7ccd862b82d464e (diff)
downloadchromium_src-63cf10d7652388b9dd9d45f5648cbfaaa63f2232.zip
chromium_src-63cf10d7652388b9dd9d45f5648cbfaaa63f2232.tar.gz
chromium_src-63cf10d7652388b9dd9d45f5648cbfaaa63f2232.tar.bz2
[SPDY] Refactor SpdySession state machine
Represent a SpdySession's state by three variables of type: AvailabilityState, ReadState (the old State type), and WriteState. Make some important functions, including the BufferedSpdyWriter callbacks, do nothing if availability_state_ == STATE_CLOSED. Rename the current state machine from DoLoop etc. to DoReadLoop. Refactor the write state machine to be parallel to the read state machine. Keep track of the number of bytes read without yielding in DoReadLoop itself. This fixes a slight bug where the counter isn't reset if the loop yields due to ERR_IO_PENDING being returned. The new write state machine (DoWriteLoop, etc.) has almost the same behavior as the old one, except if a write completes asynchronously the write loop is immediately re-entered instead of via a posted task. Fix tests to match new write loop behavior. BUG=255701 R=rch@chromium.org, rtenneti@chromium.org Review URL: https://codereview.chromium.org/18143005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211852 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/spdy/spdy_proxy_client_socket_unittest.cc')
-rw-r--r--net/spdy/spdy_proxy_client_socket_unittest.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/spdy/spdy_proxy_client_socket_unittest.cc b/net/spdy/spdy_proxy_client_socket_unittest.cc
index 5af767b..95ca4b5 100644
--- a/net/spdy/spdy_proxy_client_socket_unittest.cc
+++ b/net/spdy/spdy_proxy_client_socket_unittest.cc
@@ -1176,7 +1176,7 @@ TEST_P(SpdyProxyClientSocketTest, WritePendingOnClose) {
scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame());
MockWrite writes[] = {
CreateMockWrite(*conn, 0, SYNCHRONOUS),
- MockWrite(ASYNC, ERR_IO_PENDING, 2),
+ MockWrite(ASYNC, ERR_ABORTED, 2),
};
scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame());
@@ -1267,7 +1267,7 @@ TEST_P(SpdyProxyClientSocketTest, RstWithReadAndWritePending) {
scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame());
MockWrite writes[] = {
CreateMockWrite(*conn, 0, SYNCHRONOUS),
- MockWrite(ASYNC, ERR_IO_PENDING, 2),
+ MockWrite(ASYNC, ERR_ABORTED, 2),
};
scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame());
@@ -1390,7 +1390,7 @@ TEST_P(SpdyProxyClientSocketTest, RstWithReadAndWritePendingDelete) {
scoped_ptr<SpdyFrame> conn(ConstructConnectRequestFrame());
MockWrite writes[] = {
CreateMockWrite(*conn, 0, SYNCHRONOUS),
- MockWrite(ASYNC, ERR_IO_PENDING, 2),
+ MockWrite(ASYNC, ERR_ABORTED, 2),
};
scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame());