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

Unified Diff: chrome/browser/sync_file_system/fake_remote_change_processor.cc

Issue 12391012: Sync FileSystem: Add simulated relaunch of DriveFileSyncService on its unit_tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: testfix for win7 Created 7 years, 10 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 | « chrome/browser/sync_file_system/drive_file_sync_service_sync_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync_file_system/fake_remote_change_processor.cc
diff --git a/chrome/browser/sync_file_system/fake_remote_change_processor.cc b/chrome/browser/sync_file_system/fake_remote_change_processor.cc
index 2cf436a9ae8c76a0790e681f5b783f65c710b98b..35906cc4e795d45c5a9c3d9c86a51ab97282cdb7 100644
--- a/chrome/browser/sync_file_system/fake_remote_change_processor.cc
+++ b/chrome/browser/sync_file_system/fake_remote_change_processor.cc
@@ -24,10 +24,23 @@ void FakeRemoteChangeProcessor::PrepareForProcessRemoteChange(
const fileapi::FileSystemURL& url,
const std::string& service_name,
const PrepareChangeCallback& callback) {
+ SyncFileMetadata local_metadata;
+
+ URLToFileChangesMap::iterator found = applied_changes_.find(url);
+ if (found != applied_changes_.end()) {
+ DCHECK(!found->second.empty());
+ const FileChange& applied_change = found->second.back();
+ if (applied_change.IsAddOrUpdate()) {
+ local_metadata = SyncFileMetadata(
+ applied_change.file_type(),
+ 100 /* size */,
+ base::Time::Now());
+ }
+ }
base::MessageLoopProxy::current()->PostTask(
FROM_HERE,
base::Bind(callback, SYNC_STATUS_OK,
- SyncFileMetadata(), FileChangeList()));
+ local_metadata, FileChangeList()));
}
void FakeRemoteChangeProcessor::ApplyRemoteChange(
« no previous file with comments | « chrome/browser/sync_file_system/drive_file_sync_service_sync_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698