| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/net/url_request_mock_util.h" | 5 #include "chrome/browser/net/url_request_mock_util.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/threading/thread_restrictions.h" | 10 #include "base/threading/thread_restrictions.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 net::URLRequestFilter::GetInstance()->ClearHandlers(); | 34 net::URLRequestFilter::GetInstance()->ClearHandlers(); |
| 35 | 35 |
| 36 content::URLRequestFailedJob::AddUrlHandler(); | 36 content::URLRequestFailedJob::AddUrlHandler(); |
| 37 content::URLRequestSlowDownloadJob::AddUrlHandler(); | 37 content::URLRequestSlowDownloadJob::AddUrlHandler(); |
| 38 | 38 |
| 39 base::FilePath root_http; | 39 base::FilePath root_http; |
| 40 PathService::Get(chrome::DIR_TEST_DATA, &root_http); | 40 PathService::Get(chrome::DIR_TEST_DATA, &root_http); |
| 41 content::URLRequestMockHTTPJob::AddUrlHandler(root_http); | 41 content::URLRequestMockHTTPJob::AddUrlHandler(root_http); |
| 42 content::URLRequestMockHTTPJob::AddHostnameToFileHandler( | 42 content::URLRequestMockHTTPJob::AddHostnameToFileHandler( |
| 43 google_util::LinkDoctorBaseURL().host(), | 43 google_util::LinkDoctorBaseURL().host(), |
| 44 root_http.AppendASCII("mock-link-doctor.json")); | 44 root_http.AppendASCII("mock-link-doctor.html")); |
| 45 } else { | 45 } else { |
| 46 // Revert to the default handlers. | 46 // Revert to the default handlers. |
| 47 net::URLRequestFilter::GetInstance()->ClearHandlers(); | 47 net::URLRequestFilter::GetInstance()->ClearHandlers(); |
| 48 } | 48 } |
| 49 } | 49 } |
| 50 | 50 |
| 51 } // namespace chrome_browser_net | 51 } // namespace chrome_browser_net |
| OLD | NEW |