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

Unified Diff: net/spdy/spdy_session_spdy2_unittest.cc

Issue 10448083: Fix out of order SYN_STEAM frames. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup Created 8 years, 6 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
Index: net/spdy/spdy_session_spdy2_unittest.cc
diff --git a/net/spdy/spdy_session_spdy2_unittest.cc b/net/spdy/spdy_session_spdy2_unittest.cc
index 311da640687daeac062c718729b855ac3f8a9ebb..87f3a79b5812418e740c5fe51d67418688a892d4 100644
--- a/net/spdy/spdy_session_spdy2_unittest.cc
+++ b/net/spdy/spdy_session_spdy2_unittest.cc
@@ -327,7 +327,7 @@ TEST_F(SpdySessionSpdy2Test, FailedPing) {
// Assert session is not closed.
EXPECT_FALSE(session->IsClosed());
- EXPECT_LT(0u, session->num_active_streams());
+ EXPECT_LT(0u, session->num_active_streams() + session->num_created_streams());
EXPECT_TRUE(spdy_session_pool->HasSession(pair));
// We set last time we have received any data in 1 sec less than now.
@@ -447,8 +447,8 @@ TEST_F(SpdySessionSpdy2Test, CloseIdleSessions) {
// Make sessions 1 and 3 inactive, but keep them open.
// Session 2 still open and active
- session1->CloseStream(spdy_stream1->stream_id(), OK);
- session3->CloseStream(spdy_stream3->stream_id(), OK);
+ session1->CloseCreatedStream(spdy_stream1, OK);
+ session3->CloseCreatedStream(spdy_stream3, OK);
EXPECT_FALSE(session1->is_active());
EXPECT_FALSE(session1->IsClosed());
EXPECT_TRUE(session2->is_active());
@@ -471,7 +471,7 @@ TEST_F(SpdySessionSpdy2Test, CloseIdleSessions) {
EXPECT_FALSE(session2->IsClosed());
// Make 2 not active
- session2->CloseStream(spdy_stream2->stream_id(), OK);
+ session2->CloseCreatedStream(spdy_stream2, OK);
EXPECT_FALSE(session2->is_active());
EXPECT_FALSE(session2->IsClosed());
@@ -1039,8 +1039,8 @@ TEST_F(SpdySessionSpdy2Test, CloseSessionOnError) {
TEST_F(SpdySessionSpdy2Test, OutOfOrderSynStreams) {
// Construct the request.
MockConnect connect_data(SYNCHRONOUS, OK);
- scoped_ptr<SpdyFrame> req1(ConstructSpdyGet(NULL, 0, false, 1, LOWEST));
- scoped_ptr<SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, HIGHEST));
+ scoped_ptr<SpdyFrame> req1(ConstructSpdyGet(NULL, 0, false, 1, HIGHEST));
+ scoped_ptr<SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST));
MockWrite writes[] = {
CreateMockWrite(*req1, 2),
CreateMockWrite(*req2, 1),
@@ -1103,14 +1103,14 @@ TEST_F(SpdySessionSpdy2Test, OutOfOrderSynStreams) {
GURL url1("http://www.google.com");
EXPECT_EQ(OK, session->CreateStream(url1, LOWEST, &spdy_stream1,
BoundNetLog(), callback1.callback()));
- EXPECT_EQ(1u, spdy_stream1->stream_id());
+ EXPECT_EQ(0u, spdy_stream1->stream_id());
scoped_refptr<SpdyStream> spdy_stream2;
TestCompletionCallback callback2;
GURL url2("http://www.google.com");
EXPECT_EQ(OK, session->CreateStream(url2, HIGHEST, &spdy_stream2,
BoundNetLog(), callback2.callback()));
- EXPECT_EQ(3u, spdy_stream2->stream_id());
+ EXPECT_EQ(0u, spdy_stream2->stream_id());
linked_ptr<SpdyHeaderBlock> headers(new SpdyHeaderBlock);
(*headers)["method"] = "GET";
@@ -1128,8 +1128,8 @@ TEST_F(SpdySessionSpdy2Test, OutOfOrderSynStreams) {
spdy_stream2->SendRequest(false);
MessageLoop::current()->RunAllPending();
- EXPECT_EQ(1u, spdy_stream1->stream_id());
- EXPECT_EQ(3u, spdy_stream2->stream_id());
+ EXPECT_EQ(3u, spdy_stream1->stream_id());
+ EXPECT_EQ(1u, spdy_stream2->stream_id());
spdy_stream1->Cancel();
spdy_stream1 = NULL;

Powered by Google App Engine
This is Rietveld 408576698