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

Unified Diff: webrtc/base/file_unittest.cc

Issue 2533213005: Add File::Open / Create functions to take an rtc::Pathname (Closed)
Patch Set: Resolve review comments Created 4 years 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/file.cc ('k') | webrtc/base/fileutils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/file_unittest.cc
diff --git a/webrtc/base/file_unittest.cc b/webrtc/base/file_unittest.cc
index aa787c14c59138d478f88295909d284133241f81..d8800a55f438f3747c035e7410aeb25d0491a453 100644
--- a/webrtc/base/file_unittest.cc
+++ b/webrtc/base/file_unittest.cc
@@ -163,4 +163,30 @@ TEST_F(FileTest, RandomAccessReadWrite) {
EXPECT_TRUE(VerifyBuffer(out, 2, 0));
}
+TEST_F(FileTest, OpenFromPathname) {
+ {
+ File file = File::Open(Pathname(path_));
+ ASSERT_TRUE(file.IsOpen()) << "Error: " << LastError();
+ }
+
+ {
+ Pathname path(path_);
+ File file = File::Open(path);
+ ASSERT_TRUE(file.IsOpen()) << "Error: " << LastError();
+ }
+}
+
+TEST_F(FileTest, CreateFromPathname) {
+ {
+ File file = File::Create(Pathname(path_));
+ ASSERT_TRUE(file.IsOpen()) << "Error: " << LastError();
+ }
+
+ {
+ Pathname path(path_);
+ File file = File::Create(path);
+ ASSERT_TRUE(file.IsOpen()) << "Error: " << LastError();
+ }
+}
+
} // namespace rtc
« no previous file with comments | « webrtc/base/file.cc ('k') | webrtc/base/fileutils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698