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

Unified Diff: chrome/browser/sync_file_system/local/syncable_file_operation_runner_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/local/syncable_file_operation_runner_unittest.cc
diff --git a/chrome/browser/sync_file_system/local/syncable_file_operation_runner_unittest.cc b/chrome/browser/sync_file_system/local/syncable_file_operation_runner_unittest.cc
index 55d56545f02b80d86666ea8befe36a9655ae0a72..d99153af4ae81199308e94d312dbf30153d58188 100644
--- a/chrome/browser/sync_file_system/local/syncable_file_operation_runner_unittest.cc
+++ b/chrome/browser/sync_file_system/local/syncable_file_operation_runner_unittest.cc
@@ -21,6 +21,8 @@
#include "content/public/test/mock_blob_url_request_context.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"
#include "webkit/browser/fileapi/file_system_operation_runner.h"
@@ -48,7 +50,9 @@ class SyncableFileOperationRunnerTest : public testing::Test {
// operations in the tests.
SyncableFileOperationRunnerTest()
: thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP),
+ in_memory_env_(leveldb::NewMemEnv(leveldb::Env::Default())),
file_system_(GURL("http://example.com"),
+ in_memory_env_.get(),
base::MessageLoopProxy::current().get(),
base::MessageLoopProxy::current().get()),
callback_count_(0),
@@ -60,9 +64,11 @@ class SyncableFileOperationRunnerTest : public testing::Test {
virtual void SetUp() OVERRIDE {
ASSERT_TRUE(dir_.CreateUniqueTempDir());
+
file_system_.SetUp();
sync_context_ = new LocalFileSyncContext(
dir_.path(),
+ in_memory_env_.get(),
base::MessageLoopProxy::current().get(),
base::MessageLoopProxy::current().get());
ASSERT_EQ(
@@ -131,9 +137,11 @@ class SyncableFileOperationRunnerTest : public testing::Test {
}
ScopedEnableSyncFSDirectoryOperation enable_directory_operation_;
+ content::TestBrowserThreadBundle thread_bundle_;
+
base::ScopedTempDir dir_;
+ scoped_ptr<leveldb::Env> in_memory_env_;
- content::TestBrowserThreadBundle thread_bundle_;
CannedSyncableFileSystem file_system_;
scoped_refptr<LocalFileSyncContext> sync_context_;

Powered by Google App Engine
This is Rietveld 408576698