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

Unified Diff: sync/api/sync_error_unittest.cc

Issue 15701022: [Sync] Add support for sync Persistence Errors (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move bookmark change into separate patch Created 7 years, 6 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
« no previous file with comments | « sync/api/sync_error.cc ('k') | sync/api/sync_merge_result.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/api/sync_error_unittest.cc
diff --git a/sync/api/sync_error_unittest.cc b/sync/api/sync_error_unittest.cc
index 71a24f1396babfef77462c060251aa1d18a26dca..4505ac78e91d9d1129029894bd73a537331f048e 100644
--- a/sync/api/sync_error_unittest.cc
+++ b/sync/api/sync_error_unittest.cc
@@ -26,11 +26,11 @@ TEST_F(SyncErrorTest, Default) {
tracked_objects::Location location = FROM_HERE;
std::string msg = "test";
ModelType type = PREFERENCES;
- SyncError error(location, msg, type);
+ SyncError error(location, SyncError::DATATYPE_ERROR, msg, type);
ASSERT_TRUE(error.IsSet());
EXPECT_EQ(location.line_number(), error.location().line_number());
- EXPECT_EQ(msg, error.message());
- EXPECT_EQ(type, error.type());
+ EXPECT_EQ("datatype error was encountered: " + msg, error.message());
+ EXPECT_EQ(type, error.model_type());
}
TEST_F(SyncErrorTest, Reset) {
@@ -45,7 +45,7 @@ TEST_F(SyncErrorTest, Reset) {
ASSERT_TRUE(error.IsSet());
EXPECT_EQ(location.line_number(), error.location().line_number());
EXPECT_EQ(msg, error.message());
- EXPECT_EQ(type, error.type());
+ EXPECT_EQ(type, error.model_type());
tracked_objects::Location location2 = FROM_HERE;
std::string msg2 = "test";
@@ -54,7 +54,7 @@ TEST_F(SyncErrorTest, Reset) {
ASSERT_TRUE(error.IsSet());
EXPECT_EQ(location2.line_number(), error.location().line_number());
EXPECT_EQ(msg2, error.message());
- EXPECT_EQ(type2, error.type());
+ EXPECT_EQ(type2, error.model_type());
}
TEST_F(SyncErrorTest, Copy) {
@@ -71,13 +71,13 @@ TEST_F(SyncErrorTest, Copy) {
ASSERT_TRUE(error1.IsSet());
EXPECT_EQ(location.line_number(), error1.location().line_number());
EXPECT_EQ(msg, error1.message());
- EXPECT_EQ(type, error1.type());
+ EXPECT_EQ(type, error1.model_type());
SyncError error3(error1);
ASSERT_TRUE(error3.IsSet());
EXPECT_EQ(error1.location().line_number(), error3.location().line_number());
EXPECT_EQ(error1.message(), error3.message());
- EXPECT_EQ(error1.type(), error3.type());
+ EXPECT_EQ(error1.model_type(), error3.model_type());
SyncError error4;
EXPECT_FALSE(error4.IsSet());
@@ -100,13 +100,13 @@ TEST_F(SyncErrorTest, Assign) {
ASSERT_TRUE(error1.IsSet());
EXPECT_EQ(location.line_number(), error1.location().line_number());
EXPECT_EQ(msg, error1.message());
- EXPECT_EQ(type, error1.type());
+ EXPECT_EQ(type, error1.model_type());
error2 = error1;
ASSERT_TRUE(error2.IsSet());
EXPECT_EQ(error1.location().line_number(), error2.location().line_number());
EXPECT_EQ(error1.message(), error2.message());
- EXPECT_EQ(error1.type(), error2.type());
+ EXPECT_EQ(error1.model_type(), error2.model_type());
error2 = SyncError();
EXPECT_FALSE(error2.IsSet());
@@ -116,8 +116,10 @@ TEST_F(SyncErrorTest, ToString) {
tracked_objects::Location location = FROM_HERE;
std::string msg = "test";
ModelType type = PREFERENCES;
- std::string expected = "Preferences, Sync Error: test";
- SyncError error(location, msg, type);
+ std::string expected = std::string(ModelTypeToString(type)) +
+ " datatype error was encountered: " + msg;
+ LOG(INFO) << "Expect " << expected;
+ SyncError error(location, SyncError::DATATYPE_ERROR, msg, type);
EXPECT_TRUE(error.IsSet());
EXPECT_NE(string::npos, error.ToString().find(expected));
« no previous file with comments | « sync/api/sync_error.cc ('k') | sync/api/sync_merge_result.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698