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

Unified Diff: net/spdy/spdy_http_stream_unittest.cc

Issue 1114383003: Add AllReadDataConsumed and AllWriteDataConsumed methods to SocketDataProvider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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_http_stream_unittest.cc
diff --git a/net/spdy/spdy_http_stream_unittest.cc b/net/spdy/spdy_http_stream_unittest.cc
index 6fecf4570d2b3f166a1557fbc6deaa6cea1698a3..9121cec43f555fd04cd328788c5757a569c144ea 100644
--- a/net/spdy/spdy_http_stream_unittest.cc
+++ b/net/spdy/spdy_http_stream_unittest.cc
@@ -189,8 +189,8 @@ TEST_P(SpdyHttpStreamTest, SendRequest) {
// Because we abandoned the stream, we don't expect to find a session in the
// pool anymore.
EXPECT_FALSE(HasSpdySession(http_session_->spdy_session_pool(), key));
- EXPECT_TRUE(deterministic_data()->at_read_eof());
- EXPECT_TRUE(deterministic_data()->at_write_eof());
+ EXPECT_TRUE(deterministic_data()->AllReadDataConsumed());
+ EXPECT_TRUE(deterministic_data()->AllWriteDataConsumed());
TestLoadTimingNotReused(*http_stream);
http_stream->Close(true);
@@ -351,8 +351,8 @@ TEST_P(SpdyHttpStreamTest, SendChunkedPost) {
// Because we abandoned the stream, we don't expect to find a session in the
// pool anymore.
EXPECT_FALSE(HasSpdySession(http_session_->spdy_session_pool(), key));
- EXPECT_TRUE(deterministic_data()->at_read_eof());
- EXPECT_TRUE(deterministic_data()->at_write_eof());
+ EXPECT_TRUE(deterministic_data()->AllReadDataConsumed());
+ EXPECT_TRUE(deterministic_data()->AllWriteDataConsumed());
}
// Test to ensure the SpdyStream state machine does not get confused when a
@@ -454,8 +454,8 @@ TEST_P(SpdyHttpStreamTest, DelayedSendChunkedPost) {
deterministic_data()->RunFor(1);
ASSERT_TRUE(response.headers.get());
ASSERT_EQ(200, response.headers->response_code());
- EXPECT_TRUE(deterministic_data()->at_read_eof());
- EXPECT_TRUE(deterministic_data()->at_write_eof());
+ EXPECT_TRUE(deterministic_data()->AllReadDataConsumed());
+ EXPECT_TRUE(deterministic_data()->AllWriteDataConsumed());
}
// Test that the SpdyStream state machine can handle sending a final empty data
@@ -540,8 +540,8 @@ TEST_P(SpdyHttpStreamTest, DelayedSendChunkedPostWithEmptyFinalDataFrame) {
deterministic_data()->RunFor(1);
ASSERT_TRUE(response.headers.get());
ASSERT_EQ(200, response.headers->response_code());
- EXPECT_TRUE(deterministic_data()->at_read_eof());
- EXPECT_TRUE(deterministic_data()->at_write_eof());
+ EXPECT_TRUE(deterministic_data()->AllReadDataConsumed());
+ EXPECT_TRUE(deterministic_data()->AllWriteDataConsumed());
}
// Test that the SpdyStream state machine handles a chunked upload with no
@@ -610,8 +610,8 @@ TEST_P(SpdyHttpStreamTest, ChunkedPostWithEmptyPayload) {
deterministic_data()->RunFor(1);
ASSERT_TRUE(response.headers.get());
ASSERT_EQ(200, response.headers->response_code());
- EXPECT_TRUE(deterministic_data()->at_read_eof());
- EXPECT_TRUE(deterministic_data()->at_write_eof());
+ EXPECT_TRUE(deterministic_data()->AllReadDataConsumed());
+ EXPECT_TRUE(deterministic_data()->AllWriteDataConsumed());
}
// Test case for bug: http://code.google.com/p/chromium/issues/detail?id=50058
@@ -656,8 +656,8 @@ TEST_P(SpdyHttpStreamTest, SpdyURLTest) {
// Because we abandoned the stream, we don't expect to find a session in the
// pool anymore.
EXPECT_FALSE(HasSpdySession(http_session_->spdy_session_pool(), key));
- EXPECT_TRUE(deterministic_data()->at_read_eof());
- EXPECT_TRUE(deterministic_data()->at_write_eof());
+ EXPECT_TRUE(deterministic_data()->AllReadDataConsumed());
+ EXPECT_TRUE(deterministic_data()->AllWriteDataConsumed());
}
// The tests below are only for SPDY/3 and above.
@@ -747,8 +747,8 @@ TEST_P(SpdyHttpStreamTest, DelayedSendChunkedPostWithWindowUpdate) {
deterministic_data_->RunFor(1);
ASSERT_TRUE(response.headers.get());
ASSERT_EQ(200, response.headers->response_code());
- EXPECT_TRUE(deterministic_data_->at_read_eof());
- EXPECT_TRUE(deterministic_data_->at_write_eof());
+ EXPECT_TRUE(deterministic_data_->AllReadDataConsumed());
+ EXPECT_TRUE(deterministic_data_->AllWriteDataConsumed());
}
// TODO(willchan): Write a longer test for SpdyStream that exercises all

Powered by Google App Engine
This is Rietveld 408576698