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

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

Issue 10832003: Add const accessors to URLRequest and UploadData. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Forgot to check browser_tests Created 8 years, 4 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 | « chrome/browser/automation/url_request_automation_job.cc ('k') | net/base/upload_data.h » ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "base/message_loop.h" 6 #include "base/message_loop.h"
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "chrome/browser/policy/cloud_policy_constants.h" 8 #include "chrome/browser/policy/cloud_policy_constants.h"
9 #include "chrome/browser/policy/device_management_service.h" 9 #include "chrome/browser/policy/device_management_service.h"
10 #include "chrome/test/base/in_process_browser_test.h" 10 #include "chrome/test/base/in_process_browser_test.h"
(...skipping 26 matching lines...) Expand all
37 } 37 }
38 38
39 virtual ~CannedResponseInterceptor() { 39 virtual ~CannedResponseInterceptor() {
40 net::URLRequest::Deprecated::UnregisterRequestInterceptor(this); 40 net::URLRequest::Deprecated::UnregisterRequestInterceptor(this);
41 } 41 }
42 42
43 // net::URLRequest::Interceptor overrides. 43 // net::URLRequest::Interceptor overrides.
44 virtual net::URLRequestJob* MaybeIntercept( 44 virtual net::URLRequestJob* MaybeIntercept(
45 net::URLRequest* request) OVERRIDE { 45 net::URLRequest* request) OVERRIDE {
46 em::DeviceManagementRequest dm_request; 46 em::DeviceManagementRequest dm_request;
47 net::UploadData* upload = request->get_upload(); 47 net::UploadData* upload = request->get_upload_mutable();
48 if (request->url().GetOrigin() == service_url_.GetOrigin() && 48 if (request->url().GetOrigin() == service_url_.GetOrigin() &&
49 request->url().path() == service_url_.path() && 49 request->url().path() == service_url_.path() &&
50 upload != NULL && 50 upload != NULL &&
51 upload->elements()->size() == 1) { 51 upload->elements()->size() == 1) {
52 std::string response_data; 52 std::string response_data;
53 ConstructResponse(upload->elements()->at(0).bytes(), &response_data); 53 ConstructResponse(upload->elements()->at(0).bytes(), &response_data);
54 return new net::URLRequestTestJob(request, 54 return new net::URLRequestTestJob(request,
55 net::URLRequestTestJob::test_headers(), 55 net::URLRequestTestJob::test_headers(),
56 response_data, 56 response_data,
57 true); 57 true);
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 MessageLoop::current()->Run(); 206 MessageLoop::current()->Run();
207 } 207 }
208 208
209 INSTANTIATE_TEST_CASE_P( 209 INSTANTIATE_TEST_CASE_P(
210 DeviceManagementServiceIntegrationTestInstance, 210 DeviceManagementServiceIntegrationTestInstance,
211 DeviceManagementServiceIntegrationTest, 211 DeviceManagementServiceIntegrationTest,
212 testing::Values(&DeviceManagementServiceIntegrationTest::InitCannedResponse, 212 testing::Values(&DeviceManagementServiceIntegrationTest::InitCannedResponse,
213 &DeviceManagementServiceIntegrationTest::InitTestServer)); 213 &DeviceManagementServiceIntegrationTest::InitTestServer));
214 214
215 } // namespace policy 215 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/automation/url_request_automation_job.cc ('k') | net/base/upload_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698