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

Unified Diff: webkit/fileapi/obfuscated_file_system_file_util_unittest.cc

Issue 7600022: Revert 95973 - Handle inconsistency between DB and Files in ObfuscatedFileSystemFileUtil (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 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/obfuscated_file_system_file_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/obfuscated_file_system_file_util_unittest.cc
===================================================================
--- webkit/fileapi/obfuscated_file_system_file_util_unittest.cc (revision 95983)
+++ webkit/fileapi/obfuscated_file_system_file_util_unittest.cc (working copy)
@@ -999,77 +999,3 @@
inserter(diff, diff.begin()));
EXPECT_TRUE(diff.empty());
}
-
-TEST_F(ObfuscatedFileSystemFileUtilTest, TestInconsistency) {
- const FilePath kPath1 = FilePath().AppendASCII("hoge");
- const FilePath kPath2 = FilePath().AppendASCII("fuga");
-
- scoped_ptr<FileSystemOperationContext> context;
- base::PlatformFile file;
- base::PlatformFileInfo file_info;
- FilePath data_path;
- bool created = false;
-
- // Create a non-empty file.
- context.reset(NewContext());
- EXPECT_EQ(base::PLATFORM_FILE_OK,
- ofsfu()->EnsureFileExists(context.get(), kPath1, &created));
- EXPECT_TRUE(created);
- context.reset(NewContext());
- EXPECT_EQ(base::PLATFORM_FILE_OK,
- ofsfu()->Truncate(context.get(), kPath1, 10));
- context.reset(NewContext());
- EXPECT_EQ(base::PLATFORM_FILE_OK,
- ofsfu()->GetFileInfo(
- context.get(), kPath1, &file_info, &data_path));
- EXPECT_EQ(10, file_info.size);
-
- // Destroy database to make inconsistency between database and filesystem.
- ofsfu()->DestroyDirectoryDatabase(origin_url(), type());
-
- // Try to get file info of broken file.
- context.reset(NewContext());
- EXPECT_FALSE(ofsfu()->PathExists(context.get(), kPath1));
- context.reset(NewContext());
- EXPECT_EQ(base::PLATFORM_FILE_OK,
- ofsfu()->EnsureFileExists(context.get(), kPath1, &created));
- EXPECT_TRUE(created);
- context.reset(NewContext());
- EXPECT_EQ(base::PLATFORM_FILE_OK,
- ofsfu()->GetFileInfo(
- context.get(), kPath1, &file_info, &data_path));
- EXPECT_EQ(0, file_info.size);
-
- // Make another broken file to |kPath2|.
- context.reset(NewContext());
- EXPECT_EQ(base::PLATFORM_FILE_OK,
- ofsfu()->EnsureFileExists(context.get(), kPath2, &created));
- EXPECT_TRUE(created);
-
- // Destroy again.
- ofsfu()->DestroyDirectoryDatabase(origin_url(), type());
-
- // Repair broken |kPath1|.
- context.reset(NewContext());
- EXPECT_EQ(base::PLATFORM_FILE_OK,
- ofsfu()->Touch(context.get(), kPath1, base::Time::Now(),
- base::Time::Now()));
-
- // Copy from sound |kPath1| to broken |kPath2|.
- context.reset(NewContext());
- EXPECT_EQ(base::PLATFORM_FILE_OK,
- ofsfu()->CopyOrMoveFile(context.get(), kPath1, kPath2,
- true /* copy */));
-
- ofsfu()->DestroyDirectoryDatabase(origin_url(), type());
- context.reset(NewContext());
- EXPECT_EQ(base::PLATFORM_FILE_OK,
- ofsfu()->CreateOrOpen(
- context.get(), kPath1,
- base::PLATFORM_FILE_WRITE | base::PLATFORM_FILE_CREATE,
- &file, &created));
- EXPECT_TRUE(created);
- EXPECT_TRUE(base::GetPlatformFileInfo(file, &file_info));
- EXPECT_EQ(0, file_info.size);
- EXPECT_TRUE(base::ClosePlatformFile(file));
-}
« no previous file with comments | « webkit/fileapi/obfuscated_file_system_file_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698