| 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> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| 11 #include "base/message_loop/message_loop_proxy.h" | 11 #include "base/single_thread_task_runner.h" |
| 12 #include "base/thread_task_runner_handle.h" |
| 12 #include "url/gurl.h" | 13 #include "url/gurl.h" |
| 13 #include "webkit/browser/fileapi/file_system_url.h" | 14 #include "webkit/browser/fileapi/file_system_url.h" |
| 14 | 15 |
| 15 using ::testing::_; | 16 using ::testing::_; |
| 16 using ::testing::Invoke; | 17 using ::testing::Invoke; |
| 17 using ::testing::Return; | 18 using ::testing::Return; |
| 18 | 19 |
| 19 namespace sync_file_system { | 20 namespace sync_file_system { |
| 20 | 21 |
| 21 MockRemoteFileSyncService::MockRemoteFileSyncService() | 22 MockRemoteFileSyncService::MockRemoteFileSyncService() |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 } | 84 } |
| 84 | 85 |
| 85 void MockRemoteFileSyncService::AddFileStatusObserverStub( | 86 void MockRemoteFileSyncService::AddFileStatusObserverStub( |
| 86 FileStatusObserver* observer) { | 87 FileStatusObserver* observer) { |
| 87 file_status_observers_.AddObserver(observer); | 88 file_status_observers_.AddObserver(observer); |
| 88 } | 89 } |
| 89 | 90 |
| 90 void MockRemoteFileSyncService::RegisterOriginStub( | 91 void MockRemoteFileSyncService::RegisterOriginStub( |
| 91 const GURL& origin, | 92 const GURL& origin, |
| 92 const SyncStatusCallback& callback) { | 93 const SyncStatusCallback& callback) { |
| 93 base::MessageLoopProxy::current()->PostTask( | 94 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 94 FROM_HERE, | 95 FROM_HERE, |
| 95 base::Bind(callback, SYNC_STATUS_OK)); | 96 base::Bind(callback, SYNC_STATUS_OK)); |
| 96 } | 97 } |
| 97 | 98 |
| 98 void MockRemoteFileSyncService::DeleteOriginDirectoryStub( | 99 void MockRemoteFileSyncService::DeleteOriginDirectoryStub( |
| 99 const GURL& origin, | 100 const GURL& origin, |
| 100 UninstallFlag flag, | 101 UninstallFlag flag, |
| 101 const SyncStatusCallback& callback) { | 102 const SyncStatusCallback& callback) { |
| 102 base::MessageLoopProxy::current()->PostTask( | 103 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 103 FROM_HERE, | 104 FROM_HERE, |
| 104 base::Bind(callback, SYNC_STATUS_OK)); | 105 base::Bind(callback, SYNC_STATUS_OK)); |
| 105 } | 106 } |
| 106 | 107 |
| 107 void MockRemoteFileSyncService::ProcessRemoteChangeStub( | 108 void MockRemoteFileSyncService::ProcessRemoteChangeStub( |
| 108 const SyncFileCallback& callback) { | 109 const SyncFileCallback& callback) { |
| 109 base::MessageLoopProxy::current()->PostTask( | 110 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 110 FROM_HERE, | 111 FROM_HERE, |
| 111 base::Bind(callback, SYNC_STATUS_NO_CHANGE_TO_SYNC, | 112 base::Bind(callback, SYNC_STATUS_NO_CHANGE_TO_SYNC, |
| 112 fileapi::FileSystemURL())); | 113 fileapi::FileSystemURL())); |
| 113 } | 114 } |
| 114 | 115 |
| 115 RemoteServiceState MockRemoteFileSyncService::GetCurrentStateStub() const { | 116 RemoteServiceState MockRemoteFileSyncService::GetCurrentStateStub() const { |
| 116 return state_; | 117 return state_; |
| 117 } | 118 } |
| 118 | 119 |
| 119 } // namespace sync_file_system | 120 } // namespace sync_file_system |
| OLD | NEW |