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

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

Issue 16109008: Cleanup: Deprecate DriveFileSyncService::kServiceName (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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"
11 #include "base/message_loop/message_loop_proxy.h" 11 #include "base/message_loop/message_loop_proxy.h"
12 #include "googleurl/src/gurl.h" 12 #include "googleurl/src/gurl.h"
13 #include "webkit/browser/fileapi/file_system_url.h" 13 #include "webkit/browser/fileapi/file_system_url.h"
14 14
15 using ::testing::_; 15 using ::testing::_;
16 using ::testing::Invoke; 16 using ::testing::Invoke;
17 using ::testing::Return; 17 using ::testing::Return;
18 18
19 namespace sync_file_system { 19 namespace sync_file_system {
20 20
21 const char MockRemoteFileSyncService::kServiceName[] = "mock_sync_service";
22
23 MockRemoteFileSyncService::MockRemoteFileSyncService() 21 MockRemoteFileSyncService::MockRemoteFileSyncService()
24 : conflict_resolution_policy_(CONFLICT_RESOLUTION_MANUAL) { 22 : conflict_resolution_policy_(CONFLICT_RESOLUTION_MANUAL) {
25 typedef MockRemoteFileSyncService self; 23 typedef MockRemoteFileSyncService self;
26 ON_CALL(*this, AddServiceObserver(_)) 24 ON_CALL(*this, AddServiceObserver(_))
27 .WillByDefault(Invoke(this, &self::AddServiceObserverStub)); 25 .WillByDefault(Invoke(this, &self::AddServiceObserverStub));
28 ON_CALL(*this, AddFileStatusObserver(_)) 26 ON_CALL(*this, AddFileStatusObserver(_))
29 .WillByDefault(Invoke(this, &self::AddFileStatusObserverStub)); 27 .WillByDefault(Invoke(this, &self::AddFileStatusObserverStub));
30 ON_CALL(*this, RegisterOriginForTrackingChanges(_, _)) 28 ON_CALL(*this, RegisterOriginForTrackingChanges(_, _))
31 .WillByDefault(Invoke(this, &self::RegisterOriginForTrackingChangesStub)); 29 .WillByDefault(Invoke(this, &self::RegisterOriginForTrackingChangesStub));
32 ON_CALL(*this, UnregisterOriginForTrackingChanges(_, _)) 30 ON_CALL(*this, UnregisterOriginForTrackingChanges(_, _))
33 .WillByDefault( 31 .WillByDefault(
34 Invoke(this, &self::UnregisterOriginForTrackingChangesStub)); 32 Invoke(this, &self::UnregisterOriginForTrackingChangesStub));
35 ON_CALL(*this, UninstallOrigin(_, _)) 33 ON_CALL(*this, UninstallOrigin(_, _))
36 .WillByDefault( 34 .WillByDefault(
37 Invoke(this, &self::DeleteOriginDirectoryStub)); 35 Invoke(this, &self::DeleteOriginDirectoryStub));
38 ON_CALL(*this, ProcessRemoteChange(_)) 36 ON_CALL(*this, ProcessRemoteChange(_))
39 .WillByDefault(Invoke(this, &self::ProcessRemoteChangeStub)); 37 .WillByDefault(Invoke(this, &self::ProcessRemoteChangeStub));
40 ON_CALL(*this, GetLocalChangeProcessor()) 38 ON_CALL(*this, GetLocalChangeProcessor())
41 .WillByDefault(Return(&mock_local_change_processor_)); 39 .WillByDefault(Return(&mock_local_change_processor_));
42 ON_CALL(*this, IsConflicting(_)) 40 ON_CALL(*this, IsConflicting(_))
43 .WillByDefault(Return(false)); 41 .WillByDefault(Return(false));
44 ON_CALL(*this, GetCurrentState()) 42 ON_CALL(*this, GetCurrentState())
45 .WillByDefault(Return(REMOTE_SERVICE_OK)); 43 .WillByDefault(Return(REMOTE_SERVICE_OK));
46 ON_CALL(*this, GetServiceName())
47 .WillByDefault(Return(kServiceName));
48 ON_CALL(*this, SetConflictResolutionPolicy(_)) 44 ON_CALL(*this, SetConflictResolutionPolicy(_))
49 .WillByDefault(Invoke(this, &self::SetConflictResolutionPolicyStub)); 45 .WillByDefault(Invoke(this, &self::SetConflictResolutionPolicyStub));
50 ON_CALL(*this, GetConflictResolutionPolicy()) 46 ON_CALL(*this, GetConflictResolutionPolicy())
51 .WillByDefault(Invoke(this, &self::GetConflictResolutionPolicyStub)); 47 .WillByDefault(Invoke(this, &self::GetConflictResolutionPolicyStub));
52 } 48 }
53 49
54 MockRemoteFileSyncService::~MockRemoteFileSyncService() { 50 MockRemoteFileSyncService::~MockRemoteFileSyncService() {
55 } 51 }
56 52
57 void MockRemoteFileSyncService::NotifyRemoteChangeQueueUpdated( 53 void MockRemoteFileSyncService::NotifyRemoteChangeQueueUpdated(
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 conflict_resolution_policy_ = policy; 119 conflict_resolution_policy_ = policy;
124 return SYNC_STATUS_OK; 120 return SYNC_STATUS_OK;
125 } 121 }
126 122
127 ConflictResolutionPolicy 123 ConflictResolutionPolicy
128 MockRemoteFileSyncService::GetConflictResolutionPolicyStub() const { 124 MockRemoteFileSyncService::GetConflictResolutionPolicyStub() const {
129 return conflict_resolution_policy_; 125 return conflict_resolution_policy_;
130 } 126 }
131 127
132 } // namespace sync_file_system 128 } // namespace sync_file_system
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698