summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/socket/socket_test_util.cc10
-rw-r--r--net/socket/socket_test_util.h2
2 files changed, 3 insertions, 9 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() {
diff --git a/net/socket/socket_test_util.h b/net/socket/socket_test_util.h
index 96c5ea7..d16dcb4 100644
--- a/net/socket/socket_test_util.h
+++ b/net/socket/socket_test_util.h
@@ -287,8 +287,6 @@ class MockClientSocket : public net::SSLClientSocket {
// If an async IO is pending because the SocketDataProvider returned
// ERR_IO_PENDING, then the MockClientSocket waits until this OnReadComplete
// is called to complete the asynchronous read operation.
- // data.async is ignored, and this read is completed synchronously as
- // part of this call.
virtual void OnReadComplete(const MockRead& data) = 0;
protected: