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

Unified Diff: chrome/browser/sync_file_system/local/local_file_change_tracker_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/local_file_change_tracker_unittest.cc
diff --git a/chrome/browser/sync_file_system/local/local_file_change_tracker_unittest.cc b/chrome/browser/sync_file_system/local/local_file_change_tracker_unittest.cc
index 037dce9717f76dc5ce53b10a365e0b786d171926..72af885d97ac0c7ae5a65379e2a61453d71db4cf 100644
--- a/chrome/browser/sync_file_system/local/local_file_change_tracker_unittest.cc
+++ b/chrome/browser/sync_file_system/local/local_file_change_tracker_unittest.cc
@@ -20,6 +20,8 @@
#include "chrome/browser/sync_file_system/syncable_file_system_util.h"
#include "content/public/test/mock_blob_url_request_context.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/quota/quota_manager.h"
@@ -34,7 +36,9 @@ namespace sync_file_system {
class LocalFileChangeTrackerTest : public testing::Test {
public:
LocalFileChangeTrackerTest()
- : file_system_(GURL("http://example.com"),
+ : 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()) {}
@@ -43,6 +47,7 @@ class LocalFileChangeTrackerTest : public testing::Test {
sync_context_ =
new LocalFileSyncContext(base::FilePath(),
+ in_memory_env_.get(),
base::MessageLoopProxy::current().get(),
base::MessageLoopProxy::current().get());
ASSERT_EQ(
@@ -106,6 +111,7 @@ class LocalFileChangeTrackerTest : public testing::Test {
ScopedEnableSyncFSDirectoryOperation enable_directory_operation_;
base::MessageLoopForIO message_loop_;
+ scoped_ptr<leveldb::Env> in_memory_env_;
CannedSyncableFileSystem file_system_;
private:

Powered by Google App Engine
This is Rietveld 408576698