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

Side by Side Diff: chrome/browser/sync_file_system/mock_remote_file_sync_service.cc

Issue 286203007: [SyncFS] Drop manual conflict resolution policy support. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: drop more unused Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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"
(...skipping 17 matching lines...) Expand all
28 .WillByDefault(Invoke(this, &self::AddFileStatusObserverStub)); 28 .WillByDefault(Invoke(this, &self::AddFileStatusObserverStub));
29 ON_CALL(*this, RegisterOrigin(_, _)) 29 ON_CALL(*this, RegisterOrigin(_, _))
30 .WillByDefault(Invoke(this, &self::RegisterOriginStub)); 30 .WillByDefault(Invoke(this, &self::RegisterOriginStub));
31 ON_CALL(*this, UninstallOrigin(_, _, _)) 31 ON_CALL(*this, UninstallOrigin(_, _, _))
32 .WillByDefault( 32 .WillByDefault(
33 Invoke(this, &self::DeleteOriginDirectoryStub)); 33 Invoke(this, &self::DeleteOriginDirectoryStub));
34 ON_CALL(*this, ProcessRemoteChange(_)) 34 ON_CALL(*this, ProcessRemoteChange(_))
35 .WillByDefault(Invoke(this, &self::ProcessRemoteChangeStub)); 35 .WillByDefault(Invoke(this, &self::ProcessRemoteChangeStub));
36 ON_CALL(*this, GetLocalChangeProcessor()) 36 ON_CALL(*this, GetLocalChangeProcessor())
37 .WillByDefault(Return(&mock_local_change_processor_)); 37 .WillByDefault(Return(&mock_local_change_processor_));
38 ON_CALL(*this, IsConflicting(_))
39 .WillByDefault(Return(false));
40 ON_CALL(*this, GetCurrentState()) 38 ON_CALL(*this, GetCurrentState())
41 .WillByDefault(Invoke(this, &self::GetCurrentStateStub)); 39 .WillByDefault(Invoke(this, &self::GetCurrentStateStub));
42 ON_CALL(*this, SetDefaultConflictResolutionPolicy(_))
43 .WillByDefault(
44 Invoke(this, &self::SetDefaultConflictResolutionPolicyStub));
45 ON_CALL(*this, SetConflictResolutionPolicy(_, _))
46 .WillByDefault(Invoke(this, &self::SetConflictResolutionPolicyStub));
47 ON_CALL(*this, GetDefaultConflictResolutionPolicy())
48 .WillByDefault(
49 Invoke(this, &self::GetDefaultConflictResolutionPolicyStub));
50 ON_CALL(*this, GetConflictResolutionPolicy(_))
51 .WillByDefault(Invoke(this, &self::GetConflictResolutionPolicyStub));
52 } 40 }
53 41
54 MockRemoteFileSyncService::~MockRemoteFileSyncService() { 42 MockRemoteFileSyncService::~MockRemoteFileSyncService() {
55 } 43 }
56 44
57 void MockRemoteFileSyncService::DumpFiles(const GURL& origin, 45 void MockRemoteFileSyncService::DumpFiles(const GURL& origin,
58 const ListCallback& callback) { 46 const ListCallback& callback) {
59 callback.Run(scoped_ptr<base::ListValue>()); 47 callback.Run(scoped_ptr<base::ListValue>());
60 } 48 }
61 49
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 } 105 }
118 106
119 void MockRemoteFileSyncService::ProcessRemoteChangeStub( 107 void MockRemoteFileSyncService::ProcessRemoteChangeStub(
120 const SyncFileCallback& callback) { 108 const SyncFileCallback& callback) {
121 base::MessageLoopProxy::current()->PostTask( 109 base::MessageLoopProxy::current()->PostTask(
122 FROM_HERE, 110 FROM_HERE,
123 base::Bind(callback, SYNC_STATUS_NO_CHANGE_TO_SYNC, 111 base::Bind(callback, SYNC_STATUS_NO_CHANGE_TO_SYNC,
124 fileapi::FileSystemURL())); 112 fileapi::FileSystemURL()));
125 } 113 }
126 114
127 SyncStatusCode
128 MockRemoteFileSyncService::SetDefaultConflictResolutionPolicyStub(
129 ConflictResolutionPolicy policy) {
130 conflict_resolution_policy_ = policy;
131 return SYNC_STATUS_OK;
132 }
133
134 SyncStatusCode MockRemoteFileSyncService::SetConflictResolutionPolicyStub(
135 const GURL& origin,
136 ConflictResolutionPolicy policy) {
137 conflict_resolution_policy_ = policy;
138 return SYNC_STATUS_OK;
139 }
140
141 ConflictResolutionPolicy
142 MockRemoteFileSyncService::GetDefaultConflictResolutionPolicyStub() const {
143 return conflict_resolution_policy_;
144 }
145
146 ConflictResolutionPolicy
147 MockRemoteFileSyncService::GetConflictResolutionPolicyStub(
148 const GURL& origin) const {
149 return conflict_resolution_policy_;
150 }
151
152 RemoteServiceState MockRemoteFileSyncService::GetCurrentStateStub() const { 115 RemoteServiceState MockRemoteFileSyncService::GetCurrentStateStub() const {
153 return state_; 116 return state_;
154 } 117 }
155 118
156 } // namespace sync_file_system 119 } // namespace sync_file_system
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698