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

Unified Diff: net/spdy/spdy_test_util_common.cc

Issue 208663003: Revert of Fix SPDY error-handling if the connection gets closed just after use. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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_test_util_common.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_test_util_common.cc
diff --git a/net/spdy/spdy_test_util_common.cc b/net/spdy/spdy_test_util_common.cc
index 22ff5f6f092679836856c3b3c40ee7b4981dfe64..66a6f8c3fdaede3222b5f7df21daf3fb727a61dc 100644
--- a/net/spdy/spdy_test_util_common.cc
+++ b/net/spdy/spdy_test_util_common.cc
@@ -540,12 +540,15 @@
EXPECT_EQ(OK, rv);
- base::WeakPtr<SpdySession> spdy_session =
+ base::WeakPtr<SpdySession> spdy_session;
+ EXPECT_EQ(
+ expected_status,
http_session->spdy_session_pool()->CreateAvailableSessionFromSocket(
- key, connection.Pass(), net_log, OK, is_secure);
- // Failure is reported asynchronously.
- EXPECT_TRUE(spdy_session != NULL);
- EXPECT_TRUE(HasSpdySession(http_session->spdy_session_pool(), key));
+ key, connection.Pass(), net_log, OK, &spdy_session,
+ is_secure));
+ EXPECT_EQ(expected_status == OK, spdy_session != NULL);
+ EXPECT_EQ(expected_status == OK,
+ HasSpdySession(http_session->spdy_session_pool(), key));
return spdy_session;
}
@@ -559,14 +562,14 @@
OK, false /* is_secure */);
}
-base::WeakPtr<SpdySession> TryCreateInsecureSpdySessionExpectingFailure(
+void TryCreateInsecureSpdySessionExpectingFailure(
const scoped_refptr<HttpNetworkSession>& http_session,
const SpdySessionKey& key,
Error expected_error,
const BoundNetLog& net_log) {
DCHECK_LT(expected_error, ERR_IO_PENDING);
- return CreateSpdySessionHelper(http_session, key, net_log,
- expected_error, false /* is_secure */);
+ CreateSpdySessionHelper(http_session, key, net_log,
+ expected_error, false /* is_secure */);
}
base::WeakPtr<SpdySession> CreateSecureSpdySession(
@@ -640,15 +643,17 @@
Error expected_status) {
EXPECT_NE(expected_status, ERR_IO_PENDING);
EXPECT_FALSE(HasSpdySession(pool, key));
+ base::WeakPtr<SpdySession> spdy_session;
scoped_ptr<ClientSocketHandle> handle(new ClientSocketHandle());
handle->SetSocket(scoped_ptr<StreamSocket>(new FakeSpdySessionClientSocket(
expected_status == OK ? ERR_IO_PENDING : expected_status)));
- base::WeakPtr<SpdySession> spdy_session =
+ EXPECT_EQ(
+ expected_status,
pool->CreateAvailableSessionFromSocket(
- key, handle.Pass(), BoundNetLog(), OK, true /* is_secure */);
- // Failure is reported asynchronously.
- EXPECT_TRUE(spdy_session != NULL);
- EXPECT_TRUE(HasSpdySession(pool, key));
+ key, handle.Pass(), BoundNetLog(), OK, &spdy_session,
+ true /* is_secure */));
+ EXPECT_EQ(expected_status == OK, spdy_session != NULL);
+ EXPECT_EQ(expected_status == OK, HasSpdySession(pool, key));
return spdy_session;
}
@@ -659,12 +664,11 @@
return CreateFakeSpdySessionHelper(pool, key, OK);
}
-base::WeakPtr<SpdySession> TryCreateFakeSpdySessionExpectingFailure(
- SpdySessionPool* pool,
- const SpdySessionKey& key,
- Error expected_error) {
+void TryCreateFakeSpdySessionExpectingFailure(SpdySessionPool* pool,
+ const SpdySessionKey& key,
+ Error expected_error) {
DCHECK_LT(expected_error, ERR_IO_PENDING);
- return CreateFakeSpdySessionHelper(pool, key, expected_error);
+ CreateFakeSpdySessionHelper(pool, key, expected_error);
}
SpdySessionPoolPeer::SpdySessionPoolPeer(SpdySessionPool* pool) : pool_(pool) {
« no previous file with comments | « net/spdy/spdy_test_util_common.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698