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

Unified Diff: net/spdy/spdy_session_unittest.cc

Issue 200723004: 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_session_pool.cc ('k') | net/spdy/spdy_test_util_common.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_session_unittest.cc
diff --git a/net/spdy/spdy_session_unittest.cc b/net/spdy/spdy_session_unittest.cc
index 0e8b3707e822b8ae3c0ec5439d761a6685638156..a5d9292741c26ca45ba8f9c1a543b9a8a8da22ba 100644
--- a/net/spdy/spdy_session_unittest.cc
+++ b/net/spdy/spdy_session_unittest.cc
@@ -190,8 +190,12 @@ INSTANTIATE_TEST_CASE_P(
TEST_P(SpdySessionTest, InitialReadError) {
CreateDeterministicNetworkSession();
- TryCreateFakeSpdySessionExpectingFailure(
+ base::WeakPtr<SpdySession> session = TryCreateFakeSpdySessionExpectingFailure(
spdy_session_pool_, key_, ERR_FAILED);
+ EXPECT_TRUE(session);
+ // Flush the read.
+ base::RunLoop().RunUntilIdle();
+ EXPECT_FALSE(session);
}
namespace {
@@ -277,8 +281,6 @@ TEST_P(SpdySessionTest, PendingStreamCancellingAnother) {
session->CloseSessionOnError(ERR_ABORTED, "Aborting session");
EXPECT_EQ(ERR_ABORTED, callback1.WaitForResult());
-
- data.RunFor(1);
}
// A session receiving a GOAWAY frame with no active streams should
@@ -330,9 +332,12 @@ TEST_P(SpdySessionTest, GoAwayImmediatelyWithNoActiveStreams) {
data.StopAfter(1);
- TryCreateInsecureSpdySessionExpectingFailure(
- http_session_, key_, ERR_CONNECTION_CLOSED, BoundNetLog());
+ base::WeakPtr<SpdySession> session =
+ TryCreateInsecureSpdySessionExpectingFailure(
+ http_session_, key_, ERR_CONNECTION_CLOSED, BoundNetLog());
+ base::RunLoop().RunUntilIdle();
+ EXPECT_FALSE(session);
EXPECT_FALSE(HasSpdySession(spdy_session_pool_, key_));
}
@@ -1045,8 +1050,6 @@ TEST_P(SpdySessionTest, FailedPing) {
EXPECT_TRUE(session == NULL);
EXPECT_FALSE(HasSpdySession(spdy_session_pool_, key_));
-
- data.RunFor(1);
EXPECT_EQ(NULL, spdy_stream1.get());
}
« no previous file with comments | « net/spdy/spdy_session_pool.cc ('k') | net/spdy/spdy_test_util_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698