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

Unified Diff: chrome/browser/chromeos/drive/file_system/operation_test_base.h

Issue 372713004: Wait for parent directory sync before performing server-side copy (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add operation_observer.cc Created 6 years, 5 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: chrome/browser/chromeos/drive/file_system/operation_test_base.h
diff --git a/chrome/browser/chromeos/drive/file_system/operation_test_base.h b/chrome/browser/chromeos/drive/file_system/operation_test_base.h
index 26f9d023da2125ba2a5dbe2012d74950c56dd451..7a657e5fa2a8550770c54b6884c3abb272d55f31 100644
--- a/chrome/browser/chromeos/drive/file_system/operation_test_base.h
+++ b/chrome/browser/chromeos/drive/file_system/operation_test_base.h
@@ -48,6 +48,10 @@ class OperationTestBase : public testing::Test {
// OperationObserver that records all the events.
class LoggingObserver : public OperationObserver {
public:
+ typedef base::Callback<bool(
+ const std::string& local_id,
+ const FileOperationCallback& callback)> WaitForSyncCompleteHandler;
+
LoggingObserver();
~LoggingObserver();
@@ -58,6 +62,9 @@ class OperationTestBase : public testing::Test {
const std::string& local_id) OVERRIDE;
virtual void OnDriveSyncError(DriveSyncErrorType type,
const std::string& local_id) OVERRIDE;
+ virtual bool WaitForSyncComplete(
+ const std::string& local_id,
+ const FileOperationCallback& callback) OVERRIDE;
// Gets the set of changed paths.
const FileChange& get_changed_files() { return changed_files_; }
@@ -72,10 +79,17 @@ class OperationTestBase : public testing::Test {
return drive_sync_errors_;
}
+ // Sets the callback used to handle WaitForSyncComplete() method calls.
+ void set_wait_for_sync_complete_handler(
+ const WaitForSyncCompleteHandler& wait_for_sync_complete_handler) {
+ wait_for_sync_complete_handler_ = wait_for_sync_complete_handler;
+ }
+
private:
FileChange changed_files_;
std::set<std::string> updated_local_ids_;
std::vector<DriveSyncErrorType> drive_sync_errors_;
+ WaitForSyncCompleteHandler wait_for_sync_complete_handler_;
};
OperationTestBase();

Powered by Google App Engine
This is Rietveld 408576698