| 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 d702b0f0f24a58c2447e302c904e2f6081159450..a29ecf49754fbdf217b7f1732090a8b117850fb2 100644
|
| --- a/net/spdy/spdy_network_transaction_unittest.cc
|
| +++ b/net/spdy/spdy_network_transaction_unittest.cc
|
| @@ -270,12 +270,14 @@
|
| void VerifyDataConsumed() {
|
| for (DataVector::iterator it = data_vector_.begin();
|
| it != data_vector_.end(); ++it) {
|
| - EXPECT_TRUE((*it)->AllReadDataConsumed())
|
| - << "Read count: " << (*it)->read_count()
|
| - << " Read index: " << (*it)->read_index();
|
| - EXPECT_TRUE((*it)->AllWriteDataConsumed())
|
| - << "Write count: " << (*it)->write_count()
|
| - << " Write index: " << (*it)->write_index();
|
| + 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();
|
| }
|
| }
|
|
|
| @@ -285,12 +287,14 @@
|
| void VerifyDataNotConsumed() {
|
| for (DataVector::iterator it = data_vector_.begin();
|
| it != data_vector_.end(); ++it) {
|
| - EXPECT_TRUE(!(*it)->AllReadDataConsumed())
|
| - << "Read count: " << (*it)->read_count()
|
| - << " Read index: " << (*it)->read_index();
|
| - EXPECT_TRUE(!(*it)->AllWriteDataConsumed())
|
| - << "Write count: " << (*it)->write_count()
|
| - << " Write index: " << (*it)->write_index();
|
| + 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();
|
| }
|
| }
|
|
|
| @@ -643,8 +647,8 @@
|
| ReadResult(trans, data, &result);
|
|
|
| // Verify that we consumed all test data.
|
| - EXPECT_TRUE(data->AllReadDataConsumed());
|
| - EXPECT_TRUE(data->AllWriteDataConsumed());
|
| + EXPECT_TRUE(data->at_read_eof());
|
| + EXPECT_TRUE(data->at_write_eof());
|
|
|
| // Verify that the received push data is same as the expected push data.
|
| EXPECT_EQ(result2.compare(expected), 0) << "Received data: "
|
| @@ -2484,10 +2488,10 @@
|
| std::string contents("hello!");
|
| EXPECT_EQ(contents, d.data_received());
|
| }
|
| - EXPECT_TRUE(data.AllReadDataConsumed());
|
| - EXPECT_TRUE(data.AllWriteDataConsumed());
|
| - EXPECT_TRUE(data2.AllReadDataConsumed());
|
| - EXPECT_TRUE(data2.AllWriteDataConsumed());
|
| + EXPECT_TRUE(data.at_read_eof());
|
| + EXPECT_TRUE(data.at_write_eof());
|
| + EXPECT_TRUE(data2.at_read_eof());
|
| + EXPECT_TRUE(data2.at_write_eof());
|
| }
|
|
|
| // Send a spdy request to www.example.org. Get a pushed stream that redirects to
|
| @@ -2579,10 +2583,10 @@
|
| }
|
| data.CompleteRead();
|
| data2.CompleteRead();
|
| - EXPECT_TRUE(data.AllReadDataConsumed());
|
| - EXPECT_TRUE(data.AllWriteDataConsumed());
|
| - EXPECT_TRUE(data2.AllReadDataConsumed());
|
| - EXPECT_TRUE(data2.AllWriteDataConsumed());
|
| + EXPECT_TRUE(data.at_read_eof());
|
| + EXPECT_TRUE(data.at_write_eof());
|
| + EXPECT_TRUE(data2.at_read_eof());
|
| + EXPECT_TRUE(data2.at_write_eof());
|
| }
|
|
|
| TEST_P(SpdyNetworkTransactionTest, ServerPushSingleDataFrame) {
|
| @@ -2757,12 +2761,14 @@
|
| EXPECT_EQ(OK, rv);
|
|
|
| // Verify that we consumed all test data.
|
| - EXPECT_TRUE(data.AllReadDataConsumed())
|
| - << "Read count: " << data.read_count()
|
| - << " Read index: " << data.read_index();
|
| - EXPECT_TRUE(data.AllWriteDataConsumed())
|
| - << "Write count: " << data.write_count()
|
| - << " Write index: " << data.write_index();
|
| + 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();
|
|
|
| // Verify the SYN_REPLY.
|
| HttpResponseInfo response = *trans->GetResponseInfo();
|
| @@ -2980,12 +2986,14 @@
|
| EXPECT_EQ(OK, rv);
|
|
|
| // Verify that we consumed all test data.
|
| - EXPECT_TRUE(data.AllReadDataConsumed())
|
| - << "Read count: " << data.read_count()
|
| - << " Read index: " << data.read_index();
|
| - EXPECT_TRUE(data.AllWriteDataConsumed())
|
| - << "Write count: " << data.write_count()
|
| - << " Write index: " << data.write_index();
|
| + 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();
|
|
|
| // Verify the SYN_REPLY.
|
| HttpResponseInfo response = *trans->GetResponseInfo();
|
| @@ -3035,12 +3043,14 @@
|
| EXPECT_EQ(OK, rv);
|
|
|
| // Verify that we consumed all test data.
|
| - EXPECT_TRUE(data.AllReadDataConsumed())
|
| - << "Read count: " << data.read_count()
|
| - << " Read index: " << data.read_index();
|
| - EXPECT_TRUE(data.AllWriteDataConsumed())
|
| - << "Write count: " << data.write_count()
|
| - << " Write index: " << data.write_index();
|
| + 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();
|
|
|
| // Verify the SYN_REPLY.
|
| HttpResponseInfo response = *trans->GetResponseInfo();
|
| @@ -3093,12 +3103,14 @@
|
| rv = callback.WaitForResult();
|
| EXPECT_EQ(OK, rv);
|
| // Verify that we consumed all test data.
|
| - EXPECT_TRUE(data.AllReadDataConsumed())
|
| - << "Read count: " << data.read_count()
|
| - << " Read index: " << data.read_index();
|
| - EXPECT_TRUE(data.AllWriteDataConsumed())
|
| - << "Write count: " << data.write_count()
|
| - << " Write index: " << data.write_index();
|
| + 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();
|
|
|
| // Verify the SYN_REPLY.
|
| HttpResponseInfo response = *trans->GetResponseInfo();
|
| @@ -3559,8 +3571,8 @@
|
| EXPECT_TRUE(helper.StartDefaultTest());
|
| data.RunFor(2);
|
| helper.FinishDefaultTest();
|
| - EXPECT_TRUE(data.AllWriteDataConsumed());
|
| - EXPECT_TRUE(!data.AllReadDataConsumed());
|
| + EXPECT_TRUE(data.at_write_eof());
|
| + EXPECT_TRUE(!data.at_read_eof());
|
| TransactionHelperResult out = helper.output();
|
| EXPECT_EQ(ERR_FAILED, out.rv);
|
| }
|
| @@ -5258,8 +5270,8 @@
|
| data.RunFor(1);
|
|
|
| // Verify that we consumed all test data.
|
| - EXPECT_TRUE(data.AllReadDataConsumed());
|
| - EXPECT_TRUE(data.AllWriteDataConsumed());
|
| + EXPECT_TRUE(data.at_read_eof());
|
| + EXPECT_TRUE(data.at_write_eof());
|
| }
|
|
|
| // TODO(baranovich): HTTP 2 does not allow multiple HEADERS frames
|
| @@ -5398,8 +5410,8 @@
|
| data.RunFor(1);
|
|
|
| // Verify that we consumed all test data.
|
| - EXPECT_TRUE(data.AllReadDataConsumed());
|
| - EXPECT_TRUE(data.AllWriteDataConsumed());
|
| + EXPECT_TRUE(data.at_read_eof());
|
| + EXPECT_TRUE(data.at_write_eof());
|
| }
|
|
|
| TEST_P(SpdyNetworkTransactionTest, ServerPushWithNoStatusHeaderFrames) {
|
| @@ -5505,8 +5517,8 @@
|
| data.RunFor(1);
|
|
|
| // Verify that we consumed all test data.
|
| - EXPECT_TRUE(data.AllReadDataConsumed());
|
| - EXPECT_TRUE(data.AllWriteDataConsumed());
|
| + EXPECT_TRUE(data.at_read_eof());
|
| + EXPECT_TRUE(data.at_write_eof());
|
| }
|
|
|
| TEST_P(SpdyNetworkTransactionTest, SynReplyWithHeaders) {
|
| @@ -5694,8 +5706,8 @@
|
| ReadResult(trans, &data, &result);
|
|
|
| // Verify that we consumed all test data.
|
| - EXPECT_TRUE(data.AllReadDataConsumed());
|
| - EXPECT_TRUE(data.AllWriteDataConsumed());
|
| + EXPECT_TRUE(data.at_read_eof());
|
| + EXPECT_TRUE(data.at_write_eof());
|
|
|
| // Verify the SYN_REPLY.
|
| // Copy the response info, because trans goes away.
|
| @@ -5750,12 +5762,14 @@
|
| EXPECT_EQ(OK, rv);
|
|
|
| // Verify that we consumed all test data.
|
| - EXPECT_TRUE(data.AllReadDataConsumed())
|
| - << "Read count: " << data.read_count()
|
| - << " Read index: " << data.read_index();
|
| - EXPECT_TRUE(data.AllWriteDataConsumed())
|
| - << "Write count: " << data.write_count()
|
| - << " Write index: " << data.write_index();
|
| + 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();
|
|
|
| // Verify the SYN_REPLY.
|
| HttpResponseInfo response = *trans->GetResponseInfo();
|
|
|