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

Unified Diff: sync/api/sync_error_unittest.cc

Issue 388003002: Sync: Display non-severe errors on about:sync in gray color rather than red. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed failing unit test, added extra test case, addressed CR feedback. Created 6 years, 5 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') | no next file » | 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 4505ac78e91d9d1129029894bd73a537331f048e..a52461c2aa613d85ae74a4ddc8ee1e5a6ca28403 100644
--- a/sync/api/sync_error_unittest.cc
+++ b/sync/api/sync_error_unittest.cc
@@ -29,8 +29,24 @@ TEST_F(SyncErrorTest, Default) {
SyncError error(location, SyncError::DATATYPE_ERROR, msg, type);
ASSERT_TRUE(error.IsSet());
EXPECT_EQ(location.line_number(), error.location().line_number());
- EXPECT_EQ("datatype error was encountered: " + msg, error.message());
+ EXPECT_EQ("datatype error was encountered: ", error.GetMessagePrefix());
+ EXPECT_EQ(msg, error.message());
+ EXPECT_EQ(type, error.model_type());
+ EXPECT_EQ(SyncError::SYNC_ERROR_SEVERITY_ERROR, error.GetSeverity());
+}
+
+TEST_F(SyncErrorTest, LowSeverity) {
+ tracked_objects::Location location = FROM_HERE;
+ std::string msg = "test";
+ ModelType type = PREFERENCES;
+ SyncError error(location, SyncError::DATATYPE_POLICY_ERROR, msg, type);
+ ASSERT_TRUE(error.IsSet());
+ EXPECT_EQ(location.line_number(), error.location().line_number());
+ EXPECT_EQ("disabled due to configuration constraints: ",
+ error.GetMessagePrefix());
+ EXPECT_EQ(msg, error.message());
EXPECT_EQ(type, error.model_type());
+ EXPECT_EQ(SyncError::SYNC_ERROR_SEVERITY_INFO, error.GetSeverity());
}
TEST_F(SyncErrorTest, Reset) {
« no previous file with comments | « sync/api/sync_error.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698