OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #ifndef CHROME_BROWSER_POLICY_CLOUD_TEST_REQUEST_INTERCEPTOR_H_ | 5 #ifndef CHROME_BROWSER_POLICY_CLOUD_TEST_REQUEST_INTERCEPTOR_H_ |
6 #define CHROME_BROWSER_POLICY_CLOUD_TEST_REQUEST_INTERCEPTOR_H_ | 6 #define CHROME_BROWSER_POLICY_CLOUD_TEST_REQUEST_INTERCEPTOR_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/files/file_path.h" | |
Joao da Silva
2013/05/28 08:27:31
FilePath can be forward declared:
namespace base
Joao da Silva
2013/05/28 11:59:34
Done.
csorba
2013/05/28 12:00:39
Done.
| |
12 #include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h" | 13 #include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h" |
13 | 14 |
14 namespace net { | 15 namespace net { |
15 class NetworkDelegate; | 16 class NetworkDelegate; |
16 class URLRequest; | 17 class URLRequest; |
17 class URLRequestJob; | 18 class URLRequestJob; |
18 } | 19 } |
19 | 20 |
20 namespace policy { | 21 namespace policy { |
21 | 22 |
(...skipping 27 matching lines...) Expand all Loading... | |
49 // Returns a JobCallback that will process a policy register request that | 50 // Returns a JobCallback that will process a policy register request that |
50 // should succeed. The request parameters are validated, and an appropriate | 51 // should succeed. The request parameters are validated, and an appropriate |
51 // response is sent back. | 52 // response is sent back. |
52 // |expected_type| is the expected type in the register request. | 53 // |expected_type| is the expected type in the register request. |
53 // If |expect_reregister| is true then the request must have the reregister | 54 // If |expect_reregister| is true then the request must have the reregister |
54 // flag set; otherwise the flag must be not set. | 55 // flag set; otherwise the flag must be not set. |
55 static JobCallback RegisterJob( | 56 static JobCallback RegisterJob( |
56 enterprise_management::DeviceRegisterRequest::Type expected_type, | 57 enterprise_management::DeviceRegisterRequest::Type expected_type, |
57 bool expect_reregister); | 58 bool expect_reregister); |
58 | 59 |
60 // Returns a JobCallback that will create an URLRequestMockHTTPJob. | |
61 static JobCallback MockJob(const base::FilePath& file_path); | |
Joao da Silva
2013/05/28 08:27:31
This JobCallback will serve the contents of |file_
csorba
2013/05/28 12:00:39
Done. (Choosed FileJob)
| |
62 | |
59 private: | 63 private: |
60 class Delegate; | 64 class Delegate; |
61 | 65 |
62 const std::string hostname_; | 66 const std::string hostname_; |
63 | 67 |
64 // Owned by URLRequestFilter. This handle is valid on IO and only while the | 68 // Owned by URLRequestFilter. This handle is valid on IO and only while the |
65 // interceptor is valid. | 69 // interceptor is valid. |
66 Delegate* delegate_; | 70 Delegate* delegate_; |
67 | 71 |
68 DISALLOW_COPY_AND_ASSIGN(TestRequestInterceptor); | 72 DISALLOW_COPY_AND_ASSIGN(TestRequestInterceptor); |
69 }; | 73 }; |
70 | 74 |
71 } // namespace policy | 75 } // namespace policy |
72 | 76 |
73 #endif // CHROME_BROWSER_POLICY_CLOUD_TEST_REQUEST_INTERCEPTOR_H_ | 77 #endif // CHROME_BROWSER_POLICY_CLOUD_TEST_REQUEST_INTERCEPTOR_H_ |
OLD | NEW |