summaryrefslogtreecommitdiffstats
path: root/ppapi/tests/test_file_ref.cc
diff options
context:
space:
mode:
authornhiroki@chromium.org <nhiroki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-13 11:41:40 +0000
committernhiroki@chromium.org <nhiroki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-13 11:41:40 +0000
commit7d0c1d8224d6a1ae41ffa6195cdf13d70f4bd437 (patch)
tree9abeed53de0f24f31400904b5adbd9ff52f065bc /ppapi/tests/test_file_ref.cc
parent015e37054a505efcdff6823c31fceca470416270 (diff)
downloadchromium_src-7d0c1d8224d6a1ae41ffa6195cdf13d70f4bd437.zip
chromium_src-7d0c1d8224d6a1ae41ffa6195cdf13d70f4bd437.tar.gz
chromium_src-7d0c1d8224d6a1ae41ffa6195cdf13d70f4bd437.tar.bz2
Implement Pepper proxy for PPB_DirectoryReader
This patch includes: - Adding proxy implementation (DircetoryReaderResource and PepperDirectoryReaderHost) - Merging PPB_DirectoryReader_impl into PepperDirectoryReaderHost BUG=106129 TEST=browser_tests --gtest_filter=\*DirectoryReader\* Review URL: https://chromiumcodereview.appspot.com/11958033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@182189 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/tests/test_file_ref.cc')
-rw-r--r--ppapi/tests/test_file_ref.cc45
1 files changed, 22 insertions, 23 deletions
diff --git a/ppapi/tests/test_file_ref.cc b/ppapi/tests/test_file_ref.cc
index fe70231..b1638b7 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();
}