Commit 9963c133 authored by Gyuyoung Kim's avatar Gyuyoung Kim Committed by Commit Bot

s13n: Replace use of AccountTrackerService in dice_browsertest.cc

AccountTrackerService will be deprecated for the servicification. So this CL
replaces all uses of ATS with IdentityManager's ones in dice_browsertest.cc

Bug: 922769
Change-Id: If17b69fac2b15a9d4afa987081def495bd19b24a
Reviewed-on: https://chromium-review.googlesource.com/c/1429312Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Commit-Queue: Gyuyoung Kim <gyuyoung@igalia.com>
Cr-Commit-Position: refs/heads/master@{#625149}
parent 07e9e67e
......@@ -28,7 +28,6 @@
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/signin/account_consistency_mode_manager.h"
#include "chrome/browser/signin/account_reconcilor_factory.h"
#include "chrome/browser/signin/account_tracker_service_factory.h"
#include "chrome/browser/signin/chrome_device_id_helper.h"
#include "chrome/browser/signin/chrome_signin_client.h"
#include "chrome/browser/signin/chrome_signin_client_factory.h"
......@@ -51,7 +50,6 @@
#include "components/prefs/pref_service.h"
#include "components/signin/core/browser/account_consistency_method.h"
#include "components/signin/core/browser/account_reconcilor.h"
#include "components/signin/core/browser/account_tracker_service.h"
#include "components/signin/core/browser/dice_header_helper.h"
#include "components/signin/core/browser/signin_client.h"
#include "components/signin/core/browser/signin_header_helper.h"
......@@ -364,11 +362,6 @@ class DiceBrowserTestBase : public InProcessBrowserTest,
ui_test_utils::NavigateToURL(browser(), https_server_.GetURL(path));
}
// Returns the account tracker service.
AccountTrackerService* GetAccountTrackerService() {
return AccountTrackerServiceFactory::GetForProfile(browser()->profile());
}
// Returns the identity manager.
identity::IdentityManager* GetIdentityManager() {
return IdentityManagerFactory::GetForProfile(browser()->profile());
......@@ -377,14 +370,14 @@ class DiceBrowserTestBase : public InProcessBrowserTest,
// Returns the account ID associated with |main_email_| and its associated
// gaia ID.
std::string GetMainAccountID() {
return GetAccountTrackerService()->PickAccountIdForAccount(
return GetIdentityManager()->LegacyPickAccountIdForAccount(
identity::GetTestGaiaIdForEmail(main_email_), main_email_);
}
// Returns the account ID associated with kSecondaryEmail and its associated
// gaia ID.
std::string GetSecondaryAccountID() {
return GetAccountTrackerService()->PickAccountIdForAccount(
return GetIdentityManager()->LegacyPickAccountIdForAccount(
identity::GetTestGaiaIdForEmail(kSecondaryEmail), kSecondaryEmail);
}
......@@ -918,7 +911,7 @@ IN_PROC_BROWSER_TEST_F(DiceBrowserTest, PRE_TurnOffDice) {
.account_id.empty());
EXPECT_TRUE(
GetIdentityManager()->HasAccountWithRefreshToken(GetMainAccountID()));
EXPECT_FALSE(GetAccountTrackerService()->GetAccounts().empty());
EXPECT_FALSE(GetIdentityManager()->GetAccountsWithRefreshTokens().empty());
// Turn off Dice for this profile.
browser()->profile()->GetPrefs()->SetBoolean(
......@@ -941,7 +934,7 @@ IN_PROC_BROWSER_TEST_F(DiceBrowserTest, TurnOffDice) {
.account_id.empty());
EXPECT_FALSE(
GetIdentityManager()->HasAccountWithRefreshToken(GetMainAccountID()));
EXPECT_TRUE(GetAccountTrackerService()->GetAccounts().empty());
EXPECT_TRUE(GetIdentityManager()->GetAccountsWithRefreshTokens().empty());
// Navigate to Gaia and sign in.
NavigateToURL(kSigninURL);
......
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