summaryrefslogtreecommitdiffstats
path: root/net/socket/socket_test_util.cc
diff options
context:
space:
mode:
Diffstat (limited to 'net/socket/socket_test_util.cc')
-rw-r--r--net/socket/socket_test_util.cc10
1 files changed, 3 insertions, 7 deletions
diff --git a/net/socket/socket_test_util.cc b/net/socket/socket_test_util.cc
index 18ece28..ef10f76 100644
--- a/net/socket/socket_test_util.cc
+++ b/net/socket/socket_test_util.cc
@@ -150,17 +150,13 @@ void MockTCPClientSocket::OnReadComplete(const MockRead& data) {
DCHECK_NE(ERR_IO_PENDING, data.result);
// Since we've been waiting for data, need_read_data_ should be true.
DCHECK(need_read_data_);
+ // In order to fire the callback, this IO needs to be marked as async.
+ DCHECK(data.async);
read_data_ = data;
need_read_data_ = false;
- // The caller is simulating that this IO completes right now. Don't
- // let CompleteRead() schedule a callback.
- read_data_.async = false;
-
- net::CompletionCallback* callback = pending_callback_;
- int rv = CompleteRead();
- RunCallback(callback, rv);
+ CompleteRead();
}
int MockTCPClientSocket::CompleteRead() {