Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(490)

Unified Diff: net/url_request/url_request_simple_job_unittest.cc

Issue 2262653003: Make URLRequest::Read to return net errors or bytes read instead of a bool (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more fixes Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/url_request/url_request_simple_job_unittest.cc
diff --git a/net/url_request/url_request_simple_job_unittest.cc b/net/url_request/url_request_simple_job_unittest.cc
index 9ecd9196d8e5b5c5407eb9af3006666efbef4869..64678a1ee31d00b2044c77982400f9cd87dcc161 100644
--- a/net/url_request/url_request_simple_job_unittest.cc
+++ b/net/url_request/url_request_simple_job_unittest.cc
@@ -80,16 +80,17 @@ class CancelAfterFirstReadURLRequestDelegate : public TestDelegate {
~CancelAfterFirstReadURLRequestDelegate() override {}
- void OnResponseStarted(URLRequest* request) override {
+ void OnResponseStarted(URLRequest* request, int net_error) override {
+ DCHECK_NE(ERR_IO_PENDING, net_error);
// net::TestDelegate will start the first read.
- TestDelegate::OnResponseStarted(request);
+ TestDelegate::OnResponseStarted(request, net_error);
request->Cancel();
run_loop_->Quit();
}
void OnReadCompleted(URLRequest* request, int bytes_read) override {
// Read should have been cancelled.
- EXPECT_EQ(-1, bytes_read);
+ EXPECT_EQ(ERR_ABORTED, bytes_read);
}
void WaitUntilHeadersReceived() const { run_loop_->Run(); }

Powered by Google App Engine
This is Rietveld 408576698