OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <cryptohi.h> | 5 #include <cryptohi.h> |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "chrome/browser/chromeos/platform_keys/platform_keys_service.h" | 9 #include "chrome/browser/chromeos/platform_keys/platform_keys_service.h" |
10 #include "chrome/browser/chromeos/platform_keys/platform_keys_service_factory.h" | 10 #include "chrome/browser/chromeos/platform_keys/platform_keys_service_factory.h" |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 client_cert2_ = net::ImportClientCertAndKeyFromFile( | 155 client_cert2_ = net::ImportClientCertAndKeyFromFile( |
156 net::GetTestCertsDirectory(), "client_2.pem", "client_2.pk8", | 156 net::GetTestCertsDirectory(), "client_2.pem", "client_2.pk8", |
157 test_system_slot_->slot()); | 157 test_system_slot_->slot()); |
158 ASSERT_TRUE(client_cert2_.get()); | 158 ASSERT_TRUE(client_cert2_.get()); |
159 | 159 |
160 done_callback.Run(); | 160 done_callback.Run(); |
161 } | 161 } |
162 | 162 |
163 void SetUpTestSystemSlotOnIO(content::ResourceContext* context, | 163 void SetUpTestSystemSlotOnIO(content::ResourceContext* context, |
164 const base::Closure& done_callback) { | 164 const base::Closure& done_callback) { |
165 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); | 165 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); |
166 test_system_slot_.reset(new crypto::ScopedTestSystemNSSKeySlot()); | 166 test_system_slot_.reset(new crypto::ScopedTestSystemNSSKeySlot()); |
167 ASSERT_TRUE(test_system_slot_->ConstructedSuccessfully()); | 167 ASSERT_TRUE(test_system_slot_->ConstructedSuccessfully()); |
168 | 168 |
169 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, | 169 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, |
170 done_callback); | 170 done_callback); |
171 } | 171 } |
172 | 172 |
173 void TearDownTestSystemSlotOnIO(const base::Closure& done_callback) { | 173 void TearDownTestSystemSlotOnIO(const base::Closure& done_callback) { |
174 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); | 174 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); |
175 test_system_slot_.reset(); | 175 test_system_slot_.reset(); |
176 | 176 |
177 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, | 177 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, |
178 done_callback); | 178 done_callback); |
179 } | 179 } |
180 | 180 |
181 policy::DevicePolicyCrosTestHelper device_policy_test_helper_; | 181 policy::DevicePolicyCrosTestHelper device_policy_test_helper_; |
182 scoped_ptr<crypto::ScopedTestSystemNSSKeySlot> test_system_slot_; | 182 scoped_ptr<crypto::ScopedTestSystemNSSKeySlot> test_system_slot_; |
183 }; | 183 }; |
184 | 184 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 ASSERT_TRUE(RunExtensionTest("permissionTests")) << message_; | 240 ASSERT_TRUE(RunExtensionTest("permissionTests")) << message_; |
241 } | 241 } |
242 | 242 |
243 INSTANTIATE_TEST_CASE_P( | 243 INSTANTIATE_TEST_CASE_P( |
244 CheckSystemTokenAvailability, | 244 CheckSystemTokenAvailability, |
245 PlatformKeysTest, | 245 PlatformKeysTest, |
246 ::testing::Values( | 246 ::testing::Values( |
247 Params(DEVICE_STATUS_ENROLLED, USER_AFFILIATION_ENROLLED_DOMAIN), | 247 Params(DEVICE_STATUS_ENROLLED, USER_AFFILIATION_ENROLLED_DOMAIN), |
248 Params(DEVICE_STATUS_ENROLLED, USER_AFFILIATION_UNRELATED), | 248 Params(DEVICE_STATUS_ENROLLED, USER_AFFILIATION_UNRELATED), |
249 Params(DEVICE_STATUS_NOT_ENROLLED, USER_AFFILIATION_UNRELATED))); | 249 Params(DEVICE_STATUS_NOT_ENROLLED, USER_AFFILIATION_UNRELATED))); |
OLD | NEW |