| 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..b36b63dd375ec3d19541b27332fd8f2962a8ef2e 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,15 @@ net::URLRequestJob* BadRequestJobCallback(
|
| request, network_delegate, headers, std::string(), true);
|
| }
|
|
|
| +net::URLRequestJob* FileJobCallback(const base::FilePath& file_path,
|
| + net::URLRequest* request,
|
| + net::NetworkDelegate* network_delegate) {
|
| + return new content::URLRequestMockHTTPJob(
|
| + request,
|
| + network_delegate,
|
| + file_path);
|
| +}
|
| +
|
| // 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 +264,10 @@ TestRequestInterceptor::JobCallback TestRequestInterceptor::RegisterJob(
|
| return base::Bind(&RegisterJobCallback, expected_type, expect_reregister);
|
| }
|
|
|
| +// static
|
| +TestRequestInterceptor::JobCallback TestRequestInterceptor::FileJob(
|
| + const base::FilePath& file_path) {
|
| + return base::Bind(&FileJobCallback, file_path);
|
| +}
|
| +
|
| } // namespace policy
|
|
|