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

Unified Diff: components/sync/model/fake_model_type_change_processor.cc

Issue 2618483003: [Sync] Introduce ModelError for USS error handling. (Closed)
Patch Set: Address comments. Created 3 years, 11 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: components/sync/model/fake_model_type_change_processor.cc
diff --git a/components/sync/model/fake_model_type_change_processor.cc b/components/sync/model/fake_model_type_change_processor.cc
index e0df9d869a1ac6237a1a68b1f3e3a297102d2a54..d415437937139d3ab7d9dc15dcb0c05e763f082d 100644
--- a/components/sync/model/fake_model_type_change_processor.cc
+++ b/components/sync/model/fake_model_type_change_processor.cc
@@ -9,6 +9,7 @@
#include "components/sync/model/metadata_batch.h"
#include "components/sync/model/model_type_sync_bridge.h"
#include "components/sync/model/sync_error.h"
+#include "testing/gtest/include/gtest/gtest.h"
namespace syncer {
@@ -19,8 +20,12 @@ std::unique_ptr<ModelTypeChangeProcessor> FakeModelTypeChangeProcessor::Create(
return base::WrapUnique(new FakeModelTypeChangeProcessor());
}
-FakeModelTypeChangeProcessor::FakeModelTypeChangeProcessor() {}
-FakeModelTypeChangeProcessor::~FakeModelTypeChangeProcessor() {}
+FakeModelTypeChangeProcessor::FakeModelTypeChangeProcessor() = default;
+
+FakeModelTypeChangeProcessor::~FakeModelTypeChangeProcessor() {
+ // If this fails we were expecting an error but never got one.
+ EXPECT_FALSE(expect_error_);
+}
void FakeModelTypeChangeProcessor::Put(
const std::string& client_tag,
@@ -32,7 +37,6 @@ void FakeModelTypeChangeProcessor::Delete(
MetadataChangeList* metadata_change_list) {}
void FakeModelTypeChangeProcessor::OnMetadataLoaded(
- SyncError error,
std::unique_ptr<MetadataBatch> batch) {}
void FakeModelTypeChangeProcessor::OnSyncStarting(
@@ -49,10 +53,19 @@ bool FakeModelTypeChangeProcessor::IsTrackingMetadata() {
return true;
}
-SyncError FakeModelTypeChangeProcessor::CreateAndUploadError(
+void FakeModelTypeChangeProcessor::ReportError(const ModelError& error) {
+ EXPECT_TRUE(expect_error_);
+ expect_error_ = false;
+}
+
+void FakeModelTypeChangeProcessor::ReportError(
const tracked_objects::Location& location,
const std::string& message) {
- return SyncError();
+ ReportError(ModelError(location, message));
+}
+
+void FakeModelTypeChangeProcessor::ExpectError() {
+ expect_error_ = true;
}
} // namespace syncer
« no previous file with comments | « components/sync/model/fake_model_type_change_processor.h ('k') | components/sync/model/fake_model_type_sync_bridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698