Skip to content

Commit

Permalink
Clean up pass on account_investigator_unittest.cc
Browse files Browse the repository at this point in the history
This is a follow up of [1], from blundell@.

[1] https://crrev.com/c/1398041/3/components/signin/core/browser/account_investigator_unittest.cc#183

Bug=919482

Change-Id: I5dbca667c7c4c8152fab529df976eb1e04acb983
Reviewed-on: https://chromium-review.googlesource.com/c/1403156
Reviewed-by: David Roger <droger@chromium.org>
Commit-Queue: Antonio Gomes <tonikitoo@igalia.com>
Cr-Commit-Position: refs/heads/master@{#621549}
  • Loading branch information
tonikitoo authored and Commit Bot committed Jan 10, 2019
1 parent 18fc32a commit 44a9100
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions components/signin/core/browser/account_investigator_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -150,25 +150,23 @@ AccountInfo Account(const std::string& id) {
return account;
}

AccountInfo Info(const std::string& id) {
AccountInfo info;
info.account_id = id;
return info;
}

// NOTE: IdentityTestEnvironment uses a prefix for generating gaia IDs:
// "gaia_id_for_". For this reason, the tests prefix expected account IDs
// used so that there is a match.

const std::string kGaiaId1 = identity::GetTestGaiaIdForEmail("1@mail.com");
const std::string kGaiaId2 = identity::GetTestGaiaIdForEmail("2@mail.com");
const std::string kGaiaId3 = identity::GetTestGaiaIdForEmail("3@mail.com");

const AccountInfo one(Account(kGaiaId1));
const AccountInfo two(Account(kGaiaId2));
const AccountInfo three(Account(kGaiaId3));

const std::vector<AccountInfo> no_accounts{};
const std::vector<AccountInfo> just_one{Account("gaia_id_for_1_mail.com")};
const std::vector<AccountInfo> just_two{Account("gaia_id_for_2_mail.com")};
const std::vector<AccountInfo> both{Account("gaia_id_for_1_mail.com"),
Account("gaia_id_for_2_mail.com")};
const std::vector<AccountInfo> both_reversed{Account("gaia_id_for_2_mail.com"),
Account("gaia_id_for_1_mail.com")};

const AccountInfo one(Info("gaia_id_for_1_mail.com"));
const AccountInfo three(Info("gaia_id_for_3_mail.com"));
const std::vector<AccountInfo> just_one{one};
const std::vector<AccountInfo> just_two{two};
const std::vector<AccountInfo> both{one, two};
const std::vector<AccountInfo> both_reversed{two, one};

TEST_F(AccountInvestigatorTest, CalculatePeriodicDelay) {
const Time epoch;
Expand Down

0 comments on commit 44a9100

Please sign in to comment.