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

Unified Diff: third_party/crashpad/crashpad/util/file/file_io_test.cc

Issue 2349083002: Update Crashpad to 23d31c4fea61962e156f992889c6b041ad757d12 (Closed)
Patch Set: Created 4 years, 3 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: third_party/crashpad/crashpad/util/file/file_io_test.cc
diff --git a/third_party/crashpad/crashpad/util/file/file_io_test.cc b/third_party/crashpad/crashpad/util/file/file_io_test.cc
index 27ffd310da5cf6caf2d0330787e318fec0045568..b8444d4140cceba6b2c0f724b99dd9899c283b73 100644
--- a/third_party/crashpad/crashpad/util/file/file_io_test.cc
+++ b/third_party/crashpad/crashpad/util/file/file_io_test.cc
@@ -306,6 +306,24 @@ TEST(FileIO, SharedVsExclusives) {
LockingTest(FileLocking::kShared, FileLocking::kExclusive);
}
+TEST(FileIO, FileSizeByHandle) {
+ EXPECT_EQ(-1, LoggingFileSizeByHandle(kInvalidFileHandle));
+
+ ScopedTempDir temp_dir;
+ base::FilePath file_path =
+ temp_dir.path().Append(FILE_PATH_LITERAL("file_size"));
+
+ ScopedFileHandle file_handle(LoggingOpenFileForWrite(
+ file_path, FileWriteMode::kCreateOrFail, FilePermissions::kOwnerOnly));
+ ASSERT_NE(kInvalidFileHandle, file_handle.get());
+ EXPECT_EQ(0, LoggingFileSizeByHandle(file_handle.get()));
+
+ const char data[] = "zippyzap";
+ ASSERT_TRUE(LoggingWriteFile(file_handle.get(), &data, sizeof(data)));
+
+ EXPECT_EQ(9, LoggingFileSizeByHandle(file_handle.get()));
+}
+
} // namespace
} // namespace test
} // namespace crashpad
« no previous file with comments | « third_party/crashpad/crashpad/util/file/file_io_posix.cc ('k') | third_party/crashpad/crashpad/util/file/file_io_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698