#ifndef CONTENT_PUBLIC_TEST_ASYNC_FILE_TEST_HELPER_H_
#define CONTENT_PUBLIC_TEST_ASYNC_FILE_TEST_HELPER_H_
#include "base/basictypes.h"
#include "webkit/browser/fileapi/file_system_operation.h"
#include "webkit/common/fileapi/file_system_types.h"
#include "webkit/common/quota/quota_status_code.h"
namespace quota {
class QuotaManager;
}
namespace fileapi {
class FileSystemContext;
class FileSystemURL;
}
namespace content {
class AsyncFileTestHelper {
public:
typedef fileapi::FileSystemOperation::FileEntryList FileEntryList;
typedef fileapi::FileSystemOperation::CopyProgressCallback
CopyProgressCallback;
static const int64 kDontCheckSize;
static base::File::Error Copy(fileapi::FileSystemContext* context,
const fileapi::FileSystemURL& src,
const fileapi::FileSystemURL& dest);
static base::File::Error CopyWithProgress(
fileapi::FileSystemContext* context,
const fileapi::FileSystemURL& src,
const fileapi::FileSystemURL& dest,
const CopyProgressCallback& progress_callback);
static base::File::Error Move(fileapi::FileSystemContext* context,
const fileapi::FileSystemURL& src,
const fileapi::FileSystemURL& dest);
static base::File::Error Remove(fileapi::FileSystemContext* context,
const fileapi::FileSystemURL& url,
bool recursive);
static base::File::Error ReadDirectory(fileapi::FileSystemContext* context,
const fileapi::FileSystemURL& url,
FileEntryList* entries);
static base::File::Error CreateDirectory(fileapi::FileSystemContext* context,
const fileapi::FileSystemURL& url);
static base::File::Error CreateFile(fileapi::FileSystemContext* context,
const fileapi::FileSystemURL& url);
static base::File::Error CreateFileWithData(
fileapi::FileSystemContext* context,
const fileapi::FileSystemURL& url,
const char* buf,
int buf_size);
static base::File::Error TruncateFile(fileapi::FileSystemContext* context,
const fileapi::FileSystemURL& url,
size_t size);
static base::File::Error GetMetadata(fileapi::FileSystemContext* context,
const fileapi::FileSystemURL& url,
base::File::Info* file_info);
static base::File::Error GetPlatformPath(fileapi::FileSystemContext* context,
const fileapi::FileSystemURL& url,
base::FilePath* platform_path);
static bool FileExists(fileapi::FileSystemContext* context,
const fileapi::FileSystemURL& url,
int64 size);
static bool DirectoryExists(fileapi::FileSystemContext* context,
const fileapi::FileSystemURL& url);
static quota::QuotaStatusCode GetUsageAndQuota(
quota::QuotaManager* quota_manager,
const GURL& origin,
fileapi::FileSystemType type,
int64* usage,
int64* quota);
};
}
#endif