summaryrefslogtreecommitdiffstats
path: root/webkit/fileapi/local_file_util_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/fileapi/local_file_util_unittest.cc')
-rw-r--r--webkit/fileapi/local_file_util_unittest.cc21
1 files changed, 15 insertions, 6 deletions
diff --git a/webkit/fileapi/local_file_util_unittest.cc b/webkit/fileapi/local_file_util_unittest.cc
index 4851dc9..2f3493c5 100644
--- a/webkit/fileapi/local_file_util_unittest.cc
+++ b/webkit/fileapi/local_file_util_unittest.cc
@@ -90,6 +90,10 @@ class LocalFileUtilTest : public testing::Test {
Path(file_name), created);
}
+ const FileSystemTestOriginHelper& test_helper() const {
+ return test_helper_;
+ }
+
private:
scoped_ptr<LocalFileUtil> local_file_util_;
ScopedTempDir data_dir_;
@@ -150,8 +154,8 @@ TEST_F(LocalFileUtilTest, CopyFile) {
bool created;
ASSERT_EQ(base::PLATFORM_FILE_OK, EnsureFileExists(from_file, &created));
ASSERT_TRUE(created);
- scoped_ptr<FileSystemOperationContext> context;
+ scoped_ptr<FileSystemOperationContext> context;
context.reset(NewContext());
ASSERT_EQ(base::PLATFORM_FILE_OK,
FileUtil()->Truncate(context.get(), Path(from_file), 1020));
@@ -161,11 +165,13 @@ TEST_F(LocalFileUtilTest, CopyFile) {
context.reset(NewContext());
ASSERT_EQ(base::PLATFORM_FILE_OK,
- FileUtil()->Copy(context.get(), Path(from_file), Path(to_file1)));
+ test_helper().SameFileUtilCopy(context.get(),
+ Path(from_file), Path(to_file1)));
context.reset(NewContext());
ASSERT_EQ(base::PLATFORM_FILE_OK,
- FileUtil()->Copy(context.get(), Path(from_file), Path(to_file2)));
+ test_helper().SameFileUtilCopy(context.get(),
+ Path(from_file), Path(to_file2)));
EXPECT_TRUE(FileExists(from_file));
EXPECT_EQ(1020, GetSize(from_file));
@@ -200,7 +206,8 @@ TEST_F(LocalFileUtilTest, CopyDirectory) {
context.reset(NewContext());
ASSERT_EQ(base::PLATFORM_FILE_OK,
- FileUtil()->Copy(context.get(), Path(from_dir), Path(to_dir)));
+ test_helper().SameFileUtilCopy(context.get(),
+ Path(from_dir), Path(to_dir)));
EXPECT_TRUE(DirectoryExists(from_dir));
EXPECT_TRUE(FileExists(from_file));
@@ -227,7 +234,8 @@ TEST_F(LocalFileUtilTest, MoveFile) {
context.reset(NewContext());
ASSERT_EQ(base::PLATFORM_FILE_OK,
- FileUtil()->Move(context.get(), Path(from_file), Path(to_file)));
+ test_helper().SameFileUtilMove(context.get(),
+ Path(from_file), Path(to_file)));
EXPECT_FALSE(FileExists(from_file));
EXPECT_TRUE(FileExists(to_file));
@@ -259,7 +267,8 @@ TEST_F(LocalFileUtilTest, MoveDirectory) {
context.reset(NewContext());
ASSERT_EQ(base::PLATFORM_FILE_OK,
- FileUtil()->Move(context.get(), Path(from_dir), Path(to_dir)));
+ test_helper().SameFileUtilMove(context.get(),
+ Path(from_dir), Path(to_dir)));
EXPECT_FALSE(DirectoryExists(from_dir));
EXPECT_TRUE(DirectoryExists(to_dir));