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

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

Issue 1194783002: Add fileManagerPrivate.onCopyError event. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix broken test cases. Created 5 years, 6 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
« no previous file with comments | « content/browser/fileapi/fileapi_message_filter.cc ('k') | content/public/test/async_file_test_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ba712bba10955346d2d8cd4ba7a61c612ffdba1c..939f11f954f29ce67641916be52b168bc5aff823 100644
--- a/content/browser/fileapi/recursive_operation_delegate_unittest.cc
+++ b/content/browser/fileapi/recursive_operation_delegate_unittest.cc
@@ -53,10 +53,16 @@ class LoggingRecursiveOperation : public storage::RecursiveOperationDelegate {
// RecursiveOperationDelegate overrides.
void Run() override { NOTREACHED(); }
- void RunRecursively() override { StartRecursiveOperation(root_, callback_); }
+ void RunRecursively() override {
+ StartRecursiveOperation(
+ root_, storage::FileSystemOperation::ERROR_BEHAVIOR_TERMINATE,
+ callback_);
+ }
- void RunRecursivelyWithIgnoringError(const ErrorCallback& error_callback) {
- StartRecursiveOperationWithIgnoringError(root_, error_callback, callback_);
+ void RunRecursivelyWithIgnoringError() {
+ StartRecursiveOperation(
+ root_, storage::FileSystemOperation::ERROR_BEHAVIOR_CONTINUE,
+ callback_);
}
void ProcessFile(const FileSystemURL& url,
@@ -124,15 +130,6 @@ void ReportStatus(base::File::Error* out_error,
*out_error = error;
}
-typedef std::pair<FileSystemURL, base::File::Error> ErrorEntry;
-
-void ReportError(std::vector<ErrorEntry>* out_errors,
- const FileSystemURL& url,
- base::File::Error error) {
- DCHECK(out_errors);
- out_errors->push_back(std::make_pair(url, error));
-}
-
// To test the Cancel() during operation, calls Cancel() of |operation|
// after |counter| times message posting.
void CallCancelLater(storage::RecursiveOperationDelegate* operation,
@@ -342,23 +339,17 @@ TEST_F(RecursiveOperationDelegateTest, ContinueWithError) {
FileSystemURL src_file3(CreateFile("src/dir1/file3"));
base::File::Error error = base::File::FILE_ERROR_FAILED;
- std::vector<ErrorEntry> errors;
scoped_ptr<FileSystemOperationContext> context = NewContext();
scoped_ptr<LoggingRecursiveOperation> operation(
new LoggingRecursiveOperation(context->file_system_context(), src_root,
base::Bind(&ReportStatus, &error)));
operation->SetEntryToFail(src_file1);
- operation->RunRecursivelyWithIgnoringError(base::Bind(&ReportError, &errors));
+ operation->RunRecursivelyWithIgnoringError();
base::RunLoop().RunUntilIdle();
// Error code should be base::File::FILE_ERROR_FAILED.
ASSERT_EQ(base::File::FILE_ERROR_FAILED, error);
- // Error callback should be called.
- ASSERT_EQ(1U, errors.size());
- ASSERT_EQ(src_file1, errors[0].first);
- ASSERT_EQ(base::File::FILE_ERROR_FAILED, errors[0].second);
-
// Confirm that operation continues after the error.
const std::vector<LoggingRecursiveOperation::LogEntry>& log_entries =
operation->log_entries();
« no previous file with comments | « content/browser/fileapi/fileapi_message_filter.cc ('k') | content/public/test/async_file_test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698