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

Unified Diff: chrome/browser/sync_file_system/drive_backend_v1/drive_file_sync_service_sync_unittest.cc

Issue 145693005: [FileAPI] Replace default leveldb::Env with leveldb::MemEnv in tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 11 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_v1/drive_file_sync_service_sync_unittest.cc
diff --git a/chrome/browser/sync_file_system/drive_backend_v1/drive_file_sync_service_sync_unittest.cc b/chrome/browser/sync_file_system/drive_backend_v1/drive_file_sync_service_sync_unittest.cc
index dc6c7719902f17362d8f001845882d305c9a1465..e04e189832d7e612fcfe11866be5d48d121a0166 100644
--- a/chrome/browser/sync_file_system/drive_backend_v1/drive_file_sync_service_sync_unittest.cc
+++ b/chrome/browser/sync_file_system/drive_backend_v1/drive_file_sync_service_sync_unittest.cc
@@ -28,6 +28,8 @@
#include "content/public/test/test_browser_thread.h"
#include "content/public/test/test_browser_thread_bundle.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "third_party/leveldatabase/src/helpers/memenv/memenv.h"
+#include "third_party/leveldatabase/src/include/leveldb/env.h"
#include "webkit/browser/fileapi/file_system_context.h"
#define FPL(path) FILE_PATH_LITERAL(path)
@@ -53,9 +55,11 @@ class DriveFileSyncServiceSyncTest : public testing::Test {
virtual void SetUp() OVERRIDE {
// TODO(tzik): Set up TestExtensionSystem to support simulated relaunch.
+ in_memory_env_.reset(leveldb::NewMemEnv(leveldb::Env::Default()));
RegisterSyncableFileSystem();
- local_sync_service_.reset(new LocalFileSyncService(&profile_));
+ local_sync_service_ = LocalFileSyncService::CreateForTesting(
+ &profile_, in_memory_env_.get());
fake_drive_service_ = new drive::FakeDriveService();
fake_drive_service_->Initialize("test_user@gmail.com");
@@ -120,6 +124,7 @@ class DriveFileSyncServiceSyncTest : public testing::Test {
if (!ContainsKey(file_systems_, origin)) {
CannedSyncableFileSystem* file_system = new CannedSyncableFileSystem(
origin,
+ in_memory_env_.get(),
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO).get(),
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)
.get());
@@ -357,6 +362,7 @@ class DriveFileSyncServiceSyncTest : public testing::Test {
content::TestBrowserThreadBundle thread_bundle_;
+ scoped_ptr<leveldb::Env> in_memory_env_;
TestingProfile profile_;
drive::FakeDriveService* fake_drive_service_;

Powered by Google App Engine
This is Rietveld 408576698