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

Unified Diff: ppapi/tests/test_file_ref.cc

Issue 11958033: Implement Pepper proxy for PPB_DirectoryReader (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: test fix Created 7 years, 10 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/proxy/resource_creation_proxy.cc ('k') | ppapi/thunk/interfaces_ppb_public_dev.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/tests/test_file_ref.cc
diff --git a/ppapi/tests/test_file_ref.cc b/ppapi/tests/test_file_ref.cc
index fe7023180269facbd6e417136eeb3a65dab5303b..b1638b741f878e262637bd6d62be876a0bf82a36 100644
--- a/ppapi/tests/test_file_ref.cc
+++ b/ppapi/tests/test_file_ref.cc
@@ -681,10 +681,6 @@ std::string TestFileRef::TestRenameFileAndDirectory() {
#ifndef PPAPI_OS_NACL
std::string TestFileRef::TestFileNameEscaping() {
- // The directory methods we need only work in-process and not in NaCl for now.
- if (testing_interface_->IsOutOfProcess())
- PASS();
-
TestCompletionCallback callback(instance_->pp_instance(), force_async_);
pp::FileSystem file_system(instance_, PP_FILESYSTEMTYPE_LOCALTEMPORARY);
int32_t rv = file_system.Open(1024, callback);
@@ -718,26 +714,29 @@ std::string TestFileRef::TestFileNameEscaping() {
if (rv != PP_OK)
return ReportError("FileIO::Open", rv);
- pp::DirectoryReader_Dev directory_reader(test_dir_ref);
- pp::DirectoryEntry_Dev entry;
-
- rv = directory_reader.GetNextEntry(&entry, callback);
- if (rv == PP_OK_COMPLETIONPENDING)
- rv = callback.WaitForResult();
- if (rv != PP_OK && rv != PP_ERROR_FILENOTFOUND)
- return ReportError("DirectoryEntry_Dev::GetNextEntry", rv);
- if (entry.is_null())
- return "Entry was not found.";
- if (entry.file_ref().GetName().AsString() != kTerribleName)
- return "Entry name did not match.";
+ // DirectoryReader only works out-of-process.
+ if (testing_interface_->IsOutOfProcess()) {
+ pp::DirectoryReader_Dev directory_reader(test_dir_ref);
+ pp::DirectoryEntry_Dev entry;
- rv = directory_reader.GetNextEntry(&entry, callback);
- if (rv == PP_OK_COMPLETIONPENDING)
- rv = callback.WaitForResult();
- if (rv != PP_OK && rv != PP_ERROR_FILENOTFOUND)
- return ReportError("DirectoryEntry_Dev::GetNextEntry", rv);
- if (!entry.is_null())
- return "Directory had too many entries.";
+ rv = directory_reader.GetNextEntry(&entry, callback);
+ if (rv == PP_OK_COMPLETIONPENDING)
+ rv = callback.WaitForResult();
+ if (rv != PP_OK && rv != PP_ERROR_FILENOTFOUND)
+ return ReportError("DirectoryEntry_Dev::GetNextEntry", rv);
+ if (entry.is_null())
+ return "Entry was not found.";
+ if (entry.file_ref().GetName().AsString() != kTerribleName)
+ return "Entry name did not match.";
+
+ rv = directory_reader.GetNextEntry(&entry, callback);
+ if (rv == PP_OK_COMPLETIONPENDING)
+ rv = callback.WaitForResult();
+ if (rv != PP_OK && rv != PP_ERROR_FILENOTFOUND)
+ return ReportError("DirectoryEntry_Dev::GetNextEntry", rv);
+ if (!entry.is_null())
+ return "Directory had too many entries.";
+ }
PASS();
}
« no previous file with comments | « ppapi/proxy/resource_creation_proxy.cc ('k') | ppapi/thunk/interfaces_ppb_public_dev.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698