Chromium Code Reviews| 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 #ifndef CRYPTO_SCOPED_TEST_NSS_DB_H_ | |
| 6 #define CRYPTO_SCOPED_TEST_NSS_DB_H_ | |
| 7 | |
| 8 #include "base/files/scoped_temp_dir.h" | |
| 9 #include "base/macros.h" | |
| 10 #include "crypto/crypto_export.h" | |
| 11 #include "crypto/scoped_nss_types.h" | |
| 12 | |
| 13 namespace crypto { | |
| 14 | |
| 15 #if defined(USE_NSS) | |
|
Ryan Sleevi
2014/07/22 01:25:32
Use source controls to exclude this. Don't #ifdef.
pneubeck (no reviews)
2014/07/22 14:11:05
Done. I also added it to a new target crypto_test_
| |
| 16 // Exposed for tests only. | |
| 17 // Opens a persistent NSS database in a temporary directory. | |
| 18 // TODO(mattm): When NSS 3.14 is the minimum version required, | |
| 19 // switch back to using a separate user DB for each test. | |
| 20 // Because of https://bugzilla.mozilla.org/show_bug.cgi?id=588269 , the | |
| 21 // opened user DB is not automatically closed. | |
|
Ryan Sleevi
2014/07/22 01:25:32
Update this comment to 3.15.1 (we require 3.14.3,
pneubeck (no reviews)
2014/07/22 06:23:27
Actually, I'm not sure that I understand the part
Ryan Sleevi
2014/07/22 08:35:09
Followed-up offline, but for posterity:
Prior to
pneubeck (no reviews)
2014/07/22 14:11:05
This comment didn't apply anymore.
Updated the com
| |
| 22 class CRYPTO_EXPORT_PRIVATE ScopedTestNSSDB { | |
| 23 public: | |
| 24 ScopedTestNSSDB(); | |
| 25 ~ScopedTestNSSDB(); | |
| 26 | |
| 27 bool is_open() { return slot_; } | |
| 28 PK11SlotInfo* slot() { return slot_.get(); } | |
| 29 | |
| 30 private: | |
| 31 base::ScopedTempDir temp_dir_; | |
| 32 ScopedPK11Slot slot_; | |
| 33 | |
| 34 DISALLOW_COPY_AND_ASSIGN(ScopedTestNSSDB); | |
| 35 }; | |
| 36 #endif | |
| 37 | |
| 38 } // namespace crypto | |
| 39 | |
| 40 #endif // CRYPTO_SCOPED_TEST_NSS_DB_H_ | |
| OLD | NEW |