Commit 62659544 authored by Sergio Villar Senin's avatar Sergio Villar Senin Committed by Commit Bot

Convert browsing_data_remover_browsertest.cc to Identity service

Replaced the usage of ProfileOAuth2TokenService and SigninManager by
identity API calls.

This CL adds a new function to the identity_test_utils.h set to set
the auth error of a given account with a refresh token.

Bug: 903859
Change-Id: I29e1ae3bee6ba7f69404f5f2bb7152fa0db9101d
Reviewed-on: https://chromium-review.googlesource.com/c/1352250Reviewed-by: default avatarSylvain Defresne <sdefresne@chromium.org>
Reviewed-by: default avatarJoshua Bell <jsbell@chromium.org>
Commit-Queue: Sergio Villar <svillar@igalia.com>
Cr-Commit-Position: refs/heads/master@{#611821}
parent 638ce695
......@@ -304,6 +304,10 @@ class IdentityManager : public SigninManagerBase::Observer,
const std::string& account_id);
friend void UpdateAccountInfoForAccount(IdentityManager* identity_manager,
AccountInfo account_info);
friend void SetAccountWithRefreshTokenInPersistentErrorState(
IdentityManager* identity_manager,
const std::string& account_id,
const GoogleServiceAuthError& auth_error);
friend MultiProfileDownloadNotificationTest;
friend file_manager::MultiProfileFilesAppBrowserTest;
......
......@@ -353,4 +353,14 @@ std::string GetTestGaiaIdForEmail(const std::string& email) {
return gaia_id;
}
void SetAccountWithRefreshTokenInPersistentErrorState(
IdentityManager* identity_manager,
const std::string& account_id,
const GoogleServiceAuthError& auth_error) {
identity_manager->GetTokenService()->GetDelegate()->UpdateAuthError(
account_id, GoogleServiceAuthError::FromInvalidGaiaCredentialsReason(
GoogleServiceAuthError::InvalidGaiaCredentialsReason::
CREDENTIALS_REJECTED_BY_SERVER));
}
} // namespace identity
......@@ -11,6 +11,7 @@
#include "components/signin/core/browser/account_info.h"
class FakeGaiaCookieManagerService;
class GoogleServiceAuthError;
// Test-related utilities that don't fit in either IdentityTestEnvironment or
// IdentityManager itself. NOTE: Using these utilities directly is discouraged,
......@@ -127,6 +128,11 @@ void UpdateAccountInfoForAccount(IdentityManager* identity_manager,
std::string GetTestGaiaIdForEmail(const std::string& email);
void SetAccountWithRefreshTokenInPersistentErrorState(
IdentityManager* identity_manager,
const std::string& account_id,
const GoogleServiceAuthError& auth_error);
} // namespace identity
#endif // SERVICES_IDENTITY_PUBLIC_CPP_IDENTITY_TEST_UTILS_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment