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

Unified Diff: chrome/browser/sync/glue/generic_change_processor_fake.h

Issue 9395058: [Sync] Remove SyncableServiceAdapter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Self review 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/glue/generic_change_processor_fake.h
diff --git a/chrome/browser/sync/glue/generic_change_processor_fake.h b/chrome/browser/sync/glue/generic_change_processor_fake.h
new file mode 100644
index 0000000000000000000000000000000000000000..50cd00babc7ce9b1a3ad5fbbd44327d57ed6bef5
--- /dev/null
+++ b/chrome/browser/sync/glue/generic_change_processor_fake.h
@@ -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.
+
+#ifndef CHROME_BROWSER_SYNC_GLUE_GENERIC_CHANGE_PROCESSOR_FAKE_H_
+#define CHROME_BROWSER_SYNC_GLUE_GENERIC_CHANGE_PROCESSOR_FAKE_H_
+#pragma once
+
+#include "chrome/browser/sync/glue/generic_change_processor.h"
+
+namespace browser_sync {
+
+// A fake GenericChangeProcessor that can return arbitrary values.
+class GenericChangeProcessorFake : public GenericChangeProcessor {
+ public:
+ GenericChangeProcessorFake();
+ virtual ~GenericChangeProcessorFake();
+
+ // Reset all the GenericChangeProcessor results.
+ void Reset();
+
+ // Setters for GenericChangeProcessor results.
+ // Return value for ProcessSyncChanges.
+ void set_process_success(bool success);
+ // Return value for GetSyncDataForType.
+ void set_get_sync_data_success(bool success);
+ // Value stored into |has_nodes| for SyncModelHasUserCreatedNodes.
+ void set_has_nodes(bool has_nodes);
+ // Return value for SyncModelHasUserCreatedNodes.
+ void set_has_nodes_success(bool success);
+ // Return value for CryptoReadyIfNecessary.
+ void set_crypto_ready(bool crypto_ready);
+
+ // GenericChangeProcessor implementations.
+ virtual SyncError ProcessSyncChanges(
+ const tracked_objects::Location& from_here,
+ const SyncChangeList& change_list) OVERRIDE;
+ virtual SyncError GetSyncDataForType(
+ syncable::ModelType type, SyncDataList* current_sync_data) OVERRIDE;
+ virtual bool SyncModelHasUserCreatedNodes(syncable::ModelType type,
+ bool* has_nodes) OVERRIDE;
+ virtual bool CryptoReadyIfNecessary(syncable::ModelType type) OVERRIDE;
+
+ private:
+ bool process_success_;
+ bool get_sync_data_success_;
+ bool has_nodes_;
+ bool has_nodes_success_;
+ bool crypto_ready_;
+ syncable::ModelType type_;
+};
+
+} // namespace browser_sync
+
+#endif // CHROME_BROWSER_SYNC_GLUE_GENERIC_CHANGE_PROCESSOR_FAKE_H_

Powered by Google App Engine
This is Rietveld 408576698