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

Unified Diff: base/file_util_unittest.cc

Issue 189393002: net: Update FileStream to use base::File instead of PlatformFile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 9 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: base/file_util_unittest.cc
diff --git a/base/file_util_unittest.cc b/base/file_util_unittest.cc
index 8ee55ff4a7aed70857e44b3ce86a6fb610d962cf..b37865755f31eecadce58abcd41ca274ede1fbfe 100644
--- a/base/file_util_unittest.cc
+++ b/base/file_util_unittest.cc
@@ -2449,9 +2449,9 @@ TEST_F(FileUtilTest, ValidContentUriTest) {
// We should be able to read the file.
char* buffer = new char[image_size];
- int fd = OpenContentUriForRead(path);
- EXPECT_LT(0, fd);
- EXPECT_TRUE(ReadFromFD(fd, buffer, image_size));
+ File file = OpenContentUriForRead(path);
+ EXPECT_TRUE(file.IsValid());
+ EXPECT_TRUE(file.ReadAtCurrentPos(buffer, image_size));
delete[] buffer;
}
@@ -2464,8 +2464,8 @@ TEST_F(FileUtilTest, NonExistentContentUriTest) {
EXPECT_FALSE(GetFileSize(path, &size));
// We should not be able to read the file.
- int fd = OpenContentUriForRead(path);
- EXPECT_EQ(-1, fd);
+ File file = OpenContentUriForRead(path);
+ EXPECT_FALSE(file.IsValid());
}
#endif
« no previous file with comments | « base/file_util_posix.cc ('k') | base/files/file.h » ('j') | net/base/file_stream.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698