| Index: crypto/scoped_test_system_nss_key_slot.cc
|
| diff --git a/crypto/scoped_test_system_nss_key_slot.cc b/crypto/scoped_test_system_nss_key_slot.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..2c85bde7ef43d636089a0a64c845e8ada527bcd5
|
| --- /dev/null
|
| +++ b/crypto/scoped_test_system_nss_key_slot.cc
|
| @@ -0,0 +1,28 @@
|
| +// Copyright 2014 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "crypto/scoped_test_system_nss_key_slot.h"
|
| +
|
| +#include "crypto/nss_util_internal.h"
|
| +#include "crypto/scoped_test_nss_db.h"
|
| +
|
| +namespace crypto {
|
| +
|
| +ScopedTestSystemNSSKeySlot::ScopedTestSystemNSSKeySlot()
|
| + : test_db_(new ScopedTestNSSDB) {
|
| + if (!test_db_->is_open())
|
| + return;
|
| + SetTestSystemKeySlot(
|
| + ScopedPK11Slot(PK11_ReferenceSlot(test_db_->slot())));
|
| +}
|
| +
|
| +ScopedTestSystemNSSKeySlot::~ScopedTestSystemNSSKeySlot() {
|
| + SetTestSystemKeySlot(ScopedPK11Slot());
|
| +}
|
| +
|
| +bool ScopedTestSystemNSSKeySlot::ConstructedSuccessfully() const {
|
| + return test_db_->is_open();
|
| +}
|
| +
|
| +} // namespace crypto
|
|
|