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

Unified Diff: chrome/browser/sync_file_system/drive_backend/metadata_db_migration_util_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: chrome/browser/sync_file_system/drive_backend/metadata_db_migration_util_unittest.cc
diff --git a/chrome/browser/sync_file_system/drive_backend/metadata_db_migration_util_unittest.cc b/chrome/browser/sync_file_system/drive_backend/metadata_db_migration_util_unittest.cc
index a04b0d9379ff5e95b7cddd5893f9f2ba8dd4fd3d..4e62babb4caaebf52bcf345577eeb0770e0cf348 100644
--- a/chrome/browser/sync_file_system/drive_backend/metadata_db_migration_util_unittest.cc
+++ b/chrome/browser/sync_file_system/drive_backend/metadata_db_migration_util_unittest.cc
@@ -15,6 +15,7 @@
#include "storage/browser/fileapi/external_mount_points.h"
#include "storage/common/fileapi/file_system_util.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/write_batch.h"
#include "url/gurl.h"
@@ -71,7 +72,7 @@ TEST(DriveMetadataDBMigrationUtilTest, RollbackFromV4ToV3) {
const char kDemotedDirtyIDKeyPrefix[] = "DEMOTED_DIRTY: ";
// Set up environment.
- leveldb::DB* db_ptr = nullptr;
+ std::unique_ptr<leveldb::DB> db;
base::ScopedTempDir base_dir;
ASSERT_TRUE(base_dir.CreateUniqueTempDir());
{
@@ -79,10 +80,9 @@ TEST(DriveMetadataDBMigrationUtilTest, RollbackFromV4ToV3) {
options.create_if_missing = true;
std::string db_dir =
storage::FilePathToString(base_dir.GetPath().Append(kDatabaseName));
- leveldb::Status status = leveldb::DB::Open(options, db_dir, &db_ptr);
+ leveldb::Status status = leveldb_env::OpenDB(options, db_dir, &db);
ASSERT_TRUE(status.ok());
}
- std::unique_ptr<leveldb::DB> db(db_ptr);
// Setup the database with the schema version 4, without IDs.
leveldb::WriteBatch batch;

Powered by Google App Engine
This is Rietveld 408576698