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

Side by Side Diff: chrome/browser/policy/device_management_service_browsertest.cc

Issue 7397008: Deprecate RegisterProtocolFactory/(Un)RegisterInterceptor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix indent. Created 9 years, 5 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "base/message_loop.h" 5 #include "base/message_loop.h"
6 #include "chrome/browser/policy/device_management_backend_mock.h" 6 #include "chrome/browser/policy/device_management_backend_mock.h"
7 #include "chrome/browser/policy/device_management_service.h" 7 #include "chrome/browser/policy/device_management_service.h"
8 #include "chrome/browser/policy/proto/device_management_constants.h" 8 #include "chrome/browser/policy/proto/device_management_constants.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
(...skipping 30 matching lines...) Expand all
41 41
42 #define PROTO_STRING(name) (std::string(name, arraysize(name) - 1)) 42 #define PROTO_STRING(name) (std::string(name, arraysize(name) - 1))
43 43
44 // Interceptor implementation that returns test data back to the service. 44 // Interceptor implementation that returns test data back to the service.
45 class CannedResponseInterceptor : public net::URLRequest::Interceptor { 45 class CannedResponseInterceptor : public net::URLRequest::Interceptor {
46 public: 46 public:
47 CannedResponseInterceptor(const GURL& service_url, 47 CannedResponseInterceptor(const GURL& service_url,
48 const std::string& response_data) 48 const std::string& response_data)
49 : service_url_(service_url), 49 : service_url_(service_url),
50 response_data_(response_data) { 50 response_data_(response_data) {
51 net::URLRequest::RegisterRequestInterceptor(this); 51 net::URLRequest::Deprecated::RegisterRequestInterceptor(this);
52 } 52 }
53 53
54 virtual ~CannedResponseInterceptor() { 54 virtual ~CannedResponseInterceptor() {
55 net::URLRequest::UnregisterRequestInterceptor(this); 55 net::URLRequest::Deprecated::UnregisterRequestInterceptor(this);
56 } 56 }
57 57
58 private: 58 private:
59 // net::URLRequest::Interceptor overrides. 59 // net::URLRequest::Interceptor overrides.
60 virtual net::URLRequestJob* MaybeIntercept(net::URLRequest* request) { 60 virtual net::URLRequestJob* MaybeIntercept(net::URLRequest* request) {
61 if (request->url().GetOrigin() == service_url_.GetOrigin() && 61 if (request->url().GetOrigin() == service_url_.GetOrigin() &&
62 request->url().path() == service_url_.path()) { 62 request->url().path() == service_url_.path()) {
63 return new net::URLRequestTestJob(request, 63 return new net::URLRequestTestJob(request,
64 net::URLRequestTestJob::test_headers(), 64 net::URLRequestTestJob::test_headers(),
65 response_data_, 65 response_data_,
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 EXPECT_CALL(delegate, HandleUnregisterResponse(_)) 178 EXPECT_CALL(delegate, HandleUnregisterResponse(_))
179 .WillOnce(InvokeWithoutArgs(QuitMessageLoop)); 179 .WillOnce(InvokeWithoutArgs(QuitMessageLoop));
180 em::DeviceUnregisterRequest request; 180 em::DeviceUnregisterRequest request;
181 backend->ProcessUnregisterRequest(token_, "testid", request, &delegate); 181 backend->ProcessUnregisterRequest(token_, "testid", request, &delegate);
182 182
183 MessageLoop::current()->Run(); 183 MessageLoop::current()->Run();
184 } 184 }
185 } 185 }
186 186
187 } // namespace policy 187 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/net/connect_interceptor.cc ('k') | chrome_frame/test/net/test_automation_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698