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/single_thread_task_runner.h" | 11 #include "base/single_thread_task_runner.h" |
12 #include "base/thread_task_runner_handle.h" | 12 #include "base/thread_task_runner_handle.h" |
13 #include "storage/browser/fileapi/file_system_url.h" | 13 #include "storage/browser/fileapi/file_system_url.h" |
14 #include "url/gurl.h" | 14 #include "url/gurl.h" |
15 | 15 |
16 using ::testing::_; | 16 using ::testing::_; |
17 using ::testing::Invoke; | 17 using ::testing::Invoke; |
18 using ::testing::Return; | 18 using ::testing::Return; |
19 | 19 |
20 namespace sync_file_system { | 20 namespace sync_file_system { |
21 | 21 |
22 MockRemoteFileSyncService::MockRemoteFileSyncService() | 22 MockRemoteFileSyncService::MockRemoteFileSyncService() |
23 : conflict_resolution_policy_(CONFLICT_RESOLUTION_POLICY_MANUAL), | 23 : state_(REMOTE_SERVICE_OK) { |
24 state_(REMOTE_SERVICE_OK) { | |
25 typedef MockRemoteFileSyncService self; | 24 typedef MockRemoteFileSyncService self; |
26 ON_CALL(*this, AddServiceObserver(_)) | 25 ON_CALL(*this, AddServiceObserver(_)) |
27 .WillByDefault(Invoke(this, &self::AddServiceObserverStub)); | 26 .WillByDefault(Invoke(this, &self::AddServiceObserverStub)); |
28 ON_CALL(*this, AddFileStatusObserver(_)) | 27 ON_CALL(*this, AddFileStatusObserver(_)) |
29 .WillByDefault(Invoke(this, &self::AddFileStatusObserverStub)); | 28 .WillByDefault(Invoke(this, &self::AddFileStatusObserverStub)); |
30 ON_CALL(*this, RegisterOrigin(_, _)) | 29 ON_CALL(*this, RegisterOrigin(_, _)) |
31 .WillByDefault(Invoke(this, &self::RegisterOriginStub)); | 30 .WillByDefault(Invoke(this, &self::RegisterOriginStub)); |
32 ON_CALL(*this, UninstallOrigin(_, _, _)) | 31 ON_CALL(*this, UninstallOrigin(_, _, _)) |
33 .WillByDefault( | 32 .WillByDefault( |
34 Invoke(this, &self::DeleteOriginDirectoryStub)); | 33 Invoke(this, &self::DeleteOriginDirectoryStub)); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 FROM_HERE, | 111 FROM_HERE, |
113 base::Bind( | 112 base::Bind( |
114 callback, SYNC_STATUS_NO_CHANGE_TO_SYNC, storage::FileSystemURL())); | 113 callback, SYNC_STATUS_NO_CHANGE_TO_SYNC, storage::FileSystemURL())); |
115 } | 114 } |
116 | 115 |
117 RemoteServiceState MockRemoteFileSyncService::GetCurrentStateStub() const { | 116 RemoteServiceState MockRemoteFileSyncService::GetCurrentStateStub() const { |
118 return state_; | 117 return state_; |
119 } | 118 } |
120 | 119 |
121 } // namespace sync_file_system | 120 } // namespace sync_file_system |
OLD | NEW |