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

Unified Diff: webkit/fileapi/local_file_util_unittest.cc

Issue 12209068: Retry: Introduce AsyncFileTestHelper for testing with async file/quota operations (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: original (reverted the gypi changes) Created 7 years, 10 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
« no previous file with comments | « webkit/fileapi/local_file_system_test_helper.cc ('k') | webkit/fileapi/obfuscated_file_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/local_file_util_unittest.cc
diff --git a/webkit/fileapi/local_file_util_unittest.cc b/webkit/fileapi/local_file_util_unittest.cc
index 0d7df0358790cd665c011acbf62d33fa513b4c7d..758268710475d9fa22f9df0a2e528ebc977694cd 100644
--- a/webkit/fileapi/local_file_util_unittest.cc
+++ b/webkit/fileapi/local_file_util_unittest.cc
@@ -12,6 +12,7 @@
#include "base/sys_string_conversions.h"
#include "base/utf_string_conversions.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "webkit/fileapi/async_file_test_helper.h"
#include "webkit/fileapi/file_system_context.h"
#include "webkit/fileapi/file_system_file_util.h"
#include "webkit/fileapi/file_system_operation_context.h"
@@ -94,6 +95,10 @@ class LocalFileUtilTest : public testing::Test {
return test_helper_;
}
+ FileSystemContext* file_system_context() {
+ return test_helper_.file_system_context();
+ }
+
private:
scoped_ptr<LocalFileUtil> local_file_util_;
base::ScopedTempDir data_dir_;
@@ -218,15 +223,14 @@ TEST_F(LocalFileUtilTest, CopyFile) {
EXPECT_TRUE(FileExists(from_file));
EXPECT_EQ(1020, GetSize(from_file));
- context.reset(NewContext());
ASSERT_EQ(base::PLATFORM_FILE_OK,
- test_helper().SameFileUtilCopy(context.get(),
- Path(from_file), Path(to_file1)));
+ AsyncFileTestHelper::Copy(file_system_context(),
+ Path(from_file), Path(to_file1)));
context.reset(NewContext());
ASSERT_EQ(base::PLATFORM_FILE_OK,
- test_helper().SameFileUtilCopy(context.get(),
- Path(from_file), Path(to_file2)));
+ AsyncFileTestHelper::Copy(file_system_context(),
+ Path(from_file), Path(to_file2)));
EXPECT_TRUE(FileExists(from_file));
EXPECT_EQ(1020, GetSize(from_file));
@@ -261,8 +265,8 @@ TEST_F(LocalFileUtilTest, CopyDirectory) {
context.reset(NewContext());
ASSERT_EQ(base::PLATFORM_FILE_OK,
- test_helper().SameFileUtilCopy(context.get(),
- Path(from_dir), Path(to_dir)));
+ AsyncFileTestHelper::Copy(file_system_context(),
+ Path(from_dir), Path(to_dir)));
EXPECT_TRUE(DirectoryExists(from_dir));
EXPECT_TRUE(FileExists(from_file));
@@ -289,8 +293,8 @@ TEST_F(LocalFileUtilTest, MoveFile) {
context.reset(NewContext());
ASSERT_EQ(base::PLATFORM_FILE_OK,
- test_helper().SameFileUtilMove(context.get(),
- Path(from_file), Path(to_file)));
+ AsyncFileTestHelper::Move(file_system_context(),
+ Path(from_file), Path(to_file)));
EXPECT_FALSE(FileExists(from_file));
EXPECT_TRUE(FileExists(to_file));
@@ -322,8 +326,8 @@ TEST_F(LocalFileUtilTest, MoveDirectory) {
context.reset(NewContext());
ASSERT_EQ(base::PLATFORM_FILE_OK,
- test_helper().SameFileUtilMove(context.get(),
- Path(from_dir), Path(to_dir)));
+ AsyncFileTestHelper::Move(file_system_context(),
+ Path(from_dir), Path(to_dir)));
EXPECT_FALSE(DirectoryExists(from_dir));
EXPECT_TRUE(DirectoryExists(to_dir));
« no previous file with comments | « webkit/fileapi/local_file_system_test_helper.cc ('k') | webkit/fileapi/obfuscated_file_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698