OLD | NEW |
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/bind.h" | 5 #include "base/bind.h" |
6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 g_browser_process->system_request_context())); | 135 g_browser_process->system_request_context())); |
136 job->SetGaiaToken("gaia_auth_token"); | 136 job->SetGaiaToken("gaia_auth_token"); |
137 job->SetOAuthToken("oauth_token"); | 137 job->SetOAuthToken("oauth_token"); |
138 job->SetClientID("testid"); | 138 job->SetClientID("testid"); |
139 job->GetRequest()->mutable_register_request(); | 139 job->GetRequest()->mutable_register_request(); |
140 job->Start(base::Bind(&DeviceManagementServiceIntegrationTest::OnJobDone, | 140 job->Start(base::Bind(&DeviceManagementServiceIntegrationTest::OnJobDone, |
141 base::Unretained(this))); | 141 base::Unretained(this))); |
142 base::MessageLoop::current()->Run(); | 142 base::MessageLoop::current()->Run(); |
143 } | 143 } |
144 | 144 |
145 virtual void SetUpOnMainThread() override { | 145 void SetUpOnMainThread() override { |
146 std::string service_url((this->*(GetParam()))()); | 146 std::string service_url((this->*(GetParam()))()); |
147 service_.reset(new DeviceManagementService( | 147 service_.reset(new DeviceManagementService( |
148 scoped_ptr<DeviceManagementService::Configuration>( | 148 scoped_ptr<DeviceManagementService::Configuration>( |
149 new MockDeviceManagementServiceConfiguration(service_url)))); | 149 new MockDeviceManagementServiceConfiguration(service_url)))); |
150 service_->ScheduleInitialization(0); | 150 service_->ScheduleInitialization(0); |
151 } | 151 } |
152 | 152 |
153 virtual void TearDownOnMainThread() override { | 153 void TearDownOnMainThread() override { |
154 service_.reset(); | 154 service_.reset(); |
155 test_server_.reset(); | 155 test_server_.reset(); |
156 interceptor_.reset(); | 156 interceptor_.reset(); |
157 } | 157 } |
158 | 158 |
159 void StartTestServer() { | 159 void StartTestServer() { |
160 test_server_.reset( | 160 test_server_.reset( |
161 new LocalPolicyTestServer("device_management_service_browsertest")); | 161 new LocalPolicyTestServer("device_management_service_browsertest")); |
162 ASSERT_TRUE(test_server_->Start()); | 162 ASSERT_TRUE(test_server_->Start()); |
163 } | 163 } |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 base::MessageLoop::current()->Run(); | 261 base::MessageLoop::current()->Run(); |
262 } | 262 } |
263 | 263 |
264 INSTANTIATE_TEST_CASE_P( | 264 INSTANTIATE_TEST_CASE_P( |
265 DeviceManagementServiceIntegrationTestInstance, | 265 DeviceManagementServiceIntegrationTestInstance, |
266 DeviceManagementServiceIntegrationTest, | 266 DeviceManagementServiceIntegrationTest, |
267 testing::Values(&DeviceManagementServiceIntegrationTest::InitCannedResponse, | 267 testing::Values(&DeviceManagementServiceIntegrationTest::InitCannedResponse, |
268 &DeviceManagementServiceIntegrationTest::InitTestServer)); | 268 &DeviceManagementServiceIntegrationTest::InitTestServer)); |
269 | 269 |
270 } // namespace policy | 270 } // namespace policy |
OLD | NEW |