| Index: components/signin/core/browser/signin_investigator_unittest.cc
|
| diff --git a/components/signin/core/browser/signin_investigator_unittest.cc b/components/signin/core/browser/signin_investigator_unittest.cc
|
| index 0f5d25fff90968dfb61eea0e43a65bef64b977fd..c031865167a622f8a6af30c68f22f8c52ddb28a5 100644
|
| --- a/components/signin/core/browser/signin_investigator_unittest.cc
|
| +++ b/components/signin/core/browser/signin_investigator_unittest.cc
|
| @@ -42,10 +42,16 @@ class SigninInvestigatorTest : public testing::Test {
|
| const std::string& id,
|
| bool equals_expectated,
|
| AccountEquality histogram_expected) {
|
| - base::HistogramTester histogram_tester;
|
| FakeProvider provider(email, id);
|
| SigninInvestigator investigator(kSameEmail, kSameId, &provider);
|
| - bool equals_actual = investigator.AreAccountsEqualWithFallback();
|
| + AssertAccountEquality(&investigator, equals_expectated, histogram_expected);
|
| + }
|
| +
|
| + void AssertAccountEquality(SigninInvestigator* investigator,
|
| + bool equals_expectated,
|
| + AccountEquality histogram_expected) {
|
| + base::HistogramTester histogram_tester;
|
| + bool equals_actual = investigator->AreAccountsEqualWithFallback();
|
| ASSERT_EQ(equals_expectated, equals_actual);
|
| histogram_tester.ExpectUniqueSample(
|
| "Signin.AccountEquality", static_cast<int>(histogram_expected), 1);
|
| @@ -93,6 +99,18 @@ TEST_F(SigninInvestigatorTest, EqualityDifferentEmailFallback) {
|
| AccountEquality::EMAIL_FALLBACK);
|
| }
|
|
|
| +TEST_F(SigninInvestigatorTest, EqualitySameEmailFallbackEmptyCurrentId) {
|
| + FakeProvider provider(kSameEmail, kDifferentId);
|
| + SigninInvestigator investigator(kSameEmail, kEmptyId, &provider);
|
| + AssertAccountEquality(&investigator, true, AccountEquality::EMAIL_FALLBACK);
|
| +}
|
| +
|
| +TEST_F(SigninInvestigatorTest, EqualityDifferentEmailFallbackEmptyCurrentId) {
|
| + FakeProvider provider(kDifferentId, kDifferentId);
|
| + SigninInvestigator investigator(kSameEmail, kEmptyId, &provider);
|
| + AssertAccountEquality(&investigator, false, AccountEquality::EMAIL_FALLBACK);
|
| +}
|
| +
|
| TEST_F(SigninInvestigatorTest, InvestigateSameAccount) {
|
| AssertInvestigatedScenario(kSameEmail, kSameId,
|
| InvestigatedScenario::SAME_ACCOUNT);
|
|
|