OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/url_request/url_request_test_util.h" | 5 #include "net/url_request/url_request_test_util.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/threading/thread.h" | 10 #include "base/threading/thread.h" |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 MessageLoop::current()->PostTask(FROM_HERE, new MessageLoop::QuitTask()); | 289 MessageLoop::current()->PostTask(FROM_HERE, new MessageLoop::QuitTask()); |
290 } | 290 } |
291 | 291 |
292 TestNetworkDelegate::TestNetworkDelegate() | 292 TestNetworkDelegate::TestNetworkDelegate() |
293 : last_os_error_(0), | 293 : last_os_error_(0), |
294 error_count_(0) { | 294 error_count_(0) { |
295 } | 295 } |
296 | 296 |
297 TestNetworkDelegate::~TestNetworkDelegate() {} | 297 TestNetworkDelegate::~TestNetworkDelegate() {} |
298 | 298 |
299 bool TestNetworkDelegate::OnBeforeURLRequest( | 299 int TestNetworkDelegate::OnBeforeURLRequest( |
300 net::URLRequest* request, net::CompletionCallback* callback) { | 300 net::URLRequest* request, net::CompletionCallback* callback) { |
301 return false; | 301 return net::OK; |
302 } | 302 } |
303 | 303 |
304 void TestNetworkDelegate::OnSendHttpRequest( | 304 int TestNetworkDelegate::OnBeforeSendHeaders( |
305 net::HttpRequestHeaders* headers) { | 305 uint64 request_id, |
| 306 net::HttpRequestHeaders* headers, |
| 307 net::CompletionCallback* callback) { |
| 308 return net::OK; |
306 } | 309 } |
307 | 310 |
308 void TestNetworkDelegate::OnResponseStarted(net::URLRequest* request) { | 311 void TestNetworkDelegate::OnResponseStarted(net::URLRequest* request) { |
309 if (request->status().status() == net::URLRequestStatus::FAILED) { | 312 if (request->status().status() == net::URLRequestStatus::FAILED) { |
310 error_count_++; | 313 error_count_++; |
311 last_os_error_ = request->status().os_error(); | 314 last_os_error_ = request->status().os_error(); |
312 } | 315 } |
313 } | 316 } |
314 | 317 |
315 void TestNetworkDelegate::OnReadCompleted(net::URLRequest* request, | 318 void TestNetworkDelegate::OnReadCompleted(net::URLRequest* request, |
316 int bytes_read) { | 319 int bytes_read) { |
317 if (request->status().status() == net::URLRequestStatus::FAILED) { | 320 if (request->status().status() == net::URLRequestStatus::FAILED) { |
318 error_count_++; | 321 error_count_++; |
319 last_os_error_ = request->status().os_error(); | 322 last_os_error_ = request->status().os_error(); |
320 } | 323 } |
321 } | 324 } |
322 | 325 |
| 326 void TestNetworkDelegate::OnURLRequestDestroyed(net::URLRequest* request) { |
| 327 } |
| 328 |
323 net::URLRequestJob* TestNetworkDelegate::OnMaybeCreateURLRequestJob( | 329 net::URLRequestJob* TestNetworkDelegate::OnMaybeCreateURLRequestJob( |
324 net::URLRequest* request) { | 330 net::URLRequest* request) { |
325 return NULL; | 331 return NULL; |
326 } | 332 } |
OLD | NEW |