| Index: chrome/browser/net/url_request_mock_util.cc
|
| diff --git a/chrome/browser/net/url_request_mock_util.cc b/chrome/browser/net/url_request_mock_util.cc
|
| index c0b1fbbd425234cd3a432b35fff93eb28c8f2bad..9df6304c9138681873d33418ec9efeae003e7fa6 100644
|
| --- a/chrome/browser/net/url_request_mock_util.cc
|
| +++ b/chrome/browser/net/url_request_mock_util.cc
|
| @@ -6,6 +6,7 @@
|
|
|
| #include <string>
|
|
|
| +#include "base/file_util.h"
|
| #include "base/path_service.h"
|
| #include "base/threading/thread_restrictions.h"
|
| #include "chrome/browser/net/url_request_mock_link_doctor_job.h"
|
| @@ -36,10 +37,16 @@ void SetUrlRequestMocksEnabled(bool enabled) {
|
| URLRequestMockLinkDoctorJob::AddUrlHandler();
|
| URLRequestSlowDownloadJob::AddUrlHandler();
|
|
|
| - FilePath root_http;
|
| - PathService::Get(chrome::DIR_TEST_DATA, &root_http);
|
| - URLRequestMockHTTPJob::AddUrlHandler(root_http);
|
| - URLRequestSlowHTTPJob::AddUrlHandler(root_http);
|
| + FilePath test_dir;
|
| + if (!PathService::Get(chrome::DIR_TEST_DATA, &test_dir))
|
| + NOTREACHED();
|
| + URLRequestMockHTTPJob::AddUrlHandler(test_dir);
|
| + URLRequestSlowHTTPJob::AddUrlHandler(test_dir);
|
| +
|
| + FilePath temp_dir;
|
| + if (!file_util::GetTempDir(&temp_dir))
|
| + NOTREACHED();
|
| + URLRequestMockHTTPJob::AddUrlOfTempDirHandler(temp_dir);
|
| } else {
|
| // Revert to the default handlers.
|
| net::URLRequestFilter::GetInstance()->ClearHandlers();
|
|
|