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

Unified Diff: chrome/browser/sync/api/fake_syncable_service.cc

Issue 9395058: [Sync] Remove SyncableServiceAdapter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/api/fake_syncable_service.cc
diff --git a/chrome/browser/sync/api/fake_syncable_service.cc b/chrome/browser/sync/api/fake_syncable_service.cc
new file mode 100644
index 0000000000000000000000000000000000000000..9823dbd1b551481c8e88b1efb3d24f268d058ccf
--- /dev/null
+++ b/chrome/browser/sync/api/fake_syncable_service.cc
@@ -0,0 +1,55 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/sync/api/fake_syncable_service.h"
+
+#include "base/location.h"
+
+FakeSyncableService::FakeSyncableService()
+ : syncing_(false),
+ type_(syncable::UNSPECIFIED) {}
+
+FakeSyncableService::~FakeSyncableService() {}
+
+void FakeSyncableService::set_merge_data_and_start_syncing_error(
+ const SyncError& error) {
+ merge_data_and_start_syncing_error_ = error;
+}
+
+void FakeSyncableService::set_process_sync_changes_error(
+ const SyncError& error) {
+ process_sync_changes_error_ = error;
+}
+
+bool FakeSyncableService::syncing() const {
+ return syncing_;
+}
+
+// SyncableService implementation.
+SyncError FakeSyncableService::MergeDataAndStartSyncing(
+ syncable::ModelType type,
+ const SyncDataList& initial_sync_data,
+ SyncChangeProcessor* sync_processor) {
+ sync_processor_.reset(sync_processor);
+ type_ = type;
+ if (!merge_data_and_start_syncing_error_.IsSet()) {
+ syncing_ = true;
+ }
+ return merge_data_and_start_syncing_error_;
+}
+
+void FakeSyncableService::StopSyncing(syncable::ModelType type) {
+ syncing_ = false;
+}
+
+SyncDataList FakeSyncableService::GetAllSyncData(
+ syncable::ModelType type) const {
+ return SyncDataList();
+}
+
+SyncError FakeSyncableService::ProcessSyncChanges(
+ const tracked_objects::Location& from_here,
+ const SyncChangeList& change_list) {
+ return process_sync_changes_error_;
+}
« no previous file with comments | « chrome/browser/sync/api/fake_syncable_service.h ('k') | chrome/browser/sync/glue/app_notification_data_type_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698