| 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();
|
| }
|
|
|