Commit 64fdfcf7 authored by Colin Blundell's avatar Colin Blundell Committed by Commit Bot

Remove PSSStartupTest as friend of IdentityManager

APIs are now in place that allow ProfileSyncServiceStartupTest to use
identity_test_utils.h, which is preferable as that has a direct
conversion path to the long-term IdentityTestEnvironment test
infrastructure.

Bug: 796544
Change-Id: I2850f950353849a50638195bd2c4276089b011a3
Reviewed-on: https://chromium-review.googlesource.com/1085463
Commit-Queue: Colin Blundell <blundell@chromium.org>
Reviewed-by: default avatarMarc Treib <treib@chromium.org>
Cr-Commit-Position: refs/heads/master@{#564860}
parent 71475b1e
...@@ -32,7 +32,6 @@ namespace browser_sync { ...@@ -32,7 +32,6 @@ namespace browser_sync {
namespace { namespace {
const char kGaiaId[] = "12345";
const char kEmail[] = "test_user@gmail.com"; const char kEmail[] = "test_user@gmail.com";
void SetError(DataTypeManager::ConfigureResult* result) { void SetError(DataTypeManager::ConfigureResult* result) {
...@@ -95,28 +94,20 @@ class ProfileSyncServiceStartupTest : public testing::Test { ...@@ -95,28 +94,20 @@ class ProfileSyncServiceStartupTest : public testing::Test {
profile_sync_service_bundle_.identity_manager(), kEmail); profile_sync_service_bundle_.identity_manager(), kEmail);
} }
// TODO(treib): This doesn't notify observers of
// SigninManager/IdentityManager, so it really only works before creating
// anything.
void SimulateTestUserSigninWithoutRefreshToken() { void SimulateTestUserSigninWithoutRefreshToken() {
// Set the primary account *without* providing an OAuth token. // Set the primary account *without* providing an OAuth token.
// TODO(https://crbug.com/814787): Change this flow to go through a identity::SetPrimaryAccount(profile_sync_service_bundle_.signin_manager(),
// mainstream Identity Service API once that API exists. Note that this profile_sync_service_bundle_.identity_manager(),
// might require supplying a valid refresh token here as opposed to an kEmail);
// empty string.
profile_sync_service_bundle_.identity_manager()
->SetPrimaryAccountSynchronously(kGaiaId, kEmail,
/*refresh_token=*/std::string());
EXPECT_TRUE(
profile_sync_service_bundle_.signin_manager()->IsAuthenticated());
} }
void UpdateCredentials() { void UpdateCredentials() {
profile_sync_service_bundle_.auth_service()->UpdateCredentials( identity::SetRefreshTokenForAccount(
profile_sync_service_bundle_.auth_service(),
profile_sync_service_bundle_.identity_manager(),
profile_sync_service_bundle_.identity_manager() profile_sync_service_bundle_.identity_manager()
->GetPrimaryAccountInfo() ->GetPrimaryAccountInfo()
.account_id, .account_id);
"oauth2_login_token");
} }
DataTypeManagerMock* SetUpDataTypeManagerMock() { DataTypeManagerMock* SetUpDataTypeManagerMock() {
......
...@@ -21,11 +21,6 @@ namespace arc { ...@@ -21,11 +21,6 @@ namespace arc {
class ArcTermsOfServiceDefaultNegotiatorTest; class ArcTermsOfServiceDefaultNegotiatorTest;
} }
// Necessary to declare this class as a friend.
namespace browser_sync {
class ProfileSyncServiceStartupTest;
}
// Necessary to declare these classes as friends. // Necessary to declare these classes as friends.
namespace chromeos { namespace chromeos {
class ChromeSessionManager; class ChromeSessionManager;
...@@ -160,7 +155,6 @@ class IdentityManager : public SigninManagerBase::Observer, ...@@ -160,7 +155,6 @@ class IdentityManager : public SigninManagerBase::Observer,
friend arc::ArcTermsOfServiceDefaultNegotiatorTest; friend arc::ArcTermsOfServiceDefaultNegotiatorTest;
friend chromeos::ChromeSessionManager; friend chromeos::ChromeSessionManager;
friend chromeos::UserSessionManager; friend chromeos::UserSessionManager;
friend browser_sync::ProfileSyncServiceStartupTest;
// Sets the primary account info synchronously with both the IdentityManager // Sets the primary account info synchronously with both the IdentityManager
// and its backing SigninManager/ProfileOAuth2TokenService instances. // and its backing SigninManager/ProfileOAuth2TokenService instances.
......
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