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

Unified Diff: net/spdy/spdy_stream_unittest.cc

Issue 17760008: [SPDY] Enable tests for SPDY/3.1 and SPDY/4 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 7 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
« no previous file with comments | « net/spdy/spdy_session_unittest.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_stream_unittest.cc
diff --git a/net/spdy/spdy_stream_unittest.cc b/net/spdy/spdy_stream_unittest.cc
index c27ad2ebc1c028e74b6adc69120b9439d789c0a6..6ee92db2eaabb4f393419aaefff57a468c58de1e 100644
--- a/net/spdy/spdy_stream_unittest.cc
+++ b/net/spdy/spdy_stream_unittest.cc
@@ -137,13 +137,6 @@ TEST_P(SpdyStreamTest, SendDataAfterOpen) {
session_ = SpdySessionDependencies::SpdyCreateSession(&session_deps_);
- scoped_ptr<SpdyFrame> initial_window_update(
- spdy_util_.ConstructSpdyWindowUpdate(
- kSessionFlowControlStreamId,
- kDefaultInitialRecvWindowSize - kSpdySessionInitialWindowSize));
- if (spdy_util_.protocol() >= kProtoSPDY31)
- AddWrite(*initial_window_update);
-
scoped_ptr<SpdyFrame> req(
spdy_util_.ConstructSpdyPost(
kStreamUrl, 1, kPostBodyLength, LOWEST, NULL, 0));
@@ -206,13 +199,6 @@ TEST_P(SpdyStreamTest, PushedStream) {
session_ = SpdySessionDependencies::SpdyCreateSession(&session_deps_);
scoped_refptr<SpdySession> spdy_session(CreateSpdySession());
- scoped_ptr<SpdyFrame> initial_window_update(
- spdy_util_.ConstructSpdyWindowUpdate(
- kSessionFlowControlStreamId,
- kDefaultInitialRecvWindowSize - kSpdySessionInitialWindowSize));
- if (spdy_util_.protocol() >= kProtoSPDY31)
- AddWrite(*initial_window_update);
-
AddReadEOF();
OrderedSocketData data(GetReads(), GetNumReads(),
@@ -267,13 +253,6 @@ TEST_P(SpdyStreamTest, StreamError) {
session_ = SpdySessionDependencies::SpdyCreateSession(&session_deps_);
- scoped_ptr<SpdyFrame> initial_window_update(
- spdy_util_.ConstructSpdyWindowUpdate(
- kSessionFlowControlStreamId,
- kDefaultInitialRecvWindowSize - kSpdySessionInitialWindowSize));
- if (spdy_util_.protocol() >= kProtoSPDY31)
- AddWrite(*initial_window_update);
-
scoped_ptr<SpdyFrame> req(
spdy_util_.ConstructSpdyPost(
kStreamUrl, 1, kPostBodyLength, LOWEST, NULL, 0));
@@ -359,13 +338,6 @@ TEST_P(SpdyStreamTest, SendLargeDataAfterOpenRequestResponse) {
session_ = SpdySessionDependencies::SpdyCreateSession(&session_deps_);
- scoped_ptr<SpdyFrame> initial_window_update(
- spdy_util_.ConstructSpdyWindowUpdate(
- kSessionFlowControlStreamId,
- kDefaultInitialRecvWindowSize - kSpdySessionInitialWindowSize));
- if (spdy_util_.protocol() >= kProtoSPDY31)
- AddWrite(*initial_window_update);
-
scoped_ptr<SpdyFrame> req(
spdy_util_.ConstructSpdyPost(
kStreamUrl, 1, kPostBodyLength, LOWEST, NULL, 0));
@@ -435,13 +407,6 @@ TEST_P(SpdyStreamTest, SendLargeDataAfterOpenBidirectional) {
session_ = SpdySessionDependencies::SpdyCreateSession(&session_deps_);
- scoped_ptr<SpdyFrame> initial_window_update(
- spdy_util_.ConstructSpdyWindowUpdate(
- kSessionFlowControlStreamId,
- kDefaultInitialRecvWindowSize - kSpdySessionInitialWindowSize));
- if (spdy_util_.protocol() >= kProtoSPDY31)
- AddWrite(*initial_window_update);
-
scoped_ptr<SpdyFrame> req(
spdy_util_.ConstructSpdyPost(
kStreamUrl, 1, kPostBodyLength, LOWEST, NULL, 0));
@@ -507,13 +472,6 @@ TEST_P(SpdyStreamTest, UpperCaseHeaders) {
session_ =
SpdySessionDependencies::SpdyCreateSessionDeterministic(&session_deps_);
- scoped_ptr<SpdyFrame> initial_window_update(
- spdy_util_.ConstructSpdyWindowUpdate(
- kSessionFlowControlStreamId,
- kDefaultInitialRecvWindowSize - kSpdySessionInitialWindowSize));
- if (spdy_util_.protocol() >= kProtoSPDY31)
- AddWrite(*initial_window_update);
-
scoped_ptr<SpdyFrame> syn(
spdy_util_.ConstructSpdyGet(NULL, 0, false, 1, LOWEST, true));
AddWrite(*syn);
@@ -557,10 +515,6 @@ TEST_P(SpdyStreamTest, UpperCaseHeaders) {
EXPECT_TRUE(stream->HasUrl());
EXPECT_EQ(kStreamUrl, stream->GetUrl().spec());
- // For the initial window update.
- if (spdy_util_.protocol() >= kProtoSPDY31)
- data.RunFor(1);
-
data.RunFor(4);
EXPECT_EQ(ERR_SPDY_PROTOCOL_ERROR, delegate.WaitForClose());
@@ -574,13 +528,6 @@ TEST_P(SpdyStreamTest, UpperCaseHeadersOnPush) {
session_ =
SpdySessionDependencies::SpdyCreateSessionDeterministic(&session_deps_);
- scoped_ptr<SpdyFrame> initial_window_update(
- spdy_util_.ConstructSpdyWindowUpdate(
- kSessionFlowControlStreamId,
- kDefaultInitialRecvWindowSize - kSpdySessionInitialWindowSize));
- if (spdy_util_.protocol() >= kProtoSPDY31)
- AddWrite(*initial_window_update);
-
scoped_ptr<SpdyFrame> syn(
spdy_util_.ConstructSpdyGet(NULL, 0, false, 1, LOWEST, true));
AddWrite(*syn);
@@ -628,10 +575,6 @@ TEST_P(SpdyStreamTest, UpperCaseHeadersOnPush) {
EXPECT_TRUE(stream->HasUrl());
EXPECT_EQ(kStreamUrl, stream->GetUrl().spec());
- // For the initial window update.
- if (spdy_util_.protocol() >= kProtoSPDY31)
- data.RunFor(1);
-
data.RunFor(4);
base::WeakPtr<SpdyStream> push_stream;
@@ -651,13 +594,6 @@ TEST_P(SpdyStreamTest, UpperCaseHeadersInHeadersFrame) {
session_ =
SpdySessionDependencies::SpdyCreateSessionDeterministic(&session_deps_);
- scoped_ptr<SpdyFrame> initial_window_update(
- spdy_util_.ConstructSpdyWindowUpdate(
- kSessionFlowControlStreamId,
- kDefaultInitialRecvWindowSize - kSpdySessionInitialWindowSize));
- if (spdy_util_.protocol() >= kProtoSPDY31)
- AddWrite(*initial_window_update);
-
scoped_ptr<SpdyFrame> syn(
spdy_util_.ConstructSpdyGet(NULL, 0, false, 1, LOWEST, true));
AddWrite(*syn);
@@ -716,10 +652,6 @@ TEST_P(SpdyStreamTest, UpperCaseHeadersInHeadersFrame) {
EXPECT_TRUE(stream->HasUrl());
EXPECT_EQ(kStreamUrl, stream->GetUrl().spec());
- // For the initial window update.
- if (spdy_util_.protocol() >= kProtoSPDY31)
- data.RunFor(1);
-
data.RunFor(3);
base::WeakPtr<SpdyStream> push_stream;
@@ -744,13 +676,6 @@ TEST_P(SpdyStreamTest, DuplicateHeaders) {
session_ =
SpdySessionDependencies::SpdyCreateSessionDeterministic(&session_deps_);
- scoped_ptr<SpdyFrame> initial_window_update(
- spdy_util_.ConstructSpdyWindowUpdate(
- kSessionFlowControlStreamId,
- kDefaultInitialRecvWindowSize - kSpdySessionInitialWindowSize));
- if (spdy_util_.protocol() >= kProtoSPDY31)
- AddWrite(*initial_window_update);
-
scoped_ptr<SpdyFrame> syn(
spdy_util_.ConstructSpdyGet(NULL, 0, false, 1, LOWEST, true));
AddWrite(*syn);
@@ -809,10 +734,6 @@ TEST_P(SpdyStreamTest, DuplicateHeaders) {
EXPECT_TRUE(stream->HasUrl());
EXPECT_EQ(kStreamUrl, stream->GetUrl().spec());
- // For the initial window update.
- if (spdy_util_.protocol() >= kProtoSPDY31)
- data.RunFor(1);
-
data.RunFor(3);
base::WeakPtr<SpdyStream> push_stream;
@@ -841,13 +762,6 @@ TEST_P(SpdyStreamTest, IncreaseSendWindowSizeOverflow) {
session_ =
SpdySessionDependencies::SpdyCreateSessionDeterministic(&session_deps_);
- scoped_ptr<SpdyFrame> initial_window_update(
- spdy_util_.ConstructSpdyWindowUpdate(
- kSessionFlowControlStreamId,
- kDefaultInitialRecvWindowSize - kSpdySessionInitialWindowSize));
- if (spdy_util_.protocol() >= kProtoSPDY31)
- AddWrite(*initial_window_update);
-
scoped_ptr<SpdyFrame> req(
spdy_util_.ConstructSpdyPost(
kStreamUrl, 1, kPostBodyLength, LOWEST, NULL, 0));
@@ -889,10 +803,6 @@ TEST_P(SpdyStreamTest, IncreaseSendWindowSizeOverflow) {
EXPECT_TRUE(stream->HasUrl());
EXPECT_EQ(kStreamUrl, stream->GetUrl().spec());
- // For the initial window update.
- if (spdy_util_.protocol() >= kProtoSPDY31)
- data.RunFor(1);
-
data.RunFor(1);
int32 old_send_window_size = stream->send_window_size();
@@ -941,21 +851,11 @@ void AdjustStreamSendWindowSize(const base::WeakPtr<SpdyStream>& stream,
// and unstall.
void SpdyStreamTest::RunResumeAfterUnstallRequestResponseTest(
const UnstallFunction& unstall_function) {
- if (spdy_util_.protocol() < kProtoSPDY3)
- return;
-
GURL url(kStreamUrl);
session_ =
SpdySessionDependencies::SpdyCreateSessionDeterministic(&session_deps_);
- scoped_ptr<SpdyFrame> initial_window_update(
- spdy_util_.ConstructSpdyWindowUpdate(
- kSessionFlowControlStreamId,
- kDefaultInitialRecvWindowSize - kSpdySessionInitialWindowSize));
- if (spdy_util_.protocol() >= kProtoSPDY31)
- AddWrite(*initial_window_update);
-
scoped_ptr<SpdyFrame> req(
spdy_util_.ConstructSpdyPost(
kStreamUrl, 1, kPostBodyLength, LOWEST, NULL, 0));
@@ -1001,10 +901,6 @@ void SpdyStreamTest::RunResumeAfterUnstallRequestResponseTest(
StallStream(stream);
- // For the initial window update.
- if (spdy_util_.protocol() >= kProtoSPDY31)
- data.RunFor(1);
-
data.RunFor(1);
EXPECT_TRUE(stream->send_stalled_by_flow_control());
@@ -1025,11 +921,17 @@ void SpdyStreamTest::RunResumeAfterUnstallRequestResponseTest(
}
TEST_P(SpdyStreamTest, ResumeAfterSendWindowSizeIncreaseRequestResponse) {
+ if (spdy_util_.protocol() < kProtoSPDY3)
+ return;
+
RunResumeAfterUnstallRequestResponseTest(
base::Bind(&IncreaseStreamSendWindowSize));
}
TEST_P(SpdyStreamTest, ResumeAfterSendWindowSizeAdjustRequestResponse) {
+ if (spdy_util_.protocol() < kProtoSPDY3)
+ return;
+
RunResumeAfterUnstallRequestResponseTest(
base::Bind(&AdjustStreamSendWindowSize));
}
@@ -1039,21 +941,11 @@ TEST_P(SpdyStreamTest, ResumeAfterSendWindowSizeAdjustRequestResponse) {
// and unstall.
void SpdyStreamTest::RunResumeAfterUnstallBidirectionalTest(
const UnstallFunction& unstall_function) {
- if (spdy_util_.protocol() < kProtoSPDY3)
- return;
-
GURL url(kStreamUrl);
session_ =
SpdySessionDependencies::SpdyCreateSessionDeterministic(&session_deps_);
- scoped_ptr<SpdyFrame> initial_window_update(
- spdy_util_.ConstructSpdyWindowUpdate(
- kSessionFlowControlStreamId,
- kDefaultInitialRecvWindowSize - kSpdySessionInitialWindowSize));
- if (spdy_util_.protocol() >= kProtoSPDY31)
- AddWrite(*initial_window_update);
-
scoped_ptr<SpdyFrame> req(
spdy_util_.ConstructSpdyPost(
kStreamUrl, 1, kPostBodyLength, LOWEST, NULL, 0));
@@ -1106,10 +998,6 @@ void SpdyStreamTest::RunResumeAfterUnstallBidirectionalTest(
StallStream(stream);
- // For the initial window update.
- if (spdy_util_.protocol() >= kProtoSPDY31)
- data.RunFor(1);
-
data.RunFor(1);
EXPECT_TRUE(stream->send_stalled_by_flow_control());
@@ -1131,11 +1019,17 @@ void SpdyStreamTest::RunResumeAfterUnstallBidirectionalTest(
}
TEST_P(SpdyStreamTest, ResumeAfterSendWindowSizeIncreaseBidirectional) {
+ if (spdy_util_.protocol() < kProtoSPDY3)
+ return;
+
RunResumeAfterUnstallBidirectionalTest(
base::Bind(&IncreaseStreamSendWindowSize));
}
TEST_P(SpdyStreamTest, ResumeAfterSendWindowSizeAdjustBidirectional) {
+ if (spdy_util_.protocol() < kProtoSPDY3)
+ return;
+
RunResumeAfterUnstallBidirectionalTest(
base::Bind(&AdjustStreamSendWindowSize));
}
« no previous file with comments | « net/spdy/spdy_session_unittest.cc ('k') | net/spdy/spdy_test_util_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698