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

Unified Diff: content/browser/fileapi/recursive_operation_delegate_unittest.cc

Issue 145303002: Convert Media Galleries to use base::File (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 11 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
Index: content/browser/fileapi/recursive_operation_delegate_unittest.cc
diff --git a/content/browser/fileapi/recursive_operation_delegate_unittest.cc b/content/browser/fileapi/recursive_operation_delegate_unittest.cc
index 397041f6fe208ff4ab1ed1522d0315732d2f09d9..a96a21213a23431842b025dd28bfc653db189cf0 100644
--- a/content/browser/fileapi/recursive_operation_delegate_unittest.cc
+++ b/content/browser/fileapi/recursive_operation_delegate_unittest.cc
@@ -71,13 +71,13 @@ class LoggingRecursiveOperation : public fileapi::RecursiveOperationDelegate {
virtual void ProcessDirectory(const FileSystemURL& url,
const StatusCallback& callback) OVERRIDE {
RecordLogEntry(LogEntry::PROCESS_DIRECTORY, url);
- callback.Run(base::PLATFORM_FILE_OK);
+ callback.Run(base::File::FILE_OK);
}
virtual void PostProcessDirectory(const FileSystemURL& url,
const StatusCallback& callback) OVERRIDE {
RecordLogEntry(LogEntry::POST_PROCESS_DIRECTORY, url);
- callback.Run(base::PLATFORM_FILE_OK);
+ callback.Run(base::File::FILE_OK);
}
private:
@@ -89,16 +89,16 @@ class LoggingRecursiveOperation : public fileapi::RecursiveOperationDelegate {
}
void DidGetMetadata(const StatusCallback& callback,
- base::PlatformFileError result,
- const base::PlatformFileInfo& file_info) {
- if (result != base::PLATFORM_FILE_OK) {
+ base::File::Error result,
+ const base::File::Info& file_info) {
+ if (result != base::File::FILE_OK) {
callback.Run(result);
return;
}
callback.Run(file_info.is_directory ?
- base::PLATFORM_FILE_ERROR_NOT_A_FILE :
- base::PLATFORM_FILE_OK);
+ base::File::FILE_ERROR_NOT_A_FILE :
+ base::File::FILE_OK);
}
FileSystemURL root_;
@@ -109,8 +109,8 @@ class LoggingRecursiveOperation : public fileapi::RecursiveOperationDelegate {
DISALLOW_COPY_AND_ASSIGN(LoggingRecursiveOperation);
};
-void ReportStatus(base::PlatformFileError* out_error,
- base::PlatformFileError error) {
+void ReportStatus(base::File::Error* out_error,
+ base::File::Error error) {
DCHECK(out_error);
*out_error = error;
}
@@ -161,7 +161,7 @@ class RecursiveOperationDelegateTest : public testing::Test {
FileSystemURL CreateFile(const std::string& path) {
FileSystemURL url = URLForPath(path);
bool created = false;
- EXPECT_EQ(base::PLATFORM_FILE_OK,
+ EXPECT_EQ(base::File::FILE_OK,
file_util()->EnsureFileExists(NewContext().get(),
url, &created));
EXPECT_TRUE(created);
@@ -170,7 +170,7 @@ class RecursiveOperationDelegateTest : public testing::Test {
FileSystemURL CreateDirectory(const std::string& path) {
FileSystemURL url = URLForPath(path);
- EXPECT_EQ(base::PLATFORM_FILE_OK,
+ EXPECT_EQ(base::File::FILE_OK,
file_util()->CreateDirectory(NewContext().get(), url,
false /* exclusive */, true));
return url;
@@ -187,7 +187,7 @@ class RecursiveOperationDelegateTest : public testing::Test {
TEST_F(RecursiveOperationDelegateTest, RootIsFile) {
FileSystemURL src_file(CreateFile("src"));
- base::PlatformFileError error = base::PLATFORM_FILE_ERROR_FAILED;
+ base::File::Error error = base::File::FILE_ERROR_FAILED;
scoped_ptr<FileSystemOperationContext> context = NewContext();
scoped_ptr<LoggingRecursiveOperation> operation(
new LoggingRecursiveOperation(
@@ -195,7 +195,7 @@ TEST_F(RecursiveOperationDelegateTest, RootIsFile) {
base::Bind(&ReportStatus, &error)));
operation->RunRecursively();
base::RunLoop().RunUntilIdle();
- ASSERT_EQ(base::PLATFORM_FILE_OK, error);
+ ASSERT_EQ(base::File::FILE_OK, error);
const std::vector<LoggingRecursiveOperation::LogEntry>& log_entries =
operation->log_entries();
@@ -212,7 +212,7 @@ TEST_F(RecursiveOperationDelegateTest, RootIsDirectory) {
FileSystemURL src_file2(CreateFile("src/dir1/file2"));
FileSystemURL src_file3(CreateFile("src/dir1/file3"));
- base::PlatformFileError error = base::PLATFORM_FILE_ERROR_FAILED;
+ base::File::Error error = base::File::FILE_ERROR_FAILED;
scoped_ptr<FileSystemOperationContext> context = NewContext();
scoped_ptr<LoggingRecursiveOperation> operation(
new LoggingRecursiveOperation(
@@ -220,7 +220,7 @@ TEST_F(RecursiveOperationDelegateTest, RootIsDirectory) {
base::Bind(&ReportStatus, &error)));
operation->RunRecursively();
base::RunLoop().RunUntilIdle();
- ASSERT_EQ(base::PLATFORM_FILE_OK, error);
+ ASSERT_EQ(base::File::FILE_OK, error);
const std::vector<LoggingRecursiveOperation::LogEntry>& log_entries =
operation->log_entries();
@@ -268,7 +268,7 @@ TEST_F(RecursiveOperationDelegateTest, Cancel) {
FileSystemURL src_file1(CreateFile("src/file1"));
FileSystemURL src_file2(CreateFile("src/dir1/file2"));
- base::PlatformFileError error = base::PLATFORM_FILE_ERROR_FAILED;
+ base::File::Error error = base::File::FILE_ERROR_FAILED;
scoped_ptr<FileSystemOperationContext> context = NewContext();
scoped_ptr<LoggingRecursiveOperation> operation(
new LoggingRecursiveOperation(
@@ -279,7 +279,7 @@ TEST_F(RecursiveOperationDelegateTest, Cancel) {
// Invoke Cancel(), after 5 times message posting.
CallCancelLater(operation.get(), 5);
base::RunLoop().RunUntilIdle();
- ASSERT_EQ(base::PLATFORM_FILE_ERROR_ABORT, error);
+ ASSERT_EQ(base::File::FILE_ERROR_ABORT, error);
}
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698