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

Unified Diff: chrome/browser/sync/engine/syncer_proto_util_unittest.cc

Issue 7621085: Server directed error handling backend code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: For review. Created 9 years, 4 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/engine/syncer_proto_util_unittest.cc
diff --git a/chrome/browser/sync/engine/syncer_proto_util_unittest.cc b/chrome/browser/sync/engine/syncer_proto_util_unittest.cc
index 3e8b9c625748e2f76f02bff78ebdb0ce21dd8dbf..3c31ed7180c273d13dfbf965f3f3aa22c3ae28e7 100644
--- a/chrome/browser/sync/engine/syncer_proto_util_unittest.cc
+++ b/chrome/browser/sync/engine/syncer_proto_util_unittest.cc
@@ -237,4 +237,29 @@ TEST_F(SyncerProtoUtilTest, PostAndProcessHeaders) {
msg, &response));
}
+TEST_F(SyncerProtoUtilTest, ShouldRequestEarlyExit) {
+ sync_api::SyncError error;
+
+ error.error_type = sync_api::SUCCESS;
+ EXPECT_FALSE(browser_sync::ShouldRequestEarlyExit(error));
+
+ error.error_type = sync_api::MIGRATION_DONE;
+ EXPECT_FALSE(browser_sync::ShouldRequestEarlyExit(error));
+
+ error.error_type = sync_api::NOT_MY_BIRTHDAY;
+ EXPECT_TRUE(browser_sync::ShouldRequestEarlyExit(error));
+
+ error.error_type = sync_api::THROTTLED;
+ EXPECT_TRUE(browser_sync::ShouldRequestEarlyExit(error));
+
+ error.error_type = sync_api::CLEAR_PENDING;
+ EXPECT_TRUE(browser_sync::ShouldRequestEarlyExit(error));
+
+ error.error_type = sync_api::TRANSIENT_ERROR;
+ EXPECT_TRUE(browser_sync::ShouldRequestEarlyExit(error));
+
+ error.error_type = sync_api::INVALID_CREDENTIAL;
+ EXPECT_TRUE(browser_sync::ShouldRequestEarlyExit(error));
+}
+
} // namespace browser_sync

Powered by Google App Engine
This is Rietveld 408576698