Index: net/socket/socket_test_util.cc |
diff --git a/net/socket/socket_test_util.cc b/net/socket/socket_test_util.cc |
index 4df69d2fa1ccfe46bed35f6bf2e6e54d87fe2f47..cf033c245c3e86c8b5c427c2dc061e49172b7a3a 100644 |
--- a/net/socket/socket_test_util.cc |
+++ b/net/socket/socket_test_util.cc |
@@ -156,27 +156,27 @@ |
} |
const MockRead& StaticSocketDataHelper::PeekRead() const { |
- CHECK(!AllReadDataConsumed()); |
+ CHECK(!at_read_eof()); |
return reads_[read_index_]; |
} |
const MockWrite& StaticSocketDataHelper::PeekWrite() const { |
- CHECK(!AllWriteDataConsumed()); |
+ CHECK(!at_write_eof()); |
return writes_[write_index_]; |
} |
const MockRead& StaticSocketDataHelper::AdvanceRead() { |
- CHECK(!AllReadDataConsumed()); |
+ CHECK(!at_read_eof()); |
return reads_[read_index_++]; |
} |
const MockWrite& StaticSocketDataHelper::AdvanceWrite() { |
- CHECK(!AllWriteDataConsumed()); |
+ CHECK(!at_write_eof()); |
return writes_[write_index_++]; |
} |
bool StaticSocketDataHelper::VerifyWriteData(const std::string& data) { |
- CHECK(!AllWriteDataConsumed()); |
+ CHECK(!at_write_eof()); |
// Check that what the actual data matches the expectations. |
const MockWrite& next_write = PeekWrite(); |
if (!next_write.data) |
@@ -195,14 +195,6 @@ |
return expected_data == actual_data; |
} |
-bool StaticSocketDataHelper::AllReadDataConsumed() const { |
- return read_index_ >= read_count_; |
-} |
- |
-bool StaticSocketDataHelper::AllWriteDataConsumed() const { |
- return write_index_ >= write_count_; |
-} |
- |
void StaticSocketDataHelper::Reset() { |
read_index_ = 0; |
write_index_ = 0; |
@@ -223,7 +215,7 @@ |
} |
MockRead StaticSocketDataProvider::OnRead() { |
- CHECK(!helper_.AllReadDataConsumed()); |
+ CHECK(!helper_.at_read_eof()); |
return helper_.AdvanceRead(); |
} |
@@ -232,8 +224,8 @@ |
// Not using mock writes; succeed synchronously. |
return MockWriteResult(SYNCHRONOUS, data.length()); |
} |
- EXPECT_FALSE(helper_.AllWriteDataConsumed()); |
- if (helper_.AllWriteDataConsumed()) { |
+ EXPECT_FALSE(helper_.at_write_eof()); |
+ if (helper_.at_write_eof()) { |
// Show what the extra write actually consists of. |
EXPECT_EQ("<unexpected write>", data); |
return MockWriteResult(SYNCHRONOUS, ERR_UNEXPECTED); |
@@ -254,14 +246,6 @@ |
void StaticSocketDataProvider::Reset() { |
helper_.Reset(); |
-} |
- |
-bool StaticSocketDataProvider::AllReadDataConsumed() const { |
- return helper_.AllReadDataConsumed(); |
-} |
- |
-bool StaticSocketDataProvider::AllWriteDataConsumed() const { |
- return helper_.AllWriteDataConsumed(); |
} |
DynamicSocketDataProvider::DynamicSocketDataProvider() |
@@ -524,7 +508,7 @@ |
MockRead SequencedSocketData::OnRead() { |
CHECK_EQ(IDLE, read_state_); |
- CHECK(!helper_.AllReadDataConsumed()); |
+ CHECK(!helper_.at_read_eof()); |
NET_TRACE(1, " *** ") << "sequence_number: " << sequence_number_; |
const MockRead& next_read = helper_.PeekRead(); |
@@ -536,7 +520,7 @@ |
NET_TRACE(1, " *** ") << "Hanging read"; |
helper_.AdvanceRead(); |
++sequence_number_; |
- CHECK(helper_.AllReadDataConsumed()); |
+ CHECK(helper_.at_read_eof()); |
return MockRead(SYNCHRONOUS, ERR_IO_PENDING); |
} |
@@ -568,7 +552,7 @@ |
MockWriteResult SequencedSocketData::OnWrite(const std::string& data) { |
CHECK_EQ(IDLE, write_state_); |
- CHECK(!helper_.AllWriteDataConsumed()); |
+ CHECK(!helper_.at_write_eof()); |
NET_TRACE(1, " *** ") << "sequence_number: " << sequence_number_; |
const MockWrite& next_write = helper_.PeekWrite(); |
@@ -616,12 +600,12 @@ |
weak_factory_.InvalidateWeakPtrs(); |
} |
-bool SequencedSocketData::AllReadDataConsumed() const { |
- return helper_.AllReadDataConsumed(); |
-} |
- |
-bool SequencedSocketData::AllWriteDataConsumed() const { |
- return helper_.AllWriteDataConsumed(); |
+bool SequencedSocketData::at_read_eof() const { |
+ return helper_.at_read_eof(); |
+} |
+ |
+bool SequencedSocketData::at_write_eof() const { |
+ return helper_.at_read_eof(); |
} |
void SequencedSocketData::MaybePostReadCompleteTask() { |
@@ -741,7 +725,7 @@ |
// the tasks in the message loop, and explicitly invoking the read/write |
// callbacks (simulating network I/O). We check our conditions between each, |
// since they can change in either. |
- while ((!AllWriteDataConsumed() || !AllReadDataConsumed()) && !stopped()) { |
+ while ((!at_write_eof() || !at_read_eof()) && !stopped()) { |
if (counter % 2 == 0) |
base::RunLoop().RunUntilIdle(); |
if (counter % 2 == 1) { |