Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
Signed-off-by: Antonio Vicente <avd@google.com>
  • Loading branch information
antoniovicente committed Oct 28, 2020
1 parent 5776193 commit 4298807
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/common/network/connection_impl_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1902,7 +1902,7 @@ TEST_F(MockTransportConnectionImplTest, ReadBufferReadyResumeAfterReadDisable) {
EXPECT_CALL(*file_event_, activate(Event::FileReadyType::Read));
connection_->readDisable(false);

// Do a read to clear the want_read_ flag, verify that no read activation is scheduled.
// Do a read to clear the transport_wants_read_ flag, verify that no read activation is scheduled.
EXPECT_CALL(*transport_socket_, doRead(_))
.WillOnce(Return(IoResult{PostIoAction::KeepOpen, 0, false}));
file_ready_cb_(Event::FileReadyType::Read);
Expand Down Expand Up @@ -1981,8 +1981,8 @@ TEST_F(MockTransportConnectionImplTest, ReadBufferResumeAfterReadDisable) {
connection_->readDisable(false);
}

// Verify that want_read_ read resumption is not lost when processing read buffer high-watermark
// resumptions.
// Verify that transport_wants_read_ read resumption is not lost when processing read buffer
// high-watermark resumptions.
TEST_F(MockTransportConnectionImplTest, ResumeWhileAndAfterReadDisable) {
InSequence s;

Expand Down Expand Up @@ -2020,17 +2020,17 @@ TEST_F(MockTransportConnectionImplTest, ResumeWhileAndAfterReadDisable) {
connection_->readDisable(false);

// Invoke the file event cb while read_disable_count_ == 1 and fully drain the read buffer.
// Expect no transport reads. Expect a read resumption due to want_read_ being true when read is
// re-enabled due to going under the low watermark.
// Expect no transport reads. Expect a read resumption due to transport_wants_read_ being true
// when read is re-enabled due to going under the low watermark.
EXPECT_CALL(*transport_socket_, doRead(_)).Times(0);
EXPECT_CALL(*read_filter, onData(_, _))
.WillRepeatedly(Invoke([&](Buffer::Instance& data, bool) -> FilterStatus {
EXPECT_EQ(10, data.length());
data.drain(data.length());
return FilterStatus::Continue;
}));
// The buffer is fully drained. Expect a read activation because setReadBufferReady set want_read_
// and no transport doRead calls have happened.
// The buffer is fully drained. Expect a read activation because setReadBufferReady set
// transport_wants_read_ and no transport doRead calls have happened.
EXPECT_CALL(*file_event_, setEnabled(Event::FileReadyType::Read | Event::FileReadyType::Write));
EXPECT_CALL(*file_event_, activate(Event::FileReadyType::Read));
file_ready_cb_(Event::FileReadyType::Read);
Expand All @@ -2040,7 +2040,7 @@ TEST_F(MockTransportConnectionImplTest, ResumeWhileAndAfterReadDisable) {
file_ready_cb_(Event::FileReadyType::Read);

// Verify there are no read activate calls the event callback does a transport read and clears the
// want_read_ state.
// transport_wants_read_ state.
EXPECT_CALL(*file_event_, setEnabled(_));
connection_->readDisable(true);
EXPECT_CALL(*file_event_, setEnabled(_));
Expand Down

0 comments on commit 4298807

Please sign in to comment.