| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <set> | 5 #include <set> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 DelayableURLRequestMockHTTPJob* job = | 253 DelayableURLRequestMockHTTPJob* job = |
| 254 new DelayableURLRequestMockHTTPJob( | 254 new DelayableURLRequestMockHTTPJob( |
| 255 request, network_delegate, mock_corrections_file_path_, | 255 request, network_delegate, mock_corrections_file_path_, |
| 256 delay_requests_, on_request_destroyed_callback_); | 256 delay_requests_, on_request_destroyed_callback_); |
| 257 if (delay_requests_) | 257 if (delay_requests_) |
| 258 delayed_requests_.insert(job); | 258 delayed_requests_.insert(job); |
| 259 return job; | 259 return job; |
| 260 } | 260 } |
| 261 } | 261 } |
| 262 | 262 |
| 263 net::URLRequestJob* MaybeInterceptResponse( |
| 264 net::URLRequest* request, |
| 265 net::NetworkDelegate* network_delegate) const override { |
| 266 return NULL; |
| 267 } |
| 268 |
| 269 net::URLRequestJob* MaybeInterceptRedirect( |
| 270 net::URLRequest* request, |
| 271 net::NetworkDelegate* network_delegate, |
| 272 const GURL& location) const override { |
| 273 return NULL; |
| 274 } |
| 275 |
| 263 void set_net_error(int net_error) { net_error_ = net_error; } | 276 void set_net_error(int net_error) { net_error_ = net_error; } |
| 264 | 277 |
| 265 void SetDelayRequests(bool delay_requests) { | 278 void SetDelayRequests(bool delay_requests) { |
| 266 delay_requests_ = delay_requests; | 279 delay_requests_ = delay_requests; |
| 267 | 280 |
| 268 // Resume all delayed requests if no longer delaying requests. | 281 // Resume all delayed requests if no longer delaying requests. |
| 269 if (!delay_requests) { | 282 if (!delay_requests) { |
| 270 while (!delayed_requests_.empty()) { | 283 while (!delayed_requests_.empty()) { |
| 271 DelayableRequest* request = *delayed_requests_.begin(); | 284 DelayableRequest* request = *delayed_requests_.begin(); |
| 272 delayed_requests_.erase(request); | 285 delayed_requests_.erase(request); |
| (...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 989 | 1002 |
| 990 EXPECT_EQ(chrome_common_net::DNS_PROBE_FINISHED_INCONCLUSIVE, | 1003 EXPECT_EQ(chrome_common_net::DNS_PROBE_FINISHED_INCONCLUSIVE, |
| 991 WaitForSentStatus()); | 1004 WaitForSentStatus()); |
| 992 EXPECT_EQ(0, pending_status_count()); | 1005 EXPECT_EQ(0, pending_status_count()); |
| 993 ExpectDisplayingLocalErrorPage("ERR_NAME_NOT_RESOLVED"); | 1006 ExpectDisplayingLocalErrorPage("ERR_NAME_NOT_RESOLVED"); |
| 994 } | 1007 } |
| 995 | 1008 |
| 996 } // namespace | 1009 } // namespace |
| 997 | 1010 |
| 998 } // namespace chrome_browser_net | 1011 } // namespace chrome_browser_net |
| OLD | NEW |