Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2299)

Unified Diff: net/extras/sqlite/sqlite_channel_id_store_unittest.cc

Issue 2095523002: Make //crypto factories return std::unique_ptr<>s (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: I'm blind Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/cdm/aes_decryptor.cc ('k') | net/spdy/spdy_test_util_common.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/extras/sqlite/sqlite_channel_id_store_unittest.cc
diff --git a/net/extras/sqlite/sqlite_channel_id_store_unittest.cc b/net/extras/sqlite/sqlite_channel_id_store_unittest.cc
index f3c5f9bf8c2cd5cfb5eaa5bc0106673c0982ad33..98c2d96c1d5bf0d8398baeeebdf3ebdc377a4074 100644
--- a/net/extras/sqlite/sqlite_channel_id_store_unittest.cc
+++ b/net/extras/sqlite/sqlite_channel_id_store_unittest.cc
@@ -10,7 +10,6 @@
#include "base/bind.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
-#include "base/memory/ptr_util.h"
#include "base/memory/ref_counted.h"
#include "base/run_loop.h"
#include "base/threading/thread_task_runner_handle.h"
@@ -66,8 +65,8 @@ class SQLiteChannelIDStoreTest : public testing::Test {
ASSERT_TRUE(asn1::ExtractSPKIFromDERCert(*cert_data, &spki));
std::vector<uint8_t> public_key(spki.size());
memcpy(public_key.data(), spki.data(), spki.size());
- key->reset(crypto::ECPrivateKey::CreateFromEncryptedPrivateKeyInfo(
- ChannelIDService::kEPKIPassword, private_key, public_key));
+ *key = crypto::ECPrivateKey::CreateFromEncryptedPrivateKeyInfo(
+ ChannelIDService::kEPKIPassword, private_key, public_key);
}
static base::Time GetTestCertExpirationTime() {
@@ -111,10 +110,9 @@ class SQLiteChannelIDStoreTest : public testing::Test {
Load(&channel_ids);
ASSERT_EQ(0u, channel_ids.size());
// Make sure the store gets written at least once.
- google_key_.reset(crypto::ECPrivateKey::Create());
+ google_key_ = crypto::ECPrivateKey::Create();
store_->AddChannelID(DefaultChannelIDStore::ChannelID(
- "google.com", base::Time::FromInternalValue(1),
- base::WrapUnique(google_key_->Copy())));
+ "google.com", base::Time::FromInternalValue(1), google_key_->Copy()));
}
base::ScopedTempDir temp_dir_;
@@ -127,8 +125,7 @@ class SQLiteChannelIDStoreTest : public testing::Test {
TEST_F(SQLiteChannelIDStoreTest, TestPersistence) {
std::unique_ptr<crypto::ECPrivateKey> foo_key(crypto::ECPrivateKey::Create());
store_->AddChannelID(DefaultChannelIDStore::ChannelID(
- "foo.com", base::Time::FromInternalValue(3),
- base::WrapUnique(foo_key->Copy())));
+ "foo.com", base::Time::FromInternalValue(3), foo_key->Copy()));
std::vector<std::unique_ptr<DefaultChannelIDStore::ChannelID>> channel_ids;
// Replace the store effectively destroying the current one and forcing it
@@ -184,7 +181,7 @@ TEST_F(SQLiteChannelIDStoreTest, TestPersistence) {
TEST_F(SQLiteChannelIDStoreTest, TestDeleteAll) {
store_->AddChannelID(DefaultChannelIDStore::ChannelID(
"foo.com", base::Time::FromInternalValue(3),
- base::WrapUnique(crypto::ECPrivateKey::Create())));
+ crypto::ECPrivateKey::Create()));
std::vector<std::unique_ptr<DefaultChannelIDStore::ChannelID>> channel_ids;
// Replace the store effectively destroying the current one and forcing it
« no previous file with comments | « media/cdm/aes_decryptor.cc ('k') | net/spdy/spdy_test_util_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698