Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(539)

Side by Side Diff: chrome/browser/policy/cloud/test_request_interceptor.h

Issue 16102004: Adding browsertest to verify that updating forced-installed extensions is possible. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: typo Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/policy/cloud/test_request_interceptor.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "chrome/browser/policy/proto/cloud/device_management_backend.pb.h" 12 #include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h"
13 13
14 namespace base {
15 class FilePath;
16 }
17
14 namespace net { 18 namespace net {
15 class NetworkDelegate; 19 class NetworkDelegate;
16 class URLRequest; 20 class URLRequest;
17 class URLRequestJob; 21 class URLRequestJob;
18 } 22 }
19 23
20 namespace policy { 24 namespace policy {
21 25
22 // Intercepts all requests to the given hostname while in scope, and allows 26 // Intercepts all requests to the given hostname while in scope, and allows
23 // queuing callbacks to handle expected requests. Must be created and destroyed 27 // queuing callbacks to handle expected requests. Must be created and destroyed
(...skipping 25 matching lines...) Expand all
49 // Returns a JobCallback that will process a policy register request that 53 // Returns a JobCallback that will process a policy register request that
50 // should succeed. The request parameters are validated, and an appropriate 54 // should succeed. The request parameters are validated, and an appropriate
51 // response is sent back. 55 // response is sent back.
52 // |expected_type| is the expected type in the register request. 56 // |expected_type| is the expected type in the register request.
53 // If |expect_reregister| is true then the request must have the reregister 57 // If |expect_reregister| is true then the request must have the reregister
54 // flag set; otherwise the flag must be not set. 58 // flag set; otherwise the flag must be not set.
55 static JobCallback RegisterJob( 59 static JobCallback RegisterJob(
56 enterprise_management::DeviceRegisterRequest::Type expected_type, 60 enterprise_management::DeviceRegisterRequest::Type expected_type,
57 bool expect_reregister); 61 bool expect_reregister);
58 62
63 // Returns a JobCallback that will send the contents of |file_path|.
64 static JobCallback FileJob(const base::FilePath& file_path);
65
59 private: 66 private:
60 class Delegate; 67 class Delegate;
61 68
62 const std::string hostname_; 69 const std::string hostname_;
63 70
64 // Owned by URLRequestFilter. This handle is valid on IO and only while the 71 // Owned by URLRequestFilter. This handle is valid on IO and only while the
65 // interceptor is valid. 72 // interceptor is valid.
66 Delegate* delegate_; 73 Delegate* delegate_;
67 74
68 DISALLOW_COPY_AND_ASSIGN(TestRequestInterceptor); 75 DISALLOW_COPY_AND_ASSIGN(TestRequestInterceptor);
69 }; 76 };
70 77
71 } // namespace policy 78 } // namespace policy
72 79
73 #endif // CHROME_BROWSER_POLICY_CLOUD_TEST_REQUEST_INTERCEPTOR_H_ 80 #endif // CHROME_BROWSER_POLICY_CLOUD_TEST_REQUEST_INTERCEPTOR_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/policy/cloud/test_request_interceptor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698