| Index: net/spdy/spdy_network_transaction_unittest.cc
|
| diff --git a/net/spdy/spdy_network_transaction_unittest.cc b/net/spdy/spdy_network_transaction_unittest.cc
|
| index 46b3b0cc252ec445aa48e6258c31274cd318e181..5544630d3aa5eba8630ce483a63266d348bf1d85 100644
|
| --- a/net/spdy/spdy_network_transaction_unittest.cc
|
| +++ b/net/spdy/spdy_network_transaction_unittest.cc
|
| @@ -268,16 +268,9 @@
|
| // should end with an empty read, and that read needs to be processed to
|
| // ensure proper deletion of the spdy_session_pool.
|
| void VerifyDataConsumed() {
|
| - for (DataVector::iterator it = data_vector_.begin();
|
| - it != data_vector_.end(); ++it) {
|
| - EXPECT_TRUE((*it)->at_read_eof()) << "Read count: "
|
| - << (*it)->read_count()
|
| - << " Read index: "
|
| - << (*it)->read_index();
|
| - EXPECT_TRUE((*it)->at_write_eof()) << "Write count: "
|
| - << (*it)->write_count()
|
| - << " Write index: "
|
| - << (*it)->write_index();
|
| + for (const SocketDataProvider* provider : data_vector_) {
|
| + EXPECT_TRUE(provider->AllReadDataConsumed());
|
| + EXPECT_TRUE(provider->AllWriteDataConsumed());
|
| }
|
| }
|
|
|
| @@ -285,16 +278,9 @@
|
| // processed. In that case we want to explicitly ensure that the reads were
|
| // not processed.
|
| void VerifyDataNotConsumed() {
|
| - for (DataVector::iterator it = data_vector_.begin();
|
| - it != data_vector_.end(); ++it) {
|
| - EXPECT_TRUE(!(*it)->at_read_eof()) << "Read count: "
|
| - << (*it)->read_count()
|
| - << " Read index: "
|
| - << (*it)->read_index();
|
| - EXPECT_TRUE(!(*it)->at_write_eof()) << "Write count: "
|
| - << (*it)->write_count()
|
| - << " Write index: "
|
| - << (*it)->write_index();
|
| + for (const SocketDataProvider* provider : data_vector_) {
|
| + EXPECT_FALSE(provider->AllReadDataConsumed());
|
| + EXPECT_FALSE(provider->AllWriteDataConsumed());
|
| }
|
| }
|
|
|
| @@ -641,8 +627,8 @@
|
| ReadResult(trans, data, &result);
|
|
|
| // Verify that we consumed all test data.
|
| - EXPECT_TRUE(data->at_read_eof());
|
| - EXPECT_TRUE(data->at_write_eof());
|
| + EXPECT_TRUE(data->AllReadDataConsumed());
|
| + EXPECT_TRUE(data->AllWriteDataConsumed());
|
|
|
| // Verify that the received push data is same as the expected push data.
|
| EXPECT_EQ(result2.compare(expected), 0) << "Received data: "
|
| @@ -2455,10 +2441,10 @@
|
| std::string contents("hello!");
|
| EXPECT_EQ(contents, d.data_received());
|
| }
|
| - EXPECT_TRUE(data.at_read_eof());
|
| - EXPECT_TRUE(data.at_write_eof());
|
| - EXPECT_TRUE(data2.at_read_eof());
|
| - EXPECT_TRUE(data2.at_write_eof());
|
| + EXPECT_TRUE(data.AllReadDataConsumed());
|
| + EXPECT_TRUE(data.AllWriteDataConsumed());
|
| + EXPECT_TRUE(data2.AllReadDataConsumed());
|
| + EXPECT_TRUE(data2.AllWriteDataConsumed());
|
| }
|
|
|
| // Send a spdy request to www.example.org. Get a pushed stream that redirects to
|
| @@ -2547,12 +2533,10 @@
|
| std::string contents2("hello!");
|
| EXPECT_EQ(contents2, d2.data_received());
|
| }
|
| - data.CompleteRead();
|
| - data2.CompleteRead();
|
| - EXPECT_TRUE(data.at_read_eof());
|
| - EXPECT_TRUE(data.at_write_eof());
|
| - EXPECT_TRUE(data2.at_read_eof());
|
| - EXPECT_TRUE(data2.at_write_eof());
|
| + EXPECT_TRUE(data.AllReadDataConsumed());
|
| + EXPECT_TRUE(data.AllWriteDataConsumed());
|
| + EXPECT_TRUE(data2.AllReadDataConsumed());
|
| + EXPECT_TRUE(data2.AllWriteDataConsumed());
|
| }
|
|
|
| TEST_P(SpdyNetworkTransactionTest, ServerPushSingleDataFrame) {
|
| @@ -2725,14 +2709,8 @@
|
| EXPECT_EQ(OK, rv);
|
|
|
| // Verify that we consumed all test data.
|
| - EXPECT_TRUE(data.at_read_eof()) << "Read count: "
|
| - << data.read_count()
|
| - << " Read index: "
|
| - << data.read_index();
|
| - EXPECT_TRUE(data.at_write_eof()) << "Write count: "
|
| - << data.write_count()
|
| - << " Write index: "
|
| - << data.write_index();
|
| + EXPECT_TRUE(data.AllReadDataConsumed());
|
| + EXPECT_TRUE(data.AllWriteDataConsumed());
|
|
|
| // Verify the SYN_REPLY.
|
| HttpResponseInfo response = *trans->GetResponseInfo();
|
| @@ -2943,14 +2921,8 @@
|
| EXPECT_EQ(OK, rv);
|
|
|
| // Verify that we consumed all test data.
|
| - EXPECT_TRUE(data.at_read_eof()) << "Read count: "
|
| - << data.read_count()
|
| - << " Read index: "
|
| - << data.read_index();
|
| - EXPECT_TRUE(data.at_write_eof()) << "Write count: "
|
| - << data.write_count()
|
| - << " Write index: "
|
| - << data.write_index();
|
| + EXPECT_TRUE(data.AllReadDataConsumed());
|
| + EXPECT_TRUE(data.AllWriteDataConsumed());
|
|
|
| // Verify the SYN_REPLY.
|
| HttpResponseInfo response = *trans->GetResponseInfo();
|
| @@ -2998,14 +2970,8 @@
|
| EXPECT_EQ(OK, rv);
|
|
|
| // Verify that we consumed all test data.
|
| - EXPECT_TRUE(data.at_read_eof()) << "Read count: "
|
| - << data.read_count()
|
| - << " Read index: "
|
| - << data.read_index();
|
| - EXPECT_TRUE(data.at_write_eof()) << "Write count: "
|
| - << data.write_count()
|
| - << " Write index: "
|
| - << data.write_index();
|
| + EXPECT_TRUE(data.AllReadDataConsumed());
|
| + EXPECT_TRUE(data.AllWriteDataConsumed());
|
|
|
| // Verify the SYN_REPLY.
|
| HttpResponseInfo response = *trans->GetResponseInfo();
|
| @@ -3057,14 +3023,8 @@
|
| EXPECT_EQ(OK, rv);
|
|
|
| // Verify that we consumed all test data.
|
| - EXPECT_TRUE(data.at_read_eof()) << "Read count: "
|
| - << data.read_count()
|
| - << " Read index: "
|
| - << data.read_index();
|
| - EXPECT_TRUE(data.at_write_eof()) << "Write count: "
|
| - << data.write_count()
|
| - << " Write index: "
|
| - << data.write_index();
|
| + EXPECT_TRUE(data.AllReadDataConsumed());
|
| + EXPECT_TRUE(data.AllWriteDataConsumed());
|
|
|
| // Verify the SYN_REPLY.
|
| HttpResponseInfo response = *trans->GetResponseInfo();
|
| @@ -3529,8 +3489,8 @@
|
| EXPECT_TRUE(helper.StartDefaultTest());
|
| data.RunFor(2);
|
| helper.FinishDefaultTest();
|
| - EXPECT_TRUE(data.at_write_eof());
|
| - EXPECT_TRUE(!data.at_read_eof());
|
| + EXPECT_TRUE(data.AllWriteDataConsumed());
|
| + EXPECT_TRUE(!data.AllReadDataConsumed());
|
| TransactionHelperResult out = helper.output();
|
| EXPECT_EQ(ERR_FAILED, out.rv);
|
| }
|
| @@ -5227,8 +5187,8 @@
|
| data.RunFor(1);
|
|
|
| // Verify that we consumed all test data.
|
| - EXPECT_TRUE(data.at_read_eof());
|
| - EXPECT_TRUE(data.at_write_eof());
|
| + EXPECT_TRUE(data.AllReadDataConsumed());
|
| + EXPECT_TRUE(data.AllWriteDataConsumed());
|
| }
|
|
|
| // TODO(baranovich): HTTP 2 does not allow multiple HEADERS frames
|
| @@ -5367,8 +5327,8 @@
|
| data.RunFor(1);
|
|
|
| // Verify that we consumed all test data.
|
| - EXPECT_TRUE(data.at_read_eof());
|
| - EXPECT_TRUE(data.at_write_eof());
|
| + EXPECT_TRUE(data.AllReadDataConsumed());
|
| + EXPECT_TRUE(data.AllWriteDataConsumed());
|
| }
|
|
|
| TEST_P(SpdyNetworkTransactionTest, ServerPushWithNoStatusHeaderFrames) {
|
| @@ -5474,8 +5434,8 @@
|
| data.RunFor(1);
|
|
|
| // Verify that we consumed all test data.
|
| - EXPECT_TRUE(data.at_read_eof());
|
| - EXPECT_TRUE(data.at_write_eof());
|
| + EXPECT_TRUE(data.AllReadDataConsumed());
|
| + EXPECT_TRUE(data.AllWriteDataConsumed());
|
| }
|
|
|
| TEST_P(SpdyNetworkTransactionTest, SynReplyWithHeaders) {
|
| @@ -5660,8 +5620,8 @@
|
| ReadResult(trans, &data, &result);
|
|
|
| // Verify that we consumed all test data.
|
| - EXPECT_TRUE(data.at_read_eof());
|
| - EXPECT_TRUE(data.at_write_eof());
|
| + EXPECT_TRUE(data.AllReadDataConsumed());
|
| + EXPECT_TRUE(data.AllWriteDataConsumed());
|
|
|
| // Verify the SYN_REPLY.
|
| // Copy the response info, because trans goes away.
|
| @@ -5714,14 +5674,8 @@
|
| EXPECT_EQ(OK, rv);
|
|
|
| // Verify that we consumed all test data.
|
| - EXPECT_TRUE(data.at_read_eof()) << "Read count: "
|
| - << data.read_count()
|
| - << " Read index: "
|
| - << data.read_index();
|
| - EXPECT_TRUE(data.at_write_eof()) << "Write count: "
|
| - << data.write_count()
|
| - << " Write index: "
|
| - << data.write_index();
|
| + EXPECT_TRUE(data.AllReadDataConsumed());
|
| + EXPECT_TRUE(data.AllWriteDataConsumed());
|
|
|
| // Verify the SYN_REPLY.
|
| HttpResponseInfo response = *trans->GetResponseInfo();
|
|
|