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

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

Issue 11602004: Cleanup: Remote metadata parameter from ApplyLocalChange (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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/sync_file_system/local_file_sync_service_unittest.cc
diff --git a/chrome/browser/sync_file_system/local_file_sync_service_unittest.cc b/chrome/browser/sync_file_system/local_file_sync_service_unittest.cc
index fd0dbbeffc39707a4eaa2b6e10ca37f632e7bc66..80b438b106dee09eadbfb28de6b6fb1648afeb2b 100644
--- a/chrome/browser/sync_file_system/local_file_sync_service_unittest.cc
+++ b/chrome/browser/sync_file_system/local_file_sync_service_unittest.cc
@@ -89,12 +89,12 @@ void OnGetFileMetadata(const tracked_objects::Location& where,
ACTION_P(MockStatusCallback, status) {
base::MessageLoopProxy::current()->PostTask(
- FROM_HERE, base::Bind(arg4, status));
+ FROM_HERE, base::Bind(arg3, status));
}
ACTION_P2(MockStatusCallbackAndRecordChange, status, changes) {
base::MessageLoopProxy::current()->PostTask(
- FROM_HERE, base::Bind(arg4, status));
+ FROM_HERE, base::Bind(arg3, status));
changes->push_back(arg0);
}
@@ -329,27 +329,19 @@ TEST_F(LocalFileSyncServiceTest, ProcessLocalChange_CreateFile) {
EXPECT_EQ(kTestFileDataSize,
file_system_->WriteString(kFile, std::string(kTestFileData)));
- // Retrieve the file metadata to set up the expected values.
+ // Retrieve the expected platform_path.
base::PlatformFileInfo info;
FilePath platform_path;
EXPECT_EQ(base::PLATFORM_FILE_OK,
file_system_->GetMetadata(kFile, &info, &platform_path));
- ASSERT_FALSE(info.is_directory);
- ASSERT_EQ(kTestFileDataSize, info.size);
-
- fileapi::SyncFileMetadata metadata;
- metadata.file_type = fileapi::SYNC_FILE_TYPE_FILE;
- metadata.size = info.size;
- metadata.last_modified = info.last_modified;
-
// The local_change_processor's ApplyLocalChange should be called once
// with ADD_OR_UPDATE change for TYPE_FILE.
StrictMock<MockLocalChangeProcessor> local_change_processor;
const FileChange change(FileChange::FILE_CHANGE_ADD_OR_UPDATE,
fileapi::SYNC_FILE_TYPE_FILE);
EXPECT_CALL(local_change_processor,
- ApplyLocalChange(change, platform_path, metadata, kFile, _))
+ ApplyLocalChange(change, platform_path, kFile, _))
.WillOnce(MockStatusCallback(fileapi::SYNC_STATUS_OK));
local_service_->ProcessLocalChange(
@@ -386,7 +378,7 @@ TEST_F(LocalFileSyncServiceTest, ProcessLocalChange_CreateAndRemoveFile) {
StrictMock<MockLocalChangeProcessor> local_change_processor;
const FileChange change(FileChange::FILE_CHANGE_DELETE,
fileapi::SYNC_FILE_TYPE_FILE);
- EXPECT_CALL(local_change_processor, ApplyLocalChange(change, _, _, kFile, _))
+ EXPECT_CALL(local_change_processor, ApplyLocalChange(change, _, kFile, _))
.WillOnce(MockStatusCallback(fileapi::SYNC_FILE_ERROR_NOT_FOUND));
// The sync should succeed anyway.
@@ -457,7 +449,7 @@ TEST_F(LocalFileSyncServiceTest, ProcessLocalChange_MultipleChanges) {
// twice for FILE_TYPE and FILE_DIRECTORY.
StrictMock<MockLocalChangeProcessor> local_change_processor;
std::vector<FileChange> changes;
- EXPECT_CALL(local_change_processor, ApplyLocalChange(_, _, _, kPath, _))
+ EXPECT_CALL(local_change_processor, ApplyLocalChange(_, _, kPath, _))
.Times(2)
.WillOnce(MockStatusCallbackAndRecordChange(fileapi::SYNC_STATUS_OK,
&changes))
@@ -546,7 +538,7 @@ TEST_F(LocalFileSyncServiceTest, RecordFakeChange) {
// Next local sync should pick up the recorded change.
StrictMock<MockLocalChangeProcessor> local_change_processor;
std::vector<FileChange> changes;
- EXPECT_CALL(local_change_processor, ApplyLocalChange(_, _, _, kURL, _))
+ EXPECT_CALL(local_change_processor, ApplyLocalChange(_, _, kURL, _))
.WillOnce(MockStatusCallbackAndRecordChange(fileapi::SYNC_STATUS_OK,
&changes));
{

Powered by Google App Engine
This is Rietveld 408576698