Chromium Code Reviews| Index: chrome/browser/policy/cloud/test_request_interceptor.cc |
| diff --git a/chrome/browser/policy/cloud/test_request_interceptor.cc b/chrome/browser/policy/cloud/test_request_interceptor.cc |
| index 7805a26e565b74209336a4e41fe106ab397cf505..53c5156b32c3c160601164255f07fc55e68084bc 100644 |
| --- a/chrome/browser/policy/cloud/test_request_interceptor.cc |
| +++ b/chrome/browser/policy/cloud/test_request_interceptor.cc |
| @@ -12,6 +12,7 @@ |
| #include "base/memory/scoped_ptr.h" |
| #include "content/public/browser/browser_thread.h" |
| #include "content/public/test/test_utils.h" |
| +#include "content/test/net/url_request_mock_http_job.h" |
| #include "googleurl/src/gurl.h" |
| #include "net/base/net_errors.h" |
| #include "net/base/upload_bytes_element_reader.h" |
| @@ -54,6 +55,16 @@ net::URLRequestJob* BadRequestJobCallback( |
| request, network_delegate, headers, std::string(), true); |
| } |
| +net::URLRequestJob* MockJobCallback(const base::FilePath& file_path, |
| + net::URLRequest* request, |
| + net::NetworkDelegate* network_delegate) { |
| + LOG(ERROR) << file_path.value(); |
|
Joao da Silva
2013/05/28 08:27:31
Remove this.
csorba
2013/05/28 12:00:39
Done.
|
| + return new content::URLRequestMockHTTPJob( |
| + request, |
| + network_delegate, |
| + file_path); |
|
Joao da Silva
2013/05/28 08:27:31
it: indent (+4 spaces)
csorba
2013/05/28 12:00:39
Done.
|
| +} |
| + |
| // Parses the upload data in |request| into |request_msg|, and validates the |
| // request. The query string in the URL must contain the |expected_type| for |
| // the "request" parameter. Returns true if all checks succeeded, and the |
| @@ -254,4 +265,10 @@ TestRequestInterceptor::JobCallback TestRequestInterceptor::RegisterJob( |
| return base::Bind(&RegisterJobCallback, expected_type, expect_reregister); |
| } |
| +// static |
| +TestRequestInterceptor::JobCallback TestRequestInterceptor::MockJob( |
| + const base::FilePath& file_path) { |
| + return base::Bind(&MockJobCallback, file_path); |
| +} |
| + |
| } // namespace policy |