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

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

Issue 8375039: Create a content::UrlFetcher interface that lives in content/public/common and convert users to i... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: review comments Created 9 years, 2 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 protected: 83 protected:
84 std::string token_; 84 std::string token_;
85 }; 85 };
86 86
87 static void QuitMessageLoop() { 87 static void QuitMessageLoop() {
88 MessageLoop::current()->Quit(); 88 MessageLoop::current()->Quit();
89 } 89 }
90 90
91 IN_PROC_BROWSER_TEST_F(DeviceManagementServiceIntegrationTest, 91 IN_PROC_BROWSER_TEST_F(DeviceManagementServiceIntegrationTest,
92 CannedResponses) { 92 CannedResponses) {
93 URLFetcher::enable_interception_for_tests(true); 93 URLFetcher::SetEnableInterceptionForTests(true);
94 DeviceManagementService service(kServiceUrl); 94 DeviceManagementService service(kServiceUrl);
95 service.ScheduleInitialization(0); 95 service.ScheduleInitialization(0);
96 scoped_ptr<DeviceManagementBackend> backend(service.CreateBackend()); 96 scoped_ptr<DeviceManagementBackend> backend(service.CreateBackend());
97 97
98 { 98 {
99 CannedResponseInterceptor interceptor( 99 CannedResponseInterceptor interceptor(
100 GURL(kServiceUrl), PROTO_STRING(kServiceResponseRegister)); 100 GURL(kServiceUrl), PROTO_STRING(kServiceResponseRegister));
101 DeviceRegisterResponseDelegateMock delegate; 101 DeviceRegisterResponseDelegateMock delegate;
102 EXPECT_CALL(delegate, HandleRegisterResponse(_)) 102 EXPECT_CALL(delegate, HandleRegisterResponse(_))
103 .WillOnce(DoAll(Invoke(this, &DeviceManagementServiceIntegrationTest 103 .WillOnce(DoAll(Invoke(this, &DeviceManagementServiceIntegrationTest
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 EXPECT_CALL(delegate, HandleUnregisterResponse(_)) 185 EXPECT_CALL(delegate, HandleUnregisterResponse(_))
186 .WillOnce(InvokeWithoutArgs(QuitMessageLoop)); 186 .WillOnce(InvokeWithoutArgs(QuitMessageLoop));
187 em::DeviceUnregisterRequest request; 187 em::DeviceUnregisterRequest request;
188 backend->ProcessUnregisterRequest(token_, "testid", request, &delegate); 188 backend->ProcessUnregisterRequest(token_, "testid", request, &delegate);
189 189
190 MessageLoop::current()->Run(); 190 MessageLoop::current()->Run();
191 } 191 }
192 } 192 }
193 193
194 } // namespace policy 194 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/policy/device_management_service.cc ('k') | chrome/browser/policy/device_management_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698