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

Unified Diff: chrome/browser/sync_file_system/drive_backend/register_app_task_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/register_app_task_unittest.cc
diff --git a/chrome/browser/sync_file_system/drive_backend/register_app_task_unittest.cc b/chrome/browser/sync_file_system/drive_backend/register_app_task_unittest.cc
index c782eac0eb4147ccc60d97096b50bbd8a8789557..1748a98fe6d9a1991baba801268d5323273eb5d3 100644
--- a/chrome/browser/sync_file_system/drive_backend/register_app_task_unittest.cc
+++ b/chrome/browser/sync_file_system/drive_backend/register_app_task_unittest.cc
@@ -31,6 +31,7 @@
#include "content/public/test/test_browser_thread_bundle.h"
#include "google_apis/drive/drive_api_parser.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "third_party/leveldatabase/env_chromium.h"
#include "third_party/leveldatabase/src/helpers/memenv/memenv.h"
#include "third_party/leveldatabase/src/include/leveldb/db.h"
#include "third_party/leveldatabase/src/include/leveldb/env.h"
@@ -80,14 +81,14 @@ class RegisterAppTaskTest : public testing::Test {
protected:
std::unique_ptr<LevelDBWrapper> OpenLevelDB() {
- leveldb::DB* db = nullptr;
+ std::unique_ptr<leveldb::DB> db;
leveldb::Options options;
options.create_if_missing = true;
options.env = in_memory_env_.get();
- leveldb::Status status =
- leveldb::DB::Open(options, database_dir_.GetPath().AsUTF8Unsafe(), &db);
+ leveldb::Status status = leveldb_env::OpenDB(
+ options, database_dir_.GetPath().AsUTF8Unsafe(), &db);
EXPECT_TRUE(status.ok());
- return base::MakeUnique<LevelDBWrapper>(base::WrapUnique(db));
+ return base::MakeUnique<LevelDBWrapper>(std::move(db));
}
void SetUpInitialData(LevelDBWrapper* db) {

Powered by Google App Engine
This is Rietveld 408576698