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

Unified Diff: google_apis/gaia/gaia_auth_fetcher_unittest.cc

Issue 57363003: Enable account reconcilor when --new-profile-management is used. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix unsigned check in tests again Created 7 years, 1 month 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: google_apis/gaia/gaia_auth_fetcher_unittest.cc
diff --git a/google_apis/gaia/gaia_auth_fetcher_unittest.cc b/google_apis/gaia/gaia_auth_fetcher_unittest.cc
index 89706918c7dbec1ab154a3bf427db65e60afe54f..a12fb97b220f698e1fba3d7c56fa95e1767529b9 100644
--- a/google_apis/gaia/gaia_auth_fetcher_unittest.cc
+++ b/google_apis/gaia/gaia_auth_fetcher_unittest.cc
@@ -187,6 +187,7 @@ class MockGaiaConsumer : public GaiaAuthConsumer {
const GoogleServiceAuthError& error));
MOCK_METHOD1(OnUberAuthTokenFailure, void(
const GoogleServiceAuthError& error));
+ MOCK_METHOD1(OnListAccountsSuccess, void(const std::string& data));
};
#if defined(OS_WIN)
@@ -789,3 +790,17 @@ TEST_F(GaiaAuthFetcherTest, StartOAuthLogin) {
net::URLFetcher::GET, &auth);
auth.OnURLFetchComplete(&mock_fetcher);
}
+
+TEST_F(GaiaAuthFetcherTest, ListAccounts) {
+ std::string data("[\"gaia.l.a.r\", ["
+ "[\"gaia.l.a\", 1, \"First Last\", \"user@gmail.com\", "
+ "\"//googleusercontent.com/A/B/C/D/photo.jpg\", 1, 1, 0]]]");
+ MockGaiaConsumer consumer;
+ EXPECT_CALL(consumer, OnListAccountsSuccess(data)).Times(1);
+
+ GaiaAuthFetcher auth(&consumer, std::string(), GetRequestContext());
+ net::URLRequestStatus status(net::URLRequestStatus::SUCCESS, 0);
+ MockFetcher mock_fetcher(GaiaUrls::GetInstance()->list_accounts_url(),
+ status, net::HTTP_OK, cookies_, data, net::URLFetcher::GET, &auth);
+ auth.OnURLFetchComplete(&mock_fetcher);
+}

Powered by Google App Engine
This is Rietveld 408576698