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

Unified Diff: google_apis/gaia/gaia_auth_fetcher_unittest.cc

Issue 424233002: When the user signs in, make sure to set cookies on all reachable google (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 6 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
« no previous file with comments | « google_apis/gaia/gaia_auth_fetcher.cc ('k') | google_apis/gaia/gaia_urls.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 75a8db73afe9e010bfd4d6a4e086e7379b681633..971d47d319798294e0a8d16c392eba1d47429cec 100644
--- a/google_apis/gaia/gaia_auth_fetcher_unittest.cc
+++ b/google_apis/gaia/gaia_auth_fetcher_unittest.cc
@@ -188,6 +188,7 @@ class MockGaiaConsumer : public GaiaAuthConsumer {
MOCK_METHOD1(OnUberAuthTokenFailure, void(
const GoogleServiceAuthError& error));
MOCK_METHOD1(OnListAccountsSuccess, void(const std::string& data));
+ MOCK_METHOD1(OnGetCheckConnectionInfoSuccess, void(const std::string& data));
};
#if defined(OS_WIN)
@@ -655,7 +656,7 @@ TEST_F(GaiaAuthFetcherTest, MergeSessionSuccess) {
net::TestURLFetcherFactory factory;
GaiaAuthFetcher auth(&consumer, std::string(), GetRequestContext());
- auth.StartMergeSession("myubertoken");
+ auth.StartMergeSession("myubertoken", std::string());
EXPECT_TRUE(auth.HasPendingFetch());
MockFetcher mock_fetcher(
@@ -675,7 +676,7 @@ TEST_F(GaiaAuthFetcherTest, MergeSessionSuccessRedirect) {
net::TestURLFetcherFactory factory;
GaiaAuthFetcher auth(&consumer, std::string(), GetRequestContext());
- auth.StartMergeSession("myubertoken");
+ auth.StartMergeSession("myubertoken", std::string());
// Make sure the fetcher created has the expected flags. Set its url()
// properties to reflect a redirect.
@@ -791,3 +792,17 @@ TEST_F(GaiaAuthFetcherTest, ListAccounts) {
status, net::HTTP_OK, cookies_, data, net::URLFetcher::GET, &auth);
auth.OnURLFetchComplete(&mock_fetcher);
}
+
+TEST_F(GaiaAuthFetcherTest, GetCheckConnectionInfo) {
+ std::string data(
+ "[{\"carryBackToken\": \"token1\", \"url\": \"http://www.google.com\"}]");
+ MockGaiaConsumer consumer;
+ EXPECT_CALL(consumer, OnGetCheckConnectionInfoSuccess(data)).Times(1);
+
+ GaiaAuthFetcher auth(&consumer, std::string(), GetRequestContext());
+ net::URLRequestStatus status(net::URLRequestStatus::SUCCESS, 0);
+ MockFetcher mock_fetcher(
+ GaiaUrls::GetInstance()->get_check_connection_info_url(),
+ status, net::HTTP_OK, cookies_, data, net::URLFetcher::GET, &auth);
+ auth.OnURLFetchComplete(&mock_fetcher);
+}
« no previous file with comments | « google_apis/gaia/gaia_auth_fetcher.cc ('k') | google_apis/gaia/gaia_urls.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698