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

Unified Diff: chrome/browser/sync/api/syncable_service_fake.h

Issue 9395058: [Sync] Remove SyncableServiceAdapter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase and address comments Created 8 years, 10 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/syncable_service_fake.h
diff --git a/chrome/browser/sync/api/syncable_service_fake.h b/chrome/browser/sync/api/syncable_service_fake.h
new file mode 100644
index 0000000000000000000000000000000000000000..3fb11e98201f893162a8548147cf13eda53e9cf6
--- /dev/null
+++ b/chrome/browser/sync/api/syncable_service_fake.h
@@ -0,0 +1,50 @@
+// 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.
+
+#ifndef CHROME_BROWSER_SYNC_API_SYNCABLE_SERVICE_FAKE_H_
+#define CHROME_BROWSER_SYNC_API_SYNCABLE_SERVICE_FAKE_H_
+#pragma once
+
+#include "chrome/browser/sync/api/syncable_service.h"
+
+// A fake SyncableService that can return arbitrary values and maintains the
+// syncing status.
+class SyncableServiceFake : public SyncableService {
akalin 2012/03/03 01:15:15 i always thought it should be FakeFoo and not FooF
Nicolas Zea 2012/03/05 21:59:30 Yeah, it does seem like that's more common. Done (
+ public:
+ SyncableServiceFake();
+ virtual ~SyncableServiceFake();
+
+ // Reset the SyncableService results.
+ void Reset();
akalin 2012/03/03 01:15:15 Hmm do we really need this function?
Nicolas Zea 2012/03/05 21:59:30 Had it there in case it would be useful for multip
+
+ // Setters for SyncableService implementation results.
+ // Whether to return an error for MergeDataAndStartSyncing.
+ void set_associate_success(bool success);
akalin 2012/03/03 01:15:15 what about make these something like: SetMergeDat
Nicolas Zea 2012/03/05 21:59:30 Done.
+ // Whether to return an error for ProcessSyncChanges.
+ void set_process_success(bool success);
+
+ // Whether we're syncing or not. Set on a successful MergeDataAndStartSyncing,
+ // reset on StopSyncing. False by default.
+ bool syncing() const;
+
+ // SyncableService implementation.
+ virtual SyncError MergeDataAndStartSyncing(
+ syncable::ModelType type,
+ const SyncDataList& initial_sync_data,
+ SyncChangeProcessor* sync_processor) OVERRIDE;
+ virtual void StopSyncing(syncable::ModelType type) OVERRIDE;
+ virtual SyncDataList GetAllSyncData(syncable::ModelType type) const OVERRIDE;
+ virtual SyncError ProcessSyncChanges(
+ const tracked_objects::Location& from_here,
+ const SyncChangeList& change_list) OVERRIDE;
+
+ private:
+ scoped_ptr<SyncChangeProcessor> sync_processor_;
+ bool associate_success_;
+ bool process_success_;
+ bool syncing_;
+ syncable::ModelType type_;
+};
+
+#endif // CHROME_BROWSER_SYNC_API_SYNCABLE_SERVICE_FAKE_H_

Powered by Google App Engine
This is Rietveld 408576698