Commit f635214c authored by Colin Blundell's avatar Colin Blundell Committed by Commit Bot

Remove unused AccountTracker::Observer methods

As part of the move toward eliminating AccountTracker entirely (see bug),
this CL removes two AccountTracker::Observer methods that are
essentially unused in the codebase (their one production implementation
simply uses them to print logging messages, which could happen just as
easily in AccountTracker itself if needed).

The third method (OnSignInChanged()) is actually used. Eliminating this
method will likely require porting its consumers to observe the
OAuth2TokenService instead.

TBR=rockot@chromium.org

Bug: 729590
Change-Id: I2300f83e8f402ac54783eae212efc8debe598e0b
Reviewed-on: https://chromium-review.googlesource.com/538618Reviewed-by: default avatarColin Blundell <blundell@chromium.org>
Reviewed-by: default avatarNicolas Zea <zea@chromium.org>
Reviewed-by: default avatarMihai Sardarescu <msarda@chromium.org>
Commit-Queue: Colin Blundell <blundell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#481852}
parent 2015d089
...@@ -189,12 +189,6 @@ BrowserContextKeyedAPIFactory<IdentityAPI>* IdentityAPI::GetFactoryInstance() { ...@@ -189,12 +189,6 @@ BrowserContextKeyedAPIFactory<IdentityAPI>* IdentityAPI::GetFactoryInstance() {
return g_factory.Pointer(); return g_factory.Pointer();
} }
void IdentityAPI::OnAccountAdded(const gaia::AccountIds& ids) {
}
void IdentityAPI::OnAccountRemoved(const gaia::AccountIds& ids) {
}
void IdentityAPI::OnAccountSignInChanged(const gaia::AccountIds& ids, void IdentityAPI::OnAccountSignInChanged(const gaia::AccountIds& ids,
bool is_signed_in) { bool is_signed_in) {
api::identity::AccountInfo account_info; api::identity::AccountInfo account_info;
......
...@@ -101,8 +101,6 @@ class IdentityAPI : public BrowserContextKeyedAPI, ...@@ -101,8 +101,6 @@ class IdentityAPI : public BrowserContextKeyedAPI,
static BrowserContextKeyedAPIFactory<IdentityAPI>* GetFactoryInstance(); static BrowserContextKeyedAPIFactory<IdentityAPI>* GetFactoryInstance();
// gaia::AccountTracker::Observer implementation: // gaia::AccountTracker::Observer implementation:
void OnAccountAdded(const gaia::AccountIds& ids) override;
void OnAccountRemoved(const gaia::AccountIds& ids) override;
void OnAccountSignInChanged(const gaia::AccountIds& ids, void OnAccountSignInChanged(const gaia::AccountIds& ids,
bool is_signed_in) override; bool is_signed_in) override;
......
...@@ -101,17 +101,6 @@ void GCMAccountTracker::ScheduleReportTokens() { ...@@ -101,17 +101,6 @@ void GCMAccountTracker::ScheduleReportTokens() {
GetTimeToNextTokenReporting()); GetTimeToNextTokenReporting());
} }
void GCMAccountTracker::OnAccountAdded(const gaia::AccountIds& ids) {
DVLOG(1) << "Account added: " << ids.email;
// We listen for the account signing in, which happens after account is added.
}
void GCMAccountTracker::OnAccountRemoved(const gaia::AccountIds& ids) {
DVLOG(1) << "Account removed: " << ids.email;
// We listen for the account signing out, which happens before account is
// removed.
}
void GCMAccountTracker::OnAccountSignInChanged(const gaia::AccountIds& ids, void GCMAccountTracker::OnAccountSignInChanged(const gaia::AccountIds& ids,
bool is_signed_in) { bool is_signed_in) {
if (is_signed_in) if (is_signed_in)
......
...@@ -96,8 +96,6 @@ class GCMAccountTracker : public gaia::AccountTracker::Observer, ...@@ -96,8 +96,6 @@ class GCMAccountTracker : public gaia::AccountTracker::Observer,
typedef std::map<std::string, AccountInfo> AccountInfos; typedef std::map<std::string, AccountInfo> AccountInfos;
// AccountTracker::Observer overrides. // AccountTracker::Observer overrides.
void OnAccountAdded(const gaia::AccountIds& ids) override;
void OnAccountRemoved(const gaia::AccountIds& ids) override;
void OnAccountSignInChanged(const gaia::AccountIds& ids, void OnAccountSignInChanged(const gaia::AccountIds& ids,
bool is_signed_in) override; bool is_signed_in) override;
......
...@@ -139,18 +139,6 @@ void AccountTracker::SetAccountStateForTest(AccountIds ids, bool is_signed_in) { ...@@ -139,18 +139,6 @@ void AccountTracker::SetAccountStateForTest(AccountIds ids, bool is_signed_in) {
} }
} }
void AccountTracker::NotifyAccountAdded(const AccountState& account) {
DCHECK(!account.ids.gaia.empty());
for (auto& observer : observer_list_)
observer.OnAccountAdded(account.ids);
}
void AccountTracker::NotifyAccountRemoved(const AccountState& account) {
DCHECK(!account.ids.gaia.empty());
for (auto& observer : observer_list_)
observer.OnAccountRemoved(account.ids);
}
void AccountTracker::NotifySignInChanged(const AccountState& account) { void AccountTracker::NotifySignInChanged(const AccountState& account) {
// TODO(robliao): Remove ScopedTracker below once https://crbug.com/422460 is // TODO(robliao): Remove ScopedTracker below once https://crbug.com/422460 is
// fixed. // fixed.
...@@ -207,7 +195,6 @@ void AccountTracker::StopTrackingAccount(const std::string account_key) { ...@@ -207,7 +195,6 @@ void AccountTracker::StopTrackingAccount(const std::string account_key) {
AccountState& account = accounts_[account_key]; AccountState& account = accounts_[account_key];
if (!account.ids.gaia.empty()) { if (!account.ids.gaia.empty()) {
UpdateSignInState(account_key, false); UpdateSignInState(account_key, false);
NotifyAccountRemoved(account);
} }
accounts_.erase(account_key); accounts_.erase(account_key);
} }
...@@ -268,7 +255,6 @@ void AccountTracker::OnUserInfoFetchSuccess(AccountIdFetcher* fetcher, ...@@ -268,7 +255,6 @@ void AccountTracker::OnUserInfoFetchSuccess(AccountIdFetcher* fetcher,
AccountState& account = accounts_[account_key]; AccountState& account = accounts_[account_key];
account.ids.gaia = gaia_id; account.ids.gaia = gaia_id;
NotifyAccountAdded(account);
if (account.is_signed_in) if (account.is_signed_in)
NotifySignInChanged(account); NotifySignInChanged(account);
......
...@@ -49,8 +49,6 @@ class AccountTracker : public OAuth2TokenService::Observer, ...@@ -49,8 +49,6 @@ class AccountTracker : public OAuth2TokenService::Observer,
class Observer { class Observer {
public: public:
virtual void OnAccountAdded(const AccountIds& ids) = 0;
virtual void OnAccountRemoved(const AccountIds& ids) = 0;
virtual void OnAccountSignInChanged(const AccountIds& ids, virtual void OnAccountSignInChanged(const AccountIds& ids,
bool is_signed_in) = 0; bool is_signed_in) = 0;
}; };
...@@ -92,8 +90,6 @@ class AccountTracker : public OAuth2TokenService::Observer, ...@@ -92,8 +90,6 @@ class AccountTracker : public OAuth2TokenService::Observer,
bool is_signed_in; bool is_signed_in;
}; };
void NotifyAccountAdded(const AccountState& account);
void NotifyAccountRemoved(const AccountState& account);
void NotifySignInChanged(const AccountState& account); void NotifySignInChanged(const AccountState& account);
void UpdateSignInState(const std::string& account_key, bool is_signed_in); void UpdateSignInState(const std::string& account_key, bool is_signed_in);
......
...@@ -23,8 +23,6 @@ namespace { ...@@ -23,8 +23,6 @@ namespace {
const char kPrimaryAccountKey[] = "primary_account@example.com"; const char kPrimaryAccountKey[] = "primary_account@example.com";
enum TrackingEventType { enum TrackingEventType {
ADDED,
REMOVED,
SIGN_IN, SIGN_IN,
SIGN_OUT SIGN_OUT
}; };
...@@ -56,12 +54,6 @@ class TrackingEvent { ...@@ -56,12 +54,6 @@ class TrackingEvent {
std::string ToString() const { std::string ToString() const {
const char * typestr = "INVALID"; const char * typestr = "INVALID";
switch (type_) { switch (type_) {
case ADDED:
typestr = "ADD";
break;
case REMOVED:
typestr = "REM";
break;
case SIGN_IN: case SIGN_IN:
typestr = " IN"; typestr = " IN";
break; break;
...@@ -136,8 +128,6 @@ class AccountTrackerObserver : public AccountTracker::Observer { ...@@ -136,8 +128,6 @@ class AccountTrackerObserver : public AccountTracker::Observer {
void SortEventsByUser(); void SortEventsByUser();
// AccountTracker::Observer implementation // AccountTracker::Observer implementation
void OnAccountAdded(const AccountIds& ids) override;
void OnAccountRemoved(const AccountIds& ids) override;
void OnAccountSignInChanged(const AccountIds& ids, void OnAccountSignInChanged(const AccountIds& ids,
bool is_signed_in) override; bool is_signed_in) override;
...@@ -148,14 +138,6 @@ class AccountTrackerObserver : public AccountTracker::Observer { ...@@ -148,14 +138,6 @@ class AccountTrackerObserver : public AccountTracker::Observer {
std::vector<TrackingEvent> events_; std::vector<TrackingEvent> events_;
}; };
void AccountTrackerObserver::OnAccountAdded(const AccountIds& ids) {
events_.push_back(TrackingEvent(ADDED, ids.email, ids.gaia));
}
void AccountTrackerObserver::OnAccountRemoved(const AccountIds& ids) {
events_.push_back(TrackingEvent(REMOVED, ids.email, ids.gaia));
}
void AccountTrackerObserver::OnAccountSignInChanged(const AccountIds& ids, void AccountTrackerObserver::OnAccountSignInChanged(const AccountIds& ids,
bool is_signed_in) { bool is_signed_in) {
events_.push_back( events_.push_back(
...@@ -397,8 +379,7 @@ TEST_F(IdentityAccountTrackerTest, PrimaryLoginThenTokenAvailable) { ...@@ -397,8 +379,7 @@ TEST_F(IdentityAccountTrackerTest, PrimaryLoginThenTokenAvailable) {
ReturnOAuthUrlFetchSuccess(kPrimaryAccountKey); ReturnOAuthUrlFetchSuccess(kPrimaryAccountKey);
EXPECT_TRUE( EXPECT_TRUE(
observer()->CheckEvents(TrackingEvent(ADDED, kPrimaryAccountKey), observer()->CheckEvents(TrackingEvent(SIGN_IN, kPrimaryAccountKey)));
TrackingEvent(SIGN_IN, kPrimaryAccountKey)));
} }
TEST_F(IdentityAccountTrackerTest, PrimaryTokenAvailableThenLogin) { TEST_F(IdentityAccountTrackerTest, PrimaryTokenAvailableThenLogin) {
...@@ -408,8 +389,7 @@ TEST_F(IdentityAccountTrackerTest, PrimaryTokenAvailableThenLogin) { ...@@ -408,8 +389,7 @@ TEST_F(IdentityAccountTrackerTest, PrimaryTokenAvailableThenLogin) {
NotifyLogin(kPrimaryAccountKey); NotifyLogin(kPrimaryAccountKey);
ReturnOAuthUrlFetchSuccess(kPrimaryAccountKey); ReturnOAuthUrlFetchSuccess(kPrimaryAccountKey);
EXPECT_TRUE( EXPECT_TRUE(
observer()->CheckEvents(TrackingEvent(ADDED, kPrimaryAccountKey), observer()->CheckEvents(TrackingEvent(SIGN_IN, kPrimaryAccountKey)));
TrackingEvent(SIGN_IN, kPrimaryAccountKey)));
} }
TEST_F(IdentityAccountTrackerTest, PrimaryTokenAvailableAndRevokedThenLogin) { TEST_F(IdentityAccountTrackerTest, PrimaryTokenAvailableAndRevokedThenLogin) {
...@@ -419,11 +399,10 @@ TEST_F(IdentityAccountTrackerTest, PrimaryTokenAvailableAndRevokedThenLogin) { ...@@ -419,11 +399,10 @@ TEST_F(IdentityAccountTrackerTest, PrimaryTokenAvailableAndRevokedThenLogin) {
NotifyLogin(kPrimaryAccountKey); NotifyLogin(kPrimaryAccountKey);
ReturnOAuthUrlFetchSuccess(kPrimaryAccountKey); ReturnOAuthUrlFetchSuccess(kPrimaryAccountKey);
EXPECT_TRUE( EXPECT_TRUE(
observer()->CheckEvents(TrackingEvent(ADDED, kPrimaryAccountKey), observer()->CheckEvents(TrackingEvent(SIGN_IN, kPrimaryAccountKey)));
TrackingEvent(SIGN_IN, kPrimaryAccountKey)));
} }
TEST_F(IdentityAccountTrackerTest, PrimaryRevokeThenLogout) { TEST_F(IdentityAccountTrackerTest, PrimaryRevoke) {
NotifyLogin(kPrimaryAccountKey); NotifyLogin(kPrimaryAccountKey);
NotifyTokenAvailable(kPrimaryAccountKey); NotifyTokenAvailable(kPrimaryAccountKey);
ReturnOAuthUrlFetchSuccess(kPrimaryAccountKey); ReturnOAuthUrlFetchSuccess(kPrimaryAccountKey);
...@@ -432,10 +411,6 @@ TEST_F(IdentityAccountTrackerTest, PrimaryRevokeThenLogout) { ...@@ -432,10 +411,6 @@ TEST_F(IdentityAccountTrackerTest, PrimaryRevokeThenLogout) {
NotifyTokenRevoked(kPrimaryAccountKey); NotifyTokenRevoked(kPrimaryAccountKey);
EXPECT_TRUE( EXPECT_TRUE(
observer()->CheckEvents(TrackingEvent(SIGN_OUT, kPrimaryAccountKey))); observer()->CheckEvents(TrackingEvent(SIGN_OUT, kPrimaryAccountKey)));
NotifyLogout();
EXPECT_TRUE(
observer()->CheckEvents(TrackingEvent(REMOVED, kPrimaryAccountKey)));
} }
TEST_F(IdentityAccountTrackerTest, PrimaryRevokeThenLogin) { TEST_F(IdentityAccountTrackerTest, PrimaryRevokeThenLogin) {
...@@ -469,8 +444,7 @@ TEST_F(IdentityAccountTrackerTest, PrimaryLogoutThenRevoke) { ...@@ -469,8 +444,7 @@ TEST_F(IdentityAccountTrackerTest, PrimaryLogoutThenRevoke) {
NotifyLogout(); NotifyLogout();
EXPECT_TRUE( EXPECT_TRUE(
observer()->CheckEvents(TrackingEvent(SIGN_OUT, kPrimaryAccountKey), observer()->CheckEvents(TrackingEvent(SIGN_OUT, kPrimaryAccountKey)));
TrackingEvent(REMOVED, kPrimaryAccountKey)));
NotifyTokenRevoked(kPrimaryAccountKey); NotifyTokenRevoked(kPrimaryAccountKey);
EXPECT_TRUE(observer()->CheckEvents()); EXPECT_TRUE(observer()->CheckEvents());
...@@ -487,7 +461,6 @@ TEST_F(IdentityAccountTrackerTest, PrimaryLogoutFetchCancelAvailable) { ...@@ -487,7 +461,6 @@ TEST_F(IdentityAccountTrackerTest, PrimaryLogoutFetchCancelAvailable) {
NotifyTokenAvailable(kPrimaryAccountKey); NotifyTokenAvailable(kPrimaryAccountKey);
ReturnOAuthUrlFetchSuccess(kPrimaryAccountKey); ReturnOAuthUrlFetchSuccess(kPrimaryAccountKey);
EXPECT_TRUE(observer()->CheckEvents( EXPECT_TRUE(observer()->CheckEvents(
TrackingEvent(ADDED, kPrimaryAccountKey),
TrackingEvent(SIGN_IN, kPrimaryAccountKey))); TrackingEvent(SIGN_IN, kPrimaryAccountKey)));
} }
...@@ -501,7 +474,6 @@ TEST_F(IdentityAccountTrackerTest, Available) { ...@@ -501,7 +474,6 @@ TEST_F(IdentityAccountTrackerTest, Available) {
ReturnOAuthUrlFetchSuccess("user@example.com"); ReturnOAuthUrlFetchSuccess("user@example.com");
EXPECT_TRUE(observer()->CheckEvents( EXPECT_TRUE(observer()->CheckEvents(
TrackingEvent(ADDED, "user@example.com"),
TrackingEvent(SIGN_IN, "user@example.com"))); TrackingEvent(SIGN_IN, "user@example.com")));
} }
...@@ -519,7 +491,6 @@ TEST_F(IdentityAccountTrackerTest, AvailableRevokeAvailable) { ...@@ -519,7 +491,6 @@ TEST_F(IdentityAccountTrackerTest, AvailableRevokeAvailable) {
ReturnOAuthUrlFetchSuccess("user@example.com"); ReturnOAuthUrlFetchSuccess("user@example.com");
NotifyTokenRevoked("user@example.com"); NotifyTokenRevoked("user@example.com");
EXPECT_TRUE(observer()->CheckEvents( EXPECT_TRUE(observer()->CheckEvents(
TrackingEvent(ADDED, "user@example.com"),
TrackingEvent(SIGN_IN, "user@example.com"), TrackingEvent(SIGN_IN, "user@example.com"),
TrackingEvent(SIGN_OUT, "user@example.com"))); TrackingEvent(SIGN_OUT, "user@example.com")));
...@@ -538,7 +509,6 @@ TEST_F(IdentityAccountTrackerTest, AvailableRevokeAvailableWithPendingFetch) { ...@@ -538,7 +509,6 @@ TEST_F(IdentityAccountTrackerTest, AvailableRevokeAvailableWithPendingFetch) {
NotifyTokenAvailable("user@example.com"); NotifyTokenAvailable("user@example.com");
ReturnOAuthUrlFetchSuccess("user@example.com"); ReturnOAuthUrlFetchSuccess("user@example.com");
EXPECT_TRUE(observer()->CheckEvents( EXPECT_TRUE(observer()->CheckEvents(
TrackingEvent(ADDED, "user@example.com"),
TrackingEvent(SIGN_IN, "user@example.com"))); TrackingEvent(SIGN_IN, "user@example.com")));
} }
...@@ -549,7 +519,6 @@ TEST_F(IdentityAccountTrackerTest, AvailableRevokeRevoke) { ...@@ -549,7 +519,6 @@ TEST_F(IdentityAccountTrackerTest, AvailableRevokeRevoke) {
ReturnOAuthUrlFetchSuccess("user@example.com"); ReturnOAuthUrlFetchSuccess("user@example.com");
NotifyTokenRevoked("user@example.com"); NotifyTokenRevoked("user@example.com");
EXPECT_TRUE(observer()->CheckEvents( EXPECT_TRUE(observer()->CheckEvents(
TrackingEvent(ADDED, "user@example.com"),
TrackingEvent(SIGN_IN, "user@example.com"), TrackingEvent(SIGN_IN, "user@example.com"),
TrackingEvent(SIGN_OUT, "user@example.com"))); TrackingEvent(SIGN_OUT, "user@example.com")));
...@@ -563,7 +532,6 @@ TEST_F(IdentityAccountTrackerTest, AvailableAvailable) { ...@@ -563,7 +532,6 @@ TEST_F(IdentityAccountTrackerTest, AvailableAvailable) {
NotifyTokenAvailable("user@example.com"); NotifyTokenAvailable("user@example.com");
ReturnOAuthUrlFetchSuccess("user@example.com"); ReturnOAuthUrlFetchSuccess("user@example.com");
EXPECT_TRUE(observer()->CheckEvents( EXPECT_TRUE(observer()->CheckEvents(
TrackingEvent(ADDED, "user@example.com"),
TrackingEvent(SIGN_IN, "user@example.com"))); TrackingEvent(SIGN_IN, "user@example.com")));
NotifyTokenAvailable("user@example.com"); NotifyTokenAvailable("user@example.com");
...@@ -576,13 +544,11 @@ TEST_F(IdentityAccountTrackerTest, TwoAccounts) { ...@@ -576,13 +544,11 @@ TEST_F(IdentityAccountTrackerTest, TwoAccounts) {
NotifyTokenAvailable("alpha@example.com"); NotifyTokenAvailable("alpha@example.com");
ReturnOAuthUrlFetchSuccess("alpha@example.com"); ReturnOAuthUrlFetchSuccess("alpha@example.com");
EXPECT_TRUE(observer()->CheckEvents( EXPECT_TRUE(observer()->CheckEvents(
TrackingEvent(ADDED, "alpha@example.com"),
TrackingEvent(SIGN_IN, "alpha@example.com"))); TrackingEvent(SIGN_IN, "alpha@example.com")));
NotifyTokenAvailable("beta@example.com"); NotifyTokenAvailable("beta@example.com");
ReturnOAuthUrlFetchSuccess("beta@example.com"); ReturnOAuthUrlFetchSuccess("beta@example.com");
EXPECT_TRUE(observer()->CheckEvents( EXPECT_TRUE(observer()->CheckEvents(
TrackingEvent(ADDED, "beta@example.com"),
TrackingEvent(SIGN_IN, "beta@example.com"))); TrackingEvent(SIGN_IN, "beta@example.com")));
NotifyTokenRevoked("alpha@example.com"); NotifyTokenRevoked("alpha@example.com");
...@@ -604,7 +570,6 @@ TEST_F(IdentityAccountTrackerTest, AvailableTokenFetchFailAvailable) { ...@@ -604,7 +570,6 @@ TEST_F(IdentityAccountTrackerTest, AvailableTokenFetchFailAvailable) {
NotifyTokenAvailable("user@example.com"); NotifyTokenAvailable("user@example.com");
ReturnOAuthUrlFetchSuccess("user@example.com"); ReturnOAuthUrlFetchSuccess("user@example.com");
EXPECT_TRUE(observer()->CheckEvents( EXPECT_TRUE(observer()->CheckEvents(
TrackingEvent(ADDED, "user@example.com"),
TrackingEvent(SIGN_IN, "user@example.com"))); TrackingEvent(SIGN_IN, "user@example.com")));
} }
...@@ -618,20 +583,15 @@ TEST_F(IdentityAccountTrackerTest, MultiSignOutSignIn) { ...@@ -618,20 +583,15 @@ TEST_F(IdentityAccountTrackerTest, MultiSignOutSignIn) {
observer()->SortEventsByUser(); observer()->SortEventsByUser();
EXPECT_TRUE(observer()->CheckEvents( EXPECT_TRUE(observer()->CheckEvents(
TrackingEvent(ADDED, "alpha@example.com"),
TrackingEvent(SIGN_IN, "alpha@example.com"), TrackingEvent(SIGN_IN, "alpha@example.com"),
TrackingEvent(ADDED, "beta@example.com"),
TrackingEvent(SIGN_IN, "beta@example.com"))); TrackingEvent(SIGN_IN, "beta@example.com")));
NotifyLogout(); NotifyLogout();
observer()->SortEventsByUser(); observer()->SortEventsByUser();
EXPECT_TRUE(observer()->CheckEvents( EXPECT_TRUE(
TrackingEvent(SIGN_OUT, "alpha@example.com"), observer()->CheckEvents(TrackingEvent(SIGN_OUT, "alpha@example.com"),
TrackingEvent(REMOVED, "alpha@example.com"), TrackingEvent(SIGN_OUT, "beta@example.com"),
TrackingEvent(SIGN_OUT, "beta@example.com"), TrackingEvent(SIGN_OUT, kPrimaryAccountKey)));
TrackingEvent(REMOVED, "beta@example.com"),
TrackingEvent(SIGN_OUT, kPrimaryAccountKey),
TrackingEvent(REMOVED, kPrimaryAccountKey)));
// No events fire at all while profile is signed out. // No events fire at all while profile is signed out.
NotifyTokenRevoked("alpha@example.com"); NotifyTokenRevoked("alpha@example.com");
...@@ -646,11 +606,8 @@ TEST_F(IdentityAccountTrackerTest, MultiSignOutSignIn) { ...@@ -646,11 +606,8 @@ TEST_F(IdentityAccountTrackerTest, MultiSignOutSignIn) {
ReturnOAuthUrlFetchSuccess(kPrimaryAccountKey); ReturnOAuthUrlFetchSuccess(kPrimaryAccountKey);
observer()->SortEventsByUser(); observer()->SortEventsByUser();
EXPECT_TRUE(observer()->CheckEvents( EXPECT_TRUE(observer()->CheckEvents(
TrackingEvent(ADDED, "beta@example.com"),
TrackingEvent(SIGN_IN, "beta@example.com"), TrackingEvent(SIGN_IN, "beta@example.com"),
TrackingEvent(ADDED, "gamma@example.com"),
TrackingEvent(SIGN_IN, "gamma@example.com"), TrackingEvent(SIGN_IN, "gamma@example.com"),
TrackingEvent(ADDED, kPrimaryAccountKey),
TrackingEvent(SIGN_IN, kPrimaryAccountKey))); TrackingEvent(SIGN_IN, kPrimaryAccountKey)));
// Revoking the primary token does not affect other accounts. // Revoking the primary token does not affect other accounts.
...@@ -686,9 +643,7 @@ TEST_F(IdentityAccountTrackerTest, MultiLogoutRemovesAllAccounts) { ...@@ -686,9 +643,7 @@ TEST_F(IdentityAccountTrackerTest, MultiLogoutRemovesAllAccounts) {
observer()->SortEventsByUser(); observer()->SortEventsByUser();
EXPECT_TRUE( EXPECT_TRUE(
observer()->CheckEvents(TrackingEvent(SIGN_OUT, kPrimaryAccountKey), observer()->CheckEvents(TrackingEvent(SIGN_OUT, kPrimaryAccountKey),
TrackingEvent(REMOVED, kPrimaryAccountKey), TrackingEvent(SIGN_OUT, "user@example.com")));
TrackingEvent(SIGN_OUT, "user@example.com"),
TrackingEvent(REMOVED, "user@example.com")));
} }
TEST_F(IdentityAccountTrackerTest, MultiRevokePrimaryDoesNotRemoveAllAccounts) { TEST_F(IdentityAccountTrackerTest, MultiRevokePrimaryDoesNotRemoveAllAccounts) {
......
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