OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "crypto/scoped_test_nss_chromeos_user.h" | |
6 | |
7 #include "base/logging.h" | |
8 #include "crypto/nss_util.h" | |
9 #include "crypto/nss_util_internal.h" | |
10 #include "crypto/scoped_test_nss_db.h" | |
11 | |
12 namespace crypto { | |
13 | |
14 ScopedTestNSSChromeOSUser::ScopedTestNSSChromeOSUser( | |
15 const std::string& username_hash) | |
16 : username_hash_(username_hash), constructed_successfully_(false) { | |
17 if (!temp_dir_.CreateUniqueTempDir()) | |
18 return; | |
19 constructed_successfully_ = InitializeNSSForChromeOSUser( | |
20 username_hash, username_hash, temp_dir_.path()); | |
21 } | |
22 | |
23 ScopedTestNSSChromeOSUser::~ScopedTestNSSChromeOSUser() { | |
24 if (constructed_successfully_) | |
25 CloseChromeOSUserForTesting(username_hash_); | |
26 } | |
27 | |
28 void ScopedTestNSSChromeOSUser::FinishInit() { | |
29 DCHECK(constructed_successfully_); | |
30 if (!ShouldInitializeTPMForChromeOSUser(username_hash_)) | |
31 return; | |
32 WillInitializeTPMForChromeOSUser(username_hash_); | |
33 InitializePrivateSoftwareSlotForChromeOSUser(username_hash_); | |
Ryan Sleevi
2014/07/23 02:15:29
This doesn't look like testing code. Trying to und
pneubeck (no reviews)
2014/07/23 14:34:17
This is moved unmodified from nss_util.cc . If nec
| |
34 } | |
35 | |
36 } // namespace crypto | |
OLD | NEW |