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

Unified Diff: sync/internal_api/model_type_store_backend_unittest.cc

Issue 1866243002: Convert //sync from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
Index: sync/internal_api/model_type_store_backend_unittest.cc
diff --git a/sync/internal_api/model_type_store_backend_unittest.cc b/sync/internal_api/model_type_store_backend_unittest.cc
index 4cc5aab8e6ff6a8b28ded1914e5d86374d9a1bf1..fe068f0e2d2ce51b9107dd604de655a4c5c6f0e8 100644
--- a/sync/internal_api/model_type_store_backend_unittest.cc
+++ b/sync/internal_api/model_type_store_backend_unittest.cc
@@ -23,8 +23,8 @@ class ModelTypeStoreBackendTest : public testing::Test {
void TearDown() override { in_memory_env_.reset(); }
- scoped_ptr<ModelTypeStoreBackend> CreateBackend() {
- scoped_ptr<ModelTypeStoreBackend> backend(new ModelTypeStoreBackend());
+ std::unique_ptr<ModelTypeStoreBackend> CreateBackend() {
+ std::unique_ptr<ModelTypeStoreBackend> backend(new ModelTypeStoreBackend());
std::string path;
in_memory_env_->GetTestDirectory(&path);
path += "/test_db";
@@ -34,16 +34,16 @@ class ModelTypeStoreBackendTest : public testing::Test {
}
protected:
- scoped_ptr<leveldb::Env> in_memory_env_;
+ std::unique_ptr<leveldb::Env> in_memory_env_;
};
// Test that after record is written to backend it can be read back even after
// backend is destroyed and recreated in the same environment.
TEST_F(ModelTypeStoreBackendTest, WriteThenRead) {
- scoped_ptr<ModelTypeStoreBackend> backend = CreateBackend();
+ std::unique_ptr<ModelTypeStoreBackend> backend = CreateBackend();
// Write record.
- scoped_ptr<leveldb::WriteBatch> write_batch(new leveldb::WriteBatch());
+ std::unique_ptr<leveldb::WriteBatch> write_batch(new leveldb::WriteBatch());
write_batch->Put("prefix:id1", "data1");
ModelTypeStore::Result result =
backend->WriteModifications(std::move(write_batch));
@@ -69,9 +69,9 @@ TEST_F(ModelTypeStoreBackendTest, WriteThenRead) {
// Test that ReadAllRecordsWithPrefix correclty filters records by prefix.
TEST_F(ModelTypeStoreBackendTest, ReadAllRecordsWithPrefix) {
- scoped_ptr<ModelTypeStoreBackend> backend = CreateBackend();
+ std::unique_ptr<ModelTypeStoreBackend> backend = CreateBackend();
- scoped_ptr<leveldb::WriteBatch> write_batch(new leveldb::WriteBatch());
+ std::unique_ptr<leveldb::WriteBatch> write_batch(new leveldb::WriteBatch());
write_batch->Put("prefix1:id1", "data1");
write_batch->Put("prefix2:id2", "data2");
ModelTypeStore::Result result =
@@ -89,10 +89,10 @@ TEST_F(ModelTypeStoreBackendTest, ReadAllRecordsWithPrefix) {
// Test that deleted records are correctly marked as milling in results of
// ReadRecordsWithPrefix.
TEST_F(ModelTypeStoreBackendTest, ReadDeletedRecord) {
- scoped_ptr<ModelTypeStoreBackend> backend = CreateBackend();
+ std::unique_ptr<ModelTypeStoreBackend> backend = CreateBackend();
// Create records, ensure they are returned by ReadRecordsWithPrefix.
- scoped_ptr<leveldb::WriteBatch> write_batch(new leveldb::WriteBatch());
+ std::unique_ptr<leveldb::WriteBatch> write_batch(new leveldb::WriteBatch());
write_batch->Put("prefix:id1", "data1");
write_batch->Put("prefix:id2", "data2");
ModelTypeStore::Result result =

Powered by Google App Engine
This is Rietveld 408576698