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

Unified Diff: components/sync/engine/attachments/on_disk_attachment_store_unittest.cc

Issue 2953473002: Use leveldb_env::OpenDB() to open leveldb databases. (Closed)
Patch Set: Rebase; add comments to CHECK() Created 3 years, 5 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: components/sync/engine/attachments/on_disk_attachment_store_unittest.cc
diff --git a/components/sync/engine/attachments/on_disk_attachment_store_unittest.cc b/components/sync/engine/attachments/on_disk_attachment_store_unittest.cc
index 640a1a88e2ee2b9abdd5a236effcec3a3ad3adc5..3554c4e70efb65b8f81814d074b8cee5cc5f1911 100644
--- a/components/sync/engine/attachments/on_disk_attachment_store_unittest.cc
+++ b/components/sync/engine/attachments/on_disk_attachment_store_unittest.cc
@@ -19,6 +19,7 @@
#include "components/sync/engine_impl/attachments/proto/attachment_store.pb.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "third_party/leveldatabase/env_chromium.h"
#include "third_party/leveldatabase/src/include/leveldb/db.h"
#include "third_party/leveldatabase/src/include/leveldb/options.h"
#include "third_party/leveldatabase/src/include/leveldb/slice.h"
@@ -103,13 +104,13 @@ class OnDiskAttachmentStoreSpecificTest : public testing::Test {
}
std::unique_ptr<leveldb::DB> OpenLevelDB() {
- leveldb::DB* db;
+ std::unique_ptr<leveldb::DB> db;
leveldb::Options options;
options.create_if_missing = true;
leveldb::Status s =
- leveldb::DB::Open(options, db_path_.AsUTF8Unsafe(), &db);
+ leveldb_env::OpenDB(options, db_path_.AsUTF8Unsafe(), &db);
EXPECT_TRUE(s.ok());
- return base::WrapUnique(db);
+ return db;
}
void UpdateRecord(const std::string& key, const std::string& content) {
« no previous file with comments | « components/sync/engine/attachments/on_disk_attachment_store.cc ('k') | components/sync/model_impl/model_type_store_backend.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698