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

Unified Diff: chrome/browser/sync/glue/fake_generic_change_processor.cc

Issue 9395058: [Sync] Remove SyncableServiceAdapter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/glue/fake_generic_change_processor.cc
diff --git a/chrome/browser/sync/glue/fake_generic_change_processor.cc b/chrome/browser/sync/glue/fake_generic_change_processor.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a39a3d7362451c074efbffd1cfaa0d935cce983c
--- /dev/null
+++ b/chrome/browser/sync/glue/fake_generic_change_processor.cc
@@ -0,0 +1,67 @@
+// 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/glue/fake_generic_change_processor.h"
+
+#include "base/location.h"
+#include "base/memory/weak_ptr.h"
+#include "chrome/browser/sync/api/syncable_service.h"
+
+namespace browser_sync {
+
+FakeGenericChangeProcessor::FakeGenericChangeProcessor()
+ : GenericChangeProcessor(NULL, base::WeakPtr<SyncableService>(), NULL)
+ sync_model_has_user_created_nodes_(true),
+ sync_model_has_user_created_nodes_success_(true),
+ crypto_ready_if_necessary_(true),
+ type_(syncable::UNSPECIFIED) {}
+FakeGenericChangeProcessor::~FakeGenericChangeProcessor() {}
akalin 2012/03/06 02:33:47 extra newline before
Nicolas Zea 2012/03/06 18:27:14 Done.
+
+void FakeGenericChangeProcessor::set_process_sync_changes_error(
+ const SyncError& error) {
+ process_sync_changes_error_ = error;
+}
+void FakeGenericChangeProcessor::set_get_sync_data_for_type_error(
+ const SyncError& error) {
+ get_sync_data_for_type_error_ = error;
+}
+void FakeGenericChangeProcessor::set_sync_model_has_user_created_nodes(
+ bool has_nodes) {
+ sync_model_has_user_created_nodes_ = has_nodes;
+}
+void FakeGenericChangeProcessor::set_sync_model_has_user_created_nodes_success(
+ bool success) {
+ sync_model_has_user_created_nodes_success_ = success;
+}
+void FakeGenericChangeProcessor::set_crypto_ready_if_necessary(
+ bool crypto_ready) {
+ crypto_ready_if_necessary_ = crypto_ready;
+}
+
+SyncError FakeGenericChangeProcessor::ProcessSyncChanges(
+ const tracked_objects::Location& from_here,
+ const SyncChangeList& change_list) {
+ return process_sync_changes_error_;
+}
+
+SyncError FakeGenericChangeProcessor::GetSyncDataForType(
+ syncable::ModelType type, SyncDataList* current_sync_data) {
+ type_ = type;
+ return get_sync_data_for_type_error_;
+}
+
+bool FakeGenericChangeProcessor::SyncModelHasUserCreatedNodes(
+ syncable::ModelType type, bool* has_nodes) {
+ type_ = type;
+ *has_nodes = sync_model_has_user_created_nodes_;
+ return sync_model_has_user_created_nodes_success_;
+}
+
+bool FakeGenericChangeProcessor::CryptoReadyIfNecessary(
+ syncable::ModelType type) {
+ type_ = type;
+ return crypto_ready_if_necessary_;
+}
+
+} // namespace browser_sync

Powered by Google App Engine
This is Rietveld 408576698