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

Unified Diff: ppapi/tests/test_file_io.cc

Issue 16765005: Pepper: Add append support to FileIO. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment: M29 -> Chrome 29. Created 7 years, 6 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 | « ppapi/shared_impl/file_type_conversion.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/tests/test_file_io.cc
diff --git a/ppapi/tests/test_file_io.cc b/ppapi/tests/test_file_io.cc
index 50064192a43ca97e10d0031b01fe1b1327c10a6c..2d0da5c11994e95a7a43d6c8f2baadbfc8002174 100644
--- a/ppapi/tests/test_file_io.cc
+++ b/ppapi/tests/test_file_io.cc
@@ -6,6 +6,7 @@
#include <errno.h>
#include <fcntl.h>
+#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
@@ -414,6 +415,22 @@ std::string TestFileIO::TestReadWriteSetLength() {
ASSERT_EQ(PP_OK, rv);
ASSERT_EQ(std::string("testtest\0\0\0\0", 12), read_buffer);
+ // Append to the end of the file.
+ pp::FileIO file_io2(instance_);
+ callback.WaitForResult(file_io2.Open(file_ref,
+ PP_FILEOPENFLAG_CREATE |
+ PP_FILEOPENFLAG_READ |
+ PP_FILEOPENFLAG_APPEND,
+ callback.GetCallback()));
+ rv = WriteEntireBuffer(instance_->pp_instance(), &file_io2, 0, "appended",
+ callback_type());
+ ASSERT_EQ(PP_OK, rv);
+ read_buffer.clear();
+ rv = ReadEntireFile(instance_->pp_instance(), &file_io2, 0, &read_buffer,
+ callback_type());
+ ASSERT_EQ(PP_OK, rv);
+ ASSERT_EQ(std::string("testtesttest\0\0\0\0appended", 24), read_buffer);
+
PASS();
}
« no previous file with comments | « ppapi/shared_impl/file_type_conversion.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698