Commit 12f11d7e authored by Rushan Suleymanov's avatar Rushan Suleymanov Committed by Commit Bot

Fix flaky sync autofill wallet test

Bug: 1083061
Change-Id: Ib63cd6bb6618b8314e15c4a22ca331c903223187
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2204020
Commit-Queue: Jan Krcal <jkrcal@chromium.org>
Auto-Submit: Rushan Suleymanov <rushans@google.com>
Reviewed-by: default avatarJan Krcal <jkrcal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#769617}
parent 8a22c208
...@@ -252,6 +252,13 @@ class SingleClientWalletSyncTest : public SyncTest { ...@@ -252,6 +252,13 @@ class SingleClientWalletSyncTest : public SyncTest {
} }
} }
void WaitForCreditCardCloudTokenData(size_t expected_count,
autofill::PersonalDataManager* pdm) {
while (pdm->GetCreditCardCloudTokenData().size() != expected_count) {
WaitForOnPersonalDataChanged(pdm);
}
}
bool TriggerGetUpdatesAndWait() { bool TriggerGetUpdatesAndWait() {
const base::Time now = base::Time::Now(); const base::Time now = base::Time::Now();
// Trigger a sync and wait for the new data to arrive. // Trigger a sync and wait for the new data to arrive.
...@@ -381,17 +388,8 @@ IN_PROC_BROWSER_TEST_F(SingleClientWalletWithAccountStorageSyncTest, ...@@ -381,17 +388,8 @@ IN_PROC_BROWSER_TEST_F(SingleClientWalletWithAccountStorageSyncTest,
// Wallet data should get cleared from the database when the user signs out and // Wallet data should get cleared from the database when the user signs out and
// different data should get downstreamed when the user signs in with a // different data should get downstreamed when the user signs in with a
// different account. // different account.
//
// Flaky on Windows ASAN. TODO(crbug.com/1083061): Enable this test.
#if defined(OS_WIN) && defined(ADDRESS_SANITIZER)
#define MAYBE_ClearOnSignOutAndDownstreamOnSignIn \
DISABLED_ClearOnSignOutAndDownstreamOnSignIn
#else
#define MAYBE_ClearOnSignOutAndDownstreamOnSignIn \
ClearOnSignOutAndDownstreamOnSignIn
#endif
IN_PROC_BROWSER_TEST_F(SingleClientWalletWithAccountStorageSyncTest, IN_PROC_BROWSER_TEST_F(SingleClientWalletWithAccountStorageSyncTest,
MAYBE_ClearOnSignOutAndDownstreamOnSignIn) { ClearOnSignOutAndDownstreamOnSignIn) {
ASSERT_TRUE(SetupClients()); ASSERT_TRUE(SetupClients());
autofill::PersonalDataManager* pdm = GetPersonalDataManager(0); autofill::PersonalDataManager* pdm = GetPersonalDataManager(0);
ASSERT_NE(nullptr, pdm); ASSERT_NE(nullptr, pdm);
...@@ -408,10 +406,10 @@ IN_PROC_BROWSER_TEST_F(SingleClientWalletWithAccountStorageSyncTest, ...@@ -408,10 +406,10 @@ IN_PROC_BROWSER_TEST_F(SingleClientWalletWithAccountStorageSyncTest,
ASSERT_TRUE(AwaitQuiescence()); ASSERT_TRUE(AwaitQuiescence());
// Make sure the data & metadata is in the DB. // Make sure the data & metadata is in the DB.
ASSERT_EQ(1uL, pdm->GetServerProfiles().size()); WaitForNumberOfCards(1, pdm);
ASSERT_EQ(1uL, pdm->GetCreditCards().size()); WaitForNumberOfServerProfiles(1, pdm);
ASSERT_EQ(kDefaultCustomerID, pdm->GetPaymentsCustomerData()->customer_id); WaitForPaymentsCustomerData(kDefaultCustomerID, pdm);
ASSERT_EQ(1uL, pdm->GetCreditCardCloudTokenData().size()); WaitForCreditCardCloudTokenData(1, pdm);
// Signout, the data & metadata should be gone. // Signout, the data & metadata should be gone.
GetClient(0)->SignOutPrimaryAccount(); GetClient(0)->SignOutPrimaryAccount();
......
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