| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 // This class simulates what wininet does when a dns lookup fails. | |
| 5 | |
| 6 #ifndef CONTENT_TEST_NET_URL_REQUEST_FAILED_DNS_JOB_H_ | |
| 7 #define CONTENT_TEST_NET_URL_REQUEST_FAILED_DNS_JOB_H_ | |
| 8 #pragma once | |
| 9 | |
| 10 #include "base/memory/weak_ptr.h" | |
| 11 #include "content/common/content_export.h" | |
| 12 #include "net/url_request/url_request_job.h" | |
| 13 | |
| 14 class URLRequestFailedDnsJob : public net::URLRequestJob { | |
| 15 public: | |
| 16 explicit URLRequestFailedDnsJob(net::URLRequest* request); | |
| 17 | |
| 18 virtual void Start() OVERRIDE; | |
| 19 | |
| 20 static net::URLRequestJob* Factory(net::URLRequest* request, | |
| 21 const std::string& scheme); | |
| 22 | |
| 23 // A test URL that can be used in UI tests. | |
| 24 CONTENT_EXPORT static const char kTestUrl[]; | |
| 25 | |
| 26 // Adds the testing URLs to the net::URLRequestFilter. | |
| 27 CONTENT_EXPORT static void AddUrlHandler(); | |
| 28 | |
| 29 private: | |
| 30 virtual ~URLRequestFailedDnsJob(); | |
| 31 | |
| 32 // Simulate a DNS failure. | |
| 33 void StartAsync(); | |
| 34 | |
| 35 base::WeakPtrFactory<URLRequestFailedDnsJob> weak_factory_; | |
| 36 }; | |
| 37 | |
| 38 #endif // CONTENT_TEST_NET_URL_REQUEST_FAILED_DNS_JOB_H_ | |
| OLD | NEW |