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

Unified Diff: webrtc/base/fileutils_unittest.cc

Issue 2894583002: Delete Filesystem::IterateDirectory and Filesystem::OpenFile. (Closed)
Patch Set: Check stream.Open return value. Created 3 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
« no previous file with comments | « webrtc/base/fileutils.cc ('k') | webrtc/base/unixfilesystem.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/fileutils_unittest.cc
diff --git a/webrtc/base/fileutils_unittest.cc b/webrtc/base/fileutils_unittest.cc
index a4e28507b80da22bd6c7e3512e8635837e537712..c9650e229ca7e0bf3c1c72b31edf3e9d0e47c79b 100644
--- a/webrtc/base/fileutils_unittest.cc
+++ b/webrtc/base/fileutils_unittest.cc
@@ -30,44 +30,4 @@ TEST(MAYBE_FilesystemTest, GetTemporaryFolder) {
EXPECT_TRUE(Filesystem::GetTemporaryFolder(path, true, nullptr));
}
-// Test creating a temp file, reading it back in, and deleting it.
-TEST(MAYBE_FilesystemTest, TestOpenFile) {
- Pathname path;
- EXPECT_TRUE(Filesystem::GetTemporaryFolder(path, true, nullptr));
- path.SetPathname(Filesystem::TempFilename(path, "ut"));
-
- FileStream* fs;
- char buf[256];
- size_t bytes;
-
- fs = Filesystem::OpenFile(path, "wb");
- ASSERT_TRUE(fs != nullptr);
- EXPECT_EQ(SR_SUCCESS, fs->Write("test", 4, &bytes, nullptr));
- EXPECT_EQ(4U, bytes);
- delete fs;
-
- EXPECT_TRUE(Filesystem::IsFile(path));
-
- fs = Filesystem::OpenFile(path, "rb");
- ASSERT_TRUE(fs != nullptr);
- EXPECT_EQ(SR_SUCCESS, fs->Read(buf, sizeof(buf), &bytes, nullptr));
- EXPECT_EQ(4U, bytes);
- delete fs;
-
- EXPECT_TRUE(Filesystem::DeleteFile(path));
- EXPECT_FALSE(Filesystem::IsFile(path));
-}
-
-// Test opening a non-existent file.
-TEST(MAYBE_FilesystemTest, TestOpenBadFile) {
- Pathname path;
- EXPECT_TRUE(Filesystem::GetTemporaryFolder(path, true, nullptr));
- path.SetFilename("not an actual file");
-
- EXPECT_FALSE(Filesystem::IsFile(path));
-
- FileStream* fs = Filesystem::OpenFile(path, "rb");
- EXPECT_FALSE(fs != nullptr);
-}
-
} // namespace rtc
« no previous file with comments | « webrtc/base/fileutils.cc ('k') | webrtc/base/unixfilesystem.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698