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

Side by Side Diff: google_apis/gaia/gaia_auth_fetcher_unittest.cc

Issue 601643002: Use a distinct source parameter on gaia endpoints for the reconcilor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@uber
Patch Set: Remove functions Created 6 years, 2 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 unified diff | Download patch
« no previous file with comments | « google_apis/gaia/gaia_auth_fetcher.cc ('k') | google_apis/gaia/gaia_constants.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // A complete set of unit tests for GaiaAuthFetcher. 5 // A complete set of unit tests for GaiaAuthFetcher.
6 // Originally ported from GoogleAuthenticator tests. 6 // Originally ported from GoogleAuthenticator tests.
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 781
782 TEST_F(GaiaAuthFetcherTest, ListAccounts) { 782 TEST_F(GaiaAuthFetcherTest, ListAccounts) {
783 std::string data("[\"gaia.l.a.r\", [" 783 std::string data("[\"gaia.l.a.r\", ["
784 "[\"gaia.l.a\", 1, \"First Last\", \"user@gmail.com\", " 784 "[\"gaia.l.a\", 1, \"First Last\", \"user@gmail.com\", "
785 "\"//googleusercontent.com/A/B/C/D/photo.jpg\", 1, 1, 0]]]"); 785 "\"//googleusercontent.com/A/B/C/D/photo.jpg\", 1, 1, 0]]]");
786 MockGaiaConsumer consumer; 786 MockGaiaConsumer consumer;
787 EXPECT_CALL(consumer, OnListAccountsSuccess(data)).Times(1); 787 EXPECT_CALL(consumer, OnListAccountsSuccess(data)).Times(1);
788 788
789 GaiaAuthFetcher auth(&consumer, std::string(), GetRequestContext()); 789 GaiaAuthFetcher auth(&consumer, std::string(), GetRequestContext());
790 net::URLRequestStatus status(net::URLRequestStatus::SUCCESS, 0); 790 net::URLRequestStatus status(net::URLRequestStatus::SUCCESS, 0);
791 MockFetcher mock_fetcher(GaiaUrls::GetInstance()->list_accounts_url(), 791 MockFetcher mock_fetcher(
792 GaiaUrls::GetInstance()->ListAccountsURLWithSource(std::string()),
792 status, net::HTTP_OK, cookies_, data, net::URLFetcher::GET, &auth); 793 status, net::HTTP_OK, cookies_, data, net::URLFetcher::GET, &auth);
793 auth.OnURLFetchComplete(&mock_fetcher); 794 auth.OnURLFetchComplete(&mock_fetcher);
794 } 795 }
795 796
796 TEST_F(GaiaAuthFetcherTest, GetCheckConnectionInfo) { 797 TEST_F(GaiaAuthFetcherTest, GetCheckConnectionInfo) {
797 std::string data( 798 std::string data(
798 "[{\"carryBackToken\": \"token1\", \"url\": \"http://www.google.com\"}]"); 799 "[{\"carryBackToken\": \"token1\", \"url\": \"http://www.google.com\"}]");
799 MockGaiaConsumer consumer; 800 MockGaiaConsumer consumer;
800 EXPECT_CALL(consumer, OnGetCheckConnectionInfoSuccess(data)).Times(1); 801 EXPECT_CALL(consumer, OnGetCheckConnectionInfoSuccess(data)).Times(1);
801 802
802 GaiaAuthFetcher auth(&consumer, std::string(), GetRequestContext()); 803 GaiaAuthFetcher auth(&consumer, std::string(), GetRequestContext());
803 net::URLRequestStatus status(net::URLRequestStatus::SUCCESS, 0); 804 net::URLRequestStatus status(net::URLRequestStatus::SUCCESS, 0);
804 MockFetcher mock_fetcher( 805 MockFetcher mock_fetcher(
805 GaiaUrls::GetInstance()->get_check_connection_info_url(), 806 GaiaUrls::GetInstance()->GetCheckConnectionInfoURLWithSource(
807 std::string()),
806 status, net::HTTP_OK, cookies_, data, net::URLFetcher::GET, &auth); 808 status, net::HTTP_OK, cookies_, data, net::URLFetcher::GET, &auth);
807 auth.OnURLFetchComplete(&mock_fetcher); 809 auth.OnURLFetchComplete(&mock_fetcher);
808 } 810 }
OLDNEW
« no previous file with comments | « google_apis/gaia/gaia_auth_fetcher.cc ('k') | google_apis/gaia/gaia_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698