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

Unified Diff: chrome/browser/signin/account_reconcilor_unittest.cc

Issue 1104153002: Expose ReconcilorState. Rename MergeSession in Signin Tracker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: VLOGging the reconcilor Created 5 years, 8 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 | « no previous file | chrome/browser/signin/fake_gaia_cookie_manager_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/signin/account_reconcilor_unittest.cc
diff --git a/chrome/browser/signin/account_reconcilor_unittest.cc b/chrome/browser/signin/account_reconcilor_unittest.cc
index 73d79c1dea62085739e751db8fac4db71d1d0eec..fe138495977587bdc20e8e5090500867f90cc568 100644
--- a/chrome/browser/signin/account_reconcilor_unittest.cc
+++ b/chrome/browser/signin/account_reconcilor_unittest.cc
@@ -323,8 +323,12 @@ TEST_F(AccountReconcilorTest, GetAccountsFromCookieSuccess) {
AccountReconcilorFactory::GetForProfile(profile());
ASSERT_TRUE(reconcilor);
+ ASSERT_EQ(AccountReconcilor::State::NOT_RECONCILING, reconcilor->GetState());
reconcilor->StartReconcile();
+ ASSERT_EQ(AccountReconcilor::State::GATHERING_INFORMATION,
+ reconcilor->GetState());
base::RunLoop().RunUntilIdle();
+ ASSERT_EQ(AccountReconcilor::State::APPLYING_CHANGES, reconcilor->GetState());
std::vector<std::pair<std::string, bool> > accounts;
ASSERT_TRUE(cookie_manager_service()->ListAccounts(&accounts));
@@ -334,18 +338,25 @@ TEST_F(AccountReconcilorTest, GetAccountsFromCookieSuccess) {
TEST_F(AccountReconcilorTest, GetAccountsFromCookieFailure) {
ConnectProfileToAccount("12345", "user@gmail.com");
- cookie_manager_service()->SetListAccountsResponseHttpNotFound();
+ cookie_manager_service()->SetListAccountsResponseWebLoginRequired();
AccountReconcilor* reconcilor =
AccountReconcilorFactory::GetForProfile(profile());
ASSERT_TRUE(reconcilor);
+ ASSERT_EQ(AccountReconcilor::State::NOT_RECONCILING, reconcilor->GetState());
reconcilor->StartReconcile();
+ ASSERT_EQ(AccountReconcilor::State::GATHERING_INFORMATION,
+ reconcilor->GetState());
base::RunLoop().RunUntilIdle();
std::vector<std::pair<std::string, bool> > accounts;
ASSERT_FALSE(cookie_manager_service()->ListAccounts(&accounts));
ASSERT_EQ(0u, accounts.size());
+
+ base::RunLoop().RunUntilIdle();
+ ASSERT_EQ(AccountReconcilor::State::NOT_RECONCILING_ERROR_OCCURED,
+ reconcilor->GetState());
}
TEST_P(AccountReconcilorTest, StartReconcileNoop) {
« no previous file with comments | « no previous file | chrome/browser/signin/fake_gaia_cookie_manager_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698