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

Unified Diff: ppapi/tests/test_directory_reader.cc

Issue 6899055: PPAPI: Force async callback invocation option. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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/tests/test_case.cc ('k') | ppapi/tests/test_file_io.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/tests/test_directory_reader.cc
===================================================================
--- ppapi/tests/test_directory_reader.cc (revision 91178)
+++ ppapi/tests/test_directory_reader.cc (working copy)
@@ -80,10 +80,12 @@
}
std::string TestDirectoryReader::TestGetNextFile() {
- TestCompletionCallback callback(instance_->pp_instance());
+ TestCompletionCallback callback(instance_->pp_instance(), force_async_);
pp::FileSystem_Dev file_system(
instance_, PP_FILESYSTEMTYPE_LOCALTEMPORARY);
int32_t rv = file_system.Open(1024, callback);
+ if (force_async_ && rv != PP_OK_COMPLETIONPENDING)
+ return ReportError("FileSystem::Open force_async", rv);
if (rv == PP_OK_COMPLETIONPENDING)
rv = callback.WaitForResult();
if (rv != PP_OK)
@@ -100,6 +102,8 @@
return ReportError("DeleteDirectoryRecursively", rv);
rv = test_dir.MakeDirectory(callback);
+ if (force_async_ && rv != PP_OK_COMPLETIONPENDING)
+ return ReportError("FileRef::MakeDirectory force_async", rv);
if (rv == PP_OK_COMPLETIONPENDING)
rv = callback.WaitForResult();
if (rv != PP_OK)
@@ -113,6 +117,8 @@
pp::FileIO_Dev file_io(instance_);
rv = file_io.Open(file_ref, PP_FILEOPENFLAG_CREATE, callback);
+ if (force_async_ && rv != PP_OK_COMPLETIONPENDING)
+ return ReportError("FileIO::Open force_async", rv);
if (rv == PP_OK_COMPLETIONPENDING)
rv = callback.WaitForResult();
if (rv != PP_OK)
@@ -128,6 +134,8 @@
pp::FileRef_Dev file_ref(file_system, buffer);
rv = file_ref.MakeDirectory(callback);
+ if (force_async_ && rv != PP_OK_COMPLETIONPENDING)
+ return ReportError("FileRef::MakeDirectory force_async", rv);
if (rv == PP_OK_COMPLETIONPENDING)
rv = callback.WaitForResult();
if (rv != PP_OK)
@@ -144,6 +152,8 @@
pp::DirectoryEntry_Dev entry;
do {
rv = directory_reader.GetNextEntry(&entry, callback);
+ if (force_async_ && rv != PP_OK_COMPLETIONPENDING)
+ return ReportError("DirectoryReader::GetNextEntry force_async", rv);
if (rv == PP_OK_COMPLETIONPENDING)
rv = callback.WaitForResult();
if (rv != PP_OK)
@@ -188,6 +198,8 @@
callback.reset_run_count();
// Note that the directory reader will be deleted immediately.
rv = pp::DirectoryReader_Dev(test_dir).GetNextEntry(&entry, callback);
+ if (force_async_ && rv != PP_OK_COMPLETIONPENDING)
+ return ReportError("DirectoryReader::GetNextEntry force_async", rv);
if (callback.run_count() > 0)
return "DirectoryReader::GetNextEntry ran callback synchronously.";
« no previous file with comments | « ppapi/tests/test_case.cc ('k') | ppapi/tests/test_file_io.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698