| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/sync_file_system/mock_remote_file_sync_service.h" | 5 #include "chrome/browser/sync_file_system/mock_remote_file_sync_service.h" |
| 6 | 6 |
| 7 #include <string> |
| 8 |
| 7 #include "base/bind.h" | 9 #include "base/bind.h" |
| 8 #include "base/location.h" | 10 #include "base/location.h" |
| 9 #include "base/message_loop_proxy.h" | 11 #include "base/message_loop_proxy.h" |
| 10 #include "googleurl/src/gurl.h" | 12 #include "googleurl/src/gurl.h" |
| 11 #include "webkit/fileapi/file_system_url.h" | 13 #include "webkit/fileapi/file_system_url.h" |
| 12 #include "webkit/fileapi/syncable/sync_operation_type.h" | 14 #include "webkit/fileapi/syncable/sync_operation_type.h" |
| 13 | 15 |
| 14 using ::testing::_; | 16 using ::testing::_; |
| 15 using ::testing::Invoke; | 17 using ::testing::Invoke; |
| 16 using ::testing::Return; | 18 using ::testing::Return; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 38 .WillByDefault(Invoke(this, &self::GetConflictFilesStub)); | 40 .WillByDefault(Invoke(this, &self::GetConflictFilesStub)); |
| 39 ON_CALL(*this, GetRemoteFileMetadata(_, _)) | 41 ON_CALL(*this, GetRemoteFileMetadata(_, _)) |
| 40 .WillByDefault(Invoke(this, &self::GetRemoteFileMetadataStub)); | 42 .WillByDefault(Invoke(this, &self::GetRemoteFileMetadataStub)); |
| 41 ON_CALL(*this, GetCurrentState()) | 43 ON_CALL(*this, GetCurrentState()) |
| 42 .WillByDefault(Return(REMOTE_SERVICE_OK)); | 44 .WillByDefault(Return(REMOTE_SERVICE_OK)); |
| 43 } | 45 } |
| 44 | 46 |
| 45 MockRemoteFileSyncService::~MockRemoteFileSyncService() { | 47 MockRemoteFileSyncService::~MockRemoteFileSyncService() { |
| 46 } | 48 } |
| 47 | 49 |
| 48 void MockRemoteFileSyncService::NotifyRemoteChangeAvailable( | 50 void MockRemoteFileSyncService::NotifyRemoteChangeQueueUpdated( |
| 49 int64 pending_changes) { | 51 int64 pending_changes) { |
| 50 FOR_EACH_OBSERVER(Observer, observers_, | 52 FOR_EACH_OBSERVER(Observer, observers_, |
| 51 OnRemoteChangeAvailable(pending_changes)); | 53 OnRemoteChangeQueueUpdated(pending_changes)); |
| 52 } | 54 } |
| 53 | 55 |
| 54 void MockRemoteFileSyncService::NotifyRemoteServiceStateUpdated( | 56 void MockRemoteFileSyncService::NotifyRemoteServiceStateUpdated( |
| 55 RemoteServiceState state, | 57 RemoteServiceState state, |
| 56 const std::string& description) { | 58 const std::string& description) { |
| 57 FOR_EACH_OBSERVER(Observer, observers_, | 59 FOR_EACH_OBSERVER(Observer, observers_, |
| 58 OnRemoteServiceStateUpdated(state, description)); | 60 OnRemoteServiceStateUpdated(state, description)); |
| 59 } | 61 } |
| 60 | 62 |
| 61 void MockRemoteFileSyncService::AddObserverStub(Observer* observer) { | 63 void MockRemoteFileSyncService::AddObserverStub(Observer* observer) { |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 FROM_HERE, | 114 FROM_HERE, |
| 113 base::Bind(callback, fileapi::SYNC_FILE_ERROR_NOT_FOUND, | 115 base::Bind(callback, fileapi::SYNC_FILE_ERROR_NOT_FOUND, |
| 114 fileapi::SyncFileMetadata())); | 116 fileapi::SyncFileMetadata())); |
| 115 return; | 117 return; |
| 116 } | 118 } |
| 117 base::MessageLoopProxy::current()->PostTask( | 119 base::MessageLoopProxy::current()->PostTask( |
| 118 FROM_HERE, base::Bind(callback, fileapi::SYNC_STATUS_OK, iter->second)); | 120 FROM_HERE, base::Bind(callback, fileapi::SYNC_STATUS_OK, iter->second)); |
| 119 } | 121 } |
| 120 | 122 |
| 121 } // namespace sync_file_system | 123 } // namespace sync_file_system |
| OLD | NEW |