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

Unified Diff: net/spdy/spdy_session_spdy2_unittest.cc

Issue 10815074: Instead of enqueueing SPDY frames, enqueue SPDY streams that are ready to produce data. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove logging and cleanup Created 8 years, 5 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.cc ('k') | net/spdy/spdy_session_spdy3_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 cd971d297ee1de3ad9b7ad4fbabb360524d21cb2..9597289715c5e1b47e031e28fdc1fcb3047d1152 100644
--- a/net/spdy/spdy_session_spdy2_unittest.cc
+++ b/net/spdy/spdy_session_spdy2_unittest.cc
@@ -291,7 +291,7 @@ TEST_F(SpdySessionSpdy2Test, DeleteExpiredPushStreams) {
(*request_headers)["url"] = "/";
scoped_refptr<SpdyStream> stream(
- new SpdyStream(session, 1, false, session->net_log_));
+ new SpdyStream(session, false, session->net_log_));
stream->set_spdy_headers(request_headers.Pass());
session->ActivateStream(stream);
@@ -398,7 +398,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.
@@ -518,8 +518,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());
@@ -542,7 +542,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());
@@ -1177,8 +1177,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),
@@ -1242,14 +1242,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());
scoped_ptr<SpdyHeaderBlock> headers(new SpdyHeaderBlock);
(*headers)["method"] = "GET";
@@ -1270,8 +1270,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;
« no previous file with comments | « net/spdy/spdy_session.cc ('k') | net/spdy/spdy_session_spdy3_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698