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

Unified Diff: webkit/fileapi/quota_file_util_unittest.cc

Issue 7066033: Enable cross-filesystem moves and copies. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Readability tweak from Michael Created 9 years, 7 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: webkit/fileapi/quota_file_util_unittest.cc
diff --git a/webkit/fileapi/quota_file_util_unittest.cc b/webkit/fileapi/quota_file_util_unittest.cc
index 7921ae8558b606305982de9b5b21c03ae75f0898..3322bd6d51373f193400333f8703b5d3613cc0aa 100644
--- a/webkit/fileapi/quota_file_util_unittest.cc
+++ b/webkit/fileapi/quota_file_util_unittest.cc
@@ -32,24 +32,22 @@ class QuotaFileUtilTest : public testing::Test {
FilePath base_dir = data_dir_.path().AppendASCII("filesystem");
// For path translation we rely on LocalFileSystemFileUtil::GetLocalPath().
- test_helper_.SetUp(base_dir, LocalFileSystemFileUtil::GetInstance());
+ local_test_helper_.SetUp(base_dir, LocalFileSystemFileUtil::GetInstance());
+ quota_test_helper_.SetUp(base_dir, QuotaFileUtil::GetInstance());
}
void TearDown() {
- test_helper_.TearDown();
+ local_test_helper_.TearDown();
+ quota_test_helper_.TearDown();
}
protected:
FileSystemOperationContext* NewContext() {
- return test_helper_.NewOperationContext();
- }
-
- QuotaFileUtil* FileUtil() {
- return QuotaFileUtil::GetInstance();
+ return quota_test_helper_.NewOperationContext();
}
FilePath Path(const std::string& file_name) {
- return test_helper_.GetLocalPathFromASCII(file_name);
+ return local_test_helper_.GetLocalPathFromASCII(file_name);
}
base::PlatformFileError CreateFile(const char* file_name,
@@ -58,28 +56,26 @@ class QuotaFileUtilTest : public testing::Test {
base::PLATFORM_FILE_WRITE | base::PLATFORM_FILE_ASYNC;
scoped_ptr<FileSystemOperationContext> context(NewContext());
- return FileUtil()->CreateOrOpen(context.get(), Path(file_name),
- file_flags, file_handle, created);
+ return QuotaFileUtil::GetInstance()->CreateOrOpen(
+ context.get(), Path(file_name), file_flags, file_handle, created);
}
base::PlatformFileError EnsureFileExists(const char* file_name,
bool* created) {
scoped_ptr<FileSystemOperationContext> context(NewContext());
- return FileUtil()->EnsureFileExists(context.get(),
- Path(file_name), created);
+ return QuotaFileUtil::GetInstance()->EnsureFileExists(
+ context.get(), Path(file_name), created);
}
int64 GetCachedUsage() {
- return FileSystemUsageCache::GetUsage(test_helper_.GetUsageCachePath());
- }
-
- FileSystemContext* file_system_context() const {
- return test_helper_.file_system_context();
+ return FileSystemUsageCache::GetUsage(
+ quota_test_helper_.GetUsageCachePath());
}
private:
ScopedTempDir data_dir_;
- FileSystemTestOriginHelper test_helper_;
+ FileSystemTestOriginHelper local_test_helper_;
+ FileSystemTestOriginHelper quota_test_helper_;
base::ScopedCallbackFactory<QuotaFileUtilTest> callback_factory_;
DISALLOW_COPY_AND_ASSIGN(QuotaFileUtilTest);
@@ -95,7 +91,7 @@ TEST_F(QuotaFileUtilTest, CreateAndClose) {
scoped_ptr<FileSystemOperationContext> context(NewContext());
EXPECT_EQ(base::PLATFORM_FILE_OK,
- FileUtil()->Close(context.get(), file_handle));
+ QuotaFileUtil::GetInstance()->Close(context.get(), file_handle));
}
TEST_F(QuotaFileUtilTest, EnsureFileExists) {
« no previous file with comments | « webkit/fileapi/obfuscated_file_system_file_util_unittest.cc ('k') | webkit/tools/test_shell/test_shell.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698