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

Unified Diff: components/policy/core/common/cloud/user_info_fetcher_unittest.cc

Issue 257773002: Use new people.get api instead of oauth2/v1/userinfo. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix user image manager tests Created 6 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 | « components/policy/core/common/cloud/user_info_fetcher.cc ('k') | google_apis/gaia/gaia_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/policy/core/common/cloud/user_info_fetcher_unittest.cc
diff --git a/components/policy/core/common/cloud/user_info_fetcher_unittest.cc b/components/policy/core/common/cloud/user_info_fetcher_unittest.cc
index 8649427d42cd1e3bb6679f2de3ed049c81d2516d..5c8a24beb9f8730a0af9013d189f908bd098d0f1 100644
--- a/components/policy/core/common/cloud/user_info_fetcher_unittest.cc
+++ b/components/policy/core/common/cloud/user_info_fetcher_unittest.cc
@@ -4,6 +4,7 @@
#include "base/values.h"
#include "components/policy/core/common/cloud/user_info_fetcher.h"
+#include "google_apis/gaia/gaia_oauth_client.h"
#include "google_apis/gaia/google_service_auth_error.h"
#include "net/http/http_status_code.h"
#include "net/url_request/test_url_fetcher_factory.h"
@@ -20,7 +21,7 @@ static const char kUserInfoResponse[] =
"{"
" \"email\": \"test_user@test.com\","
" \"verified_email\": true,"
- " \"hd\": \"test.com\""
+ " \"domain\": \"test.com\""
"}";
class MockUserInfoFetcherDelegate : public UserInfoFetcher::Delegate {
@@ -49,7 +50,8 @@ TEST_F(UserInfoFetcherTest, FailedFetch) {
// Fake a failed fetch - should result in the failure callback being invoked.
EXPECT_CALL(delegate, OnGetUserInfoFailure(_));
- net::TestURLFetcher* url_fetcher = url_factory_.GetFetcherByID(0);
+ net::TestURLFetcher* url_fetcher =
+ url_factory_.GetFetcherByID(gaia::GaiaOAuthClient::kUrlFetcherId);
url_fetcher->set_status(net::URLRequestStatus(
net::URLRequestStatus::FAILED, -1));
url_fetcher->delegate()->OnURLFetchComplete(url_fetcher);
@@ -65,12 +67,13 @@ TEST_F(UserInfoFetcherTest, SuccessfulFetch) {
scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
dict->SetString("email", "test_user@test.com");
dict->SetBoolean("verified_email", true);
- dict->SetString("hd", "test.com");
+ dict->SetString("domain", "test.com");
// Fake a successful fetch - should result in the data being parsed and
// the values passed off to the success callback.
EXPECT_CALL(delegate, OnGetUserInfoSuccess(MatchDict(dict.get())));
- net::TestURLFetcher* url_fetcher = url_factory_.GetFetcherByID(0);
+ net::TestURLFetcher* url_fetcher =
+ url_factory_.GetFetcherByID(gaia::GaiaOAuthClient::kUrlFetcherId);
url_fetcher->set_response_code(net::HTTP_OK);
url_fetcher->SetResponseString(kUserInfoResponse);
url_fetcher->delegate()->OnURLFetchComplete(url_fetcher);
« no previous file with comments | « components/policy/core/common/cloud/user_info_fetcher.cc ('k') | google_apis/gaia/gaia_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698