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 <stdint.h> | 5 #include <stdint.h> |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 class DeviceManagementServiceIntegrationTest | 97 class DeviceManagementServiceIntegrationTest |
98 : public InProcessBrowserTest, | 98 : public InProcessBrowserTest, |
99 public testing::WithParamInterface< | 99 public testing::WithParamInterface< |
100 std::string (DeviceManagementServiceIntegrationTest::*)(void)> { | 100 std::string (DeviceManagementServiceIntegrationTest::*)(void)> { |
101 public: | 101 public: |
102 MOCK_METHOD3(OnJobDone, void(DeviceManagementStatus, int, | 102 MOCK_METHOD3(OnJobDone, void(DeviceManagementStatus, int, |
103 const em::DeviceManagementResponse&)); | 103 const em::DeviceManagementResponse&)); |
104 | 104 |
105 std::string InitCannedResponse() { | 105 std::string InitCannedResponse() { |
106 interceptor_.reset(new TestRequestInterceptor( | 106 interceptor_.reset(new TestRequestInterceptor( |
107 "localhost", | 107 "localhost", BrowserThread::GetTaskRunnerForThread(BrowserThread::IO))); |
108 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))); | |
109 return "http://localhost"; | 108 return "http://localhost"; |
110 } | 109 } |
111 | 110 |
112 std::string InitTestServer() { | 111 std::string InitTestServer() { |
113 StartTestServer(); | 112 StartTestServer(); |
114 return test_server_->GetServiceURL().spec(); | 113 return test_server_->GetServiceURL().spec(); |
115 } | 114 } |
116 | 115 |
117 void RecordAuthCode(DeviceManagementStatus status, | 116 void RecordAuthCode(DeviceManagementStatus status, |
118 int net_error, | 117 int net_error, |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 base::RunLoop().Run(); | 261 base::RunLoop().Run(); |
263 } | 262 } |
264 | 263 |
265 INSTANTIATE_TEST_CASE_P( | 264 INSTANTIATE_TEST_CASE_P( |
266 DeviceManagementServiceIntegrationTestInstance, | 265 DeviceManagementServiceIntegrationTestInstance, |
267 DeviceManagementServiceIntegrationTest, | 266 DeviceManagementServiceIntegrationTest, |
268 testing::Values(&DeviceManagementServiceIntegrationTest::InitCannedResponse, | 267 testing::Values(&DeviceManagementServiceIntegrationTest::InitCannedResponse, |
269 &DeviceManagementServiceIntegrationTest::InitTestServer)); | 268 &DeviceManagementServiceIntegrationTest::InitTestServer)); |
270 | 269 |
271 } // namespace policy | 270 } // namespace policy |
OLD | NEW |