summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authoradamk@chromium.org <adamk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-03 22:20:13 +0000
committeradamk@chromium.org <adamk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-03 22:20:13 +0000
commit8659930676f733938efe086aedb9a19fb5d48f61 (patch)
tree079e7f9ffe207851315c39d079c9385fdba8a865 /ppapi
parent5933401aecca5c2a4be14e1b9566ce54af1fe9c0 (diff)
downloadchromium_src-8659930676f733938efe086aedb9a19fb5d48f61.zip
chromium_src-8659930676f733938efe086aedb9a19fb5d48f61.tar.gz
chromium_src-8659930676f733938efe086aedb9a19fb5d48f61.tar.bz2
Fix FileIO and FileRef PPAPI tests to match changes in
http://src.chromium.org/viewvc/chrome?view=rev&revision=71544, and try re-enabling them in the UI tests. Review URL: http://codereview.chromium.org/6410064 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73677 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/tests/test_file_io.cc25
-rw-r--r--ppapi/tests/test_file_ref.cc26
2 files changed, 26 insertions, 25 deletions
diff --git a/ppapi/tests/test_file_io.cc b/ppapi/tests/test_file_io.cc
index 9b12ed6..ec0172c 100644
--- a/ppapi/tests/test_file_io.cc
+++ b/ppapi/tests/test_file_io.cc
@@ -101,7 +101,7 @@ std::string TestFileIO::TestOpen() {
if (rv != PP_OK)
return ReportError("FileSystem::Open", rv);
- pp::FileIO_Dev file_io;
+ pp::FileIO_Dev file_io(instance_);
rv = file_io.Open(file_ref, PP_FILEOPENFLAG_CREATE, callback);
if (rv == PP_ERROR_WOULDBLOCK)
rv = callback.WaitForResult();
@@ -110,7 +110,7 @@ std::string TestFileIO::TestOpen() {
// Try opening a file that doesn't exist.
pp::FileRef_Dev nonexistent_file_ref(file_system, "/nonexistent_file");
- pp::FileIO_Dev nonexistent_file_io;
+ pp::FileIO_Dev nonexistent_file_io(instance_);
rv = nonexistent_file_io.Open(
nonexistent_file_ref, PP_FILEOPENFLAG_READ, callback);
if (rv == PP_ERROR_WOULDBLOCK)
@@ -132,7 +132,7 @@ std::string TestFileIO::TestReadWriteSetLength() {
if (rv != PP_OK)
return ReportError("FileSystem::Open", rv);
- pp::FileIO_Dev file_io;
+ pp::FileIO_Dev file_io(instance_);
rv = file_io.Open(file_ref,
PP_FILEOPENFLAG_CREATE |
PP_FILEOPENFLAG_READ |
@@ -246,7 +246,7 @@ std::string TestFileIO::TestTouchQuery() {
return ReportError("FileSystem::Open", rv);
pp::FileRef_Dev file_ref(file_system, "/file_touch");
- pp::FileIO_Dev file_io;
+ pp::FileIO_Dev file_io(instance_);
rv = file_io.Open(file_ref,
PP_FILEOPENFLAG_CREATE | PP_FILEOPENFLAG_WRITE,
callback);
@@ -309,7 +309,7 @@ std::string TestFileIO::TestAbortCalls() {
// First, create a file which to do ops on.
{
- pp::FileIO_Dev file_io;
+ pp::FileIO_Dev file_io(instance_);
rv = file_io.Open(file_ref,
PP_FILEOPENFLAG_CREATE | PP_FILEOPENFLAG_WRITE,
callback);
@@ -327,7 +327,8 @@ std::string TestFileIO::TestAbortCalls() {
// Abort |Open()|.
{
callback.reset_run_count();
- rv = pp::FileIO_Dev().Open(file_ref, PP_FILEOPENFLAG_READ, callback);
+ rv = pp::FileIO_Dev(instance_)
+ .Open(file_ref, PP_FILEOPENFLAG_READ,callback);
if (callback.run_count() > 0)
return "FileIO::Open ran callback synchronously.";
if (rv == PP_ERROR_WOULDBLOCK) {
@@ -343,7 +344,7 @@ std::string TestFileIO::TestAbortCalls() {
{
PP_FileInfo_Dev info = { 0 };
{
- pp::FileIO_Dev file_io;
+ pp::FileIO_Dev file_io(instance_);
rv = file_io.Open(file_ref, PP_FILEOPENFLAG_READ, callback);
if (rv == PP_ERROR_WOULDBLOCK)
rv = callback.WaitForResult();
@@ -370,7 +371,7 @@ std::string TestFileIO::TestAbortCalls() {
// Abort |Touch()|.
{
{
- pp::FileIO_Dev file_io;
+ pp::FileIO_Dev file_io(instance_);
rv = file_io.Open(file_ref, PP_FILEOPENFLAG_WRITE, callback);
if (rv == PP_ERROR_WOULDBLOCK)
rv = callback.WaitForResult();
@@ -393,7 +394,7 @@ std::string TestFileIO::TestAbortCalls() {
{
char buf[3] = { 0 };
{
- pp::FileIO_Dev file_io;
+ pp::FileIO_Dev file_io(instance_);
rv = file_io.Open(file_ref, PP_FILEOPENFLAG_READ, callback);
if (rv == PP_ERROR_WOULDBLOCK)
rv = callback.WaitForResult();
@@ -421,7 +422,7 @@ std::string TestFileIO::TestAbortCalls() {
{
char buf[3] = { 0 };
{
- pp::FileIO_Dev file_io;
+ pp::FileIO_Dev file_io(instance_);
rv = file_io.Open(file_ref, PP_FILEOPENFLAG_READ, callback);
if (rv == PP_ERROR_WOULDBLOCK)
rv = callback.WaitForResult();
@@ -443,7 +444,7 @@ std::string TestFileIO::TestAbortCalls() {
// Abort |SetLength()|.
{
{
- pp::FileIO_Dev file_io;
+ pp::FileIO_Dev file_io(instance_);
rv = file_io.Open(file_ref, PP_FILEOPENFLAG_READ, callback);
if (rv == PP_ERROR_WOULDBLOCK)
rv = callback.WaitForResult();
@@ -465,7 +466,7 @@ std::string TestFileIO::TestAbortCalls() {
// Abort |Flush()|.
{
{
- pp::FileIO_Dev file_io;
+ pp::FileIO_Dev file_io(instance_);
rv = file_io.Open(file_ref, PP_FILEOPENFLAG_READ, callback);
if (rv == PP_ERROR_WOULDBLOCK)
rv = callback.WaitForResult();
diff --git a/ppapi/tests/test_file_ref.cc b/ppapi/tests/test_file_ref.cc
index 06cc9ec..d3f137a 100644
--- a/ppapi/tests/test_file_ref.cc
+++ b/ppapi/tests/test_file_ref.cc
@@ -68,13 +68,13 @@ std::string TestFileRef::TestGetFileSystemType() {
if (file_ref_temp.GetFileSystemType() != PP_FILESYSTEMTYPE_LOCALTEMPORARY)
return "file_ref_temp expected to be temporary.";
- pp::URLRequestInfo request;
+ pp::URLRequestInfo request(instance_);
request.SetURL("test_url_loader_data/hello.txt");
request.SetStreamToFile(true);
TestCompletionCallback callback;
- pp::URLLoader loader(*instance_);
+ pp::URLLoader loader(instance_);
int32_t rv = loader.Open(request, callback);
if (rv == PP_ERROR_WOULDBLOCK)
rv = callback.WaitForResult();
@@ -117,13 +117,13 @@ std::string TestFileRef::TestGetName() {
if (name != "/")
return ReportMismatch("FileRef::GetName", name, "/");
- pp::URLRequestInfo request;
+ pp::URLRequestInfo request(instance_);
request.SetURL("test_url_loader_data/hello.txt");
request.SetStreamToFile(true);
TestCompletionCallback callback;
- pp::URLLoader loader(*instance_);
+ pp::URLLoader loader(instance_);
int32_t rv = loader.Open(request, callback);
if (rv == PP_ERROR_WOULDBLOCK)
rv = callback.WaitForResult();
@@ -161,13 +161,13 @@ std::string TestFileRef::TestGetPath() {
if (path != kTempFilePath)
return ReportMismatch("FileRef::GetPath", path, kTempFilePath);
- pp::URLRequestInfo request;
+ pp::URLRequestInfo request(instance_);
request.SetURL("test_url_loader_data/hello.txt");
request.SetStreamToFile(true);
TestCompletionCallback callback;
- pp::URLLoader loader(*instance_);
+ pp::URLLoader loader(instance_);
int32_t rv = loader.Open(request, callback);
if (rv == PP_ERROR_WOULDBLOCK)
rv = callback.WaitForResult();
@@ -216,13 +216,13 @@ std::string TestFileRef::TestGetParent() {
if (parent_path != "/")
return ReportMismatch("FileRef::GetParent", parent_path, "/");
- pp::URLRequestInfo request;
+ pp::URLRequestInfo request(instance_);
request.SetURL("test_url_loader_data/hello.txt");
request.SetStreamToFile(true);
TestCompletionCallback callback;
- pp::URLLoader loader(*instance_);
+ pp::URLLoader loader(instance_);
int32_t rv = loader.Open(request, callback);
if (rv == PP_ERROR_WOULDBLOCK)
rv = callback.WaitForResult();
@@ -337,7 +337,7 @@ std::string TestFileRef::TestQueryAndTouchFile() {
return ReportError("FileSystem::Open", rv);
pp::FileRef_Dev file_ref(file_system, "/file_touch");
- pp::FileIO_Dev file_io;
+ pp::FileIO_Dev file_io(instance_);
rv = file_io.Open(file_ref,
PP_FILEOPENFLAG_CREATE | PP_FILEOPENFLAG_WRITE,
callback);
@@ -421,7 +421,7 @@ std::string TestFileRef::TestDeleteFileAndDirectory() {
return ReportError("FileSystem::Open", rv);
pp::FileRef_Dev file_ref(file_system, "/file_delete");
- pp::FileIO_Dev file_io;
+ pp::FileIO_Dev file_io(instance_);
rv = file_io.Open(file_ref, PP_FILEOPENFLAG_CREATE, callback);
if (rv == PP_ERROR_WOULDBLOCK)
rv = callback.WaitForResult();
@@ -472,7 +472,7 @@ std::string TestFileRef::TestDeleteFileAndDirectory() {
// Delete aborted.
{
pp::FileRef_Dev file_ref_abort(file_system, "/file_delete_abort");
- pp::FileIO_Dev file_io_abort;
+ pp::FileIO_Dev file_io_abort(instance_);
rv = file_io_abort.Open(file_ref_abort, PP_FILEOPENFLAG_CREATE, callback);
if (rv == PP_ERROR_WOULDBLOCK)
rv = callback.WaitForResult();
@@ -505,7 +505,7 @@ std::string TestFileRef::TestRenameFileAndDirectory() {
return ReportError("FileSystem::Open", rv);
pp::FileRef_Dev file_ref(file_system, "/file_rename");
- pp::FileIO_Dev file_io;
+ pp::FileIO_Dev file_io(instance_);
rv = file_io.Open(file_ref, PP_FILEOPENFLAG_CREATE, callback);
if (rv == PP_ERROR_WOULDBLOCK)
rv = callback.WaitForResult();
@@ -554,7 +554,7 @@ std::string TestFileRef::TestRenameFileAndDirectory() {
"/target_file_rename_abort");
{
pp::FileRef_Dev file_ref_abort(file_system, "/file_rename_abort");
- pp::FileIO_Dev file_io_abort;
+ pp::FileIO_Dev file_io_abort(instance_);
rv = file_io_abort.Open(file_ref_abort, PP_FILEOPENFLAG_CREATE, callback);
if (rv == PP_ERROR_WOULDBLOCK)
rv = callback.WaitForResult();