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

Unified Diff: webkit/browser/fileapi/copy_or_move_file_validator_unittest.cc

Issue 18565002: [FileSystem] Add another copy-or-move validation hook for post-write. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Simplify dest validation callbacks and delete dest file on error Created 7 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
Index: webkit/browser/fileapi/copy_or_move_file_validator_unittest.cc
diff --git a/webkit/browser/fileapi/copy_or_move_file_validator_unittest.cc b/webkit/browser/fileapi/copy_or_move_file_validator_unittest.cc
index b971fd57c1a9f0f72b517fc1a3e186d78b76e71c..6160a59f5c21247519c2b2ad3e850b3a88b7e28d 100644
--- a/webkit/browser/fileapi/copy_or_move_file_validator_unittest.cc
+++ b/webkit/browser/fileapi/copy_or_move_file_validator_unittest.cc
@@ -196,7 +196,9 @@ class TestCopyOrMoveFileValidatorFactory
public:
explicit TestCopyOrMoveFileValidator(bool all_valid)
vandebo (ex-Chrome) 2013/07/02 20:15:02 Looks like you need another parameter here and sev
Greg Billock 2013/07/03 16:08:27 Yes. I haven't added all that yet. Making sure thi
: result_(all_valid ? base::PLATFORM_FILE_OK
- : base::PLATFORM_FILE_ERROR_SECURITY) {
+ : base::PLATFORM_FILE_ERROR_SECURITY),
+ write_result_(all_valid ? base::PLATFORM_FILE_OK
+ : base::PLATFORM_FILE_ERROR_SECURITY) {
}
virtual ~TestCopyOrMoveFileValidator() {}
@@ -207,8 +209,17 @@ class TestCopyOrMoveFileValidatorFactory
FROM_HERE, base::Bind(result_callback, result_));
}
+ virtual void StartPostWriteValidation(
+ const base::FilePath& dest_platform_path,
+ const ResultCallback& result_callback) OVERRIDE {
+ // Post the result since a real validator must do work asynchronously.
+ base::MessageLoop::current()->PostTask(
+ FROM_HERE, base::Bind(result_callback, write_result_));
+ }
+
private:
base::PlatformFileError result_;
+ base::PlatformFileError write_result_;
DISALLOW_COPY_AND_ASSIGN(TestCopyOrMoveFileValidator);
};

Powered by Google App Engine
This is Rietveld 408576698