Index: content/browser/appcache/appcache_request_handler_unittest.cc |
diff --git a/content/browser/appcache/appcache_request_handler_unittest.cc b/content/browser/appcache/appcache_request_handler_unittest.cc |
index 1252bf190611dd870804365f8c271dd6df07eb72..90bcefc16b88d708a97edec9231bee4e807e9042 100644 |
--- a/content/browser/appcache/appcache_request_handler_unittest.cc |
+++ b/content/browser/appcache/appcache_request_handler_unittest.cc |
@@ -79,8 +79,27 @@ class AppCacheRequestHandlerTest : public testing::Test { |
// exercise fallback code paths. |
class MockURLRequestDelegate : public net::URLRequest::Delegate { |
- void OnResponseStarted(net::URLRequest* request) override {} |
- void OnReadCompleted(net::URLRequest* request, int bytes_read) override {} |
+ public: |
+ MockURLRequestDelegate() : request_status_(1) {} |
+ |
+ void OnResponseStarted(net::URLRequest* request, int net_error) override { |
+ DCHECK_NE(net::ERR_IO_PENDING, net_error); |
+ |
michaeln
2016/09/07 20:49:39
nit: you can delete the blank line and after the d
maksims (do not use this acc)
2016/09/12 12:45:58
Done.
|
+ request_status_ = net_error; |
+ } |
+ void OnReadCompleted(net::URLRequest* request, int bytes_read) override { |
+ DCHECK_NE(net::ERR_IO_PENDING, bytes_read); |
+ |
+ if (bytes_read >= 0) |
+ request_status_ = net::OK; |
+ else |
+ request_status_ = bytes_read; |
+ } |
+ |
+ int request_status() { return request_status_; } |
michaeln
2016/09/07 20:49:39
could be const
maksims (do not use this acc)
2016/09/12 12:45:58
Done.
|
+ |
+ private: |
+ int request_status_; |
}; |
class MockURLRequestJob : public net::URLRequestJob { |
@@ -385,7 +404,7 @@ class AppCacheRequestHandlerTest : public testing::Test { |
response_code)); |
request_->Start(); |
// All our simulation needs to satisfy are the following two DCHECKs |
- DCHECK(request_->status().is_success()); |
+ DCHECK_EQ(net::OK, delegate_.request_status()); |
DCHECK_EQ(response_code, request_->GetResponseCode()); |
} |