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

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

Issue 11275223: net: Change type of UploadData::elements from std::vector to ScopedVector (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move ParamTraits to ipc_message_utils.h Created 8 years, 1 month 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) 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
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, 45 net::URLRequest* request,
46 net::NetworkDelegate* network_delegate) OVERRIDE { 46 net::NetworkDelegate* network_delegate) OVERRIDE {
47 em::DeviceManagementRequest dm_request; 47 em::DeviceManagementRequest dm_request;
48 net::UploadData* upload = request->get_upload_mutable(); 48 net::UploadData* upload = request->get_upload_mutable();
49 if (request->url().GetOrigin() == service_url_.GetOrigin() && 49 if (request->url().GetOrigin() == service_url_.GetOrigin() &&
50 request->url().path() == service_url_.path() && 50 request->url().path() == service_url_.path() &&
51 upload != NULL && 51 upload != NULL &&
52 upload->elements()->size() == 1) { 52 upload->elements().size() == 1) {
53 std::string response_data; 53 std::string response_data;
54 ConstructResponse(upload->elements()->at(0).bytes(), 54 ConstructResponse(upload->elements()[0]->bytes(),
55 upload->elements()->at(0).bytes_length(), 55 upload->elements()[0]->bytes_length(),
56 &response_data); 56 &response_data);
57 return new net::URLRequestTestJob(request, 57 return new net::URLRequestTestJob(request,
58 network_delegate, 58 network_delegate,
59 net::URLRequestTestJob::test_headers(), 59 net::URLRequestTestJob::test_headers(),
60 response_data, 60 response_data,
61 true); 61 true);
62 } 62 }
63 63
64 return NULL; 64 return NULL;
65 } 65 }
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 MessageLoop::current()->Run(); 210 MessageLoop::current()->Run();
211 } 211 }
212 212
213 INSTANTIATE_TEST_CASE_P( 213 INSTANTIATE_TEST_CASE_P(
214 DeviceManagementServiceIntegrationTestInstance, 214 DeviceManagementServiceIntegrationTestInstance,
215 DeviceManagementServiceIntegrationTest, 215 DeviceManagementServiceIntegrationTest,
216 testing::Values(&DeviceManagementServiceIntegrationTest::InitCannedResponse, 216 testing::Values(&DeviceManagementServiceIntegrationTest::InitCannedResponse,
217 &DeviceManagementServiceIntegrationTest::InitTestServer)); 217 &DeviceManagementServiceIntegrationTest::InitTestServer));
218 218
219 } // namespace policy 219 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698