Commit 4219a997 authored by Marc Treib's avatar Marc Treib Committed by Commit Bot

Attempt to de-flake ProfileMenuClickTest_WithUnconsentedPrimaryAccount

It seems that signin::MakeAccountAvailableWithCookies, previously used
by these tests, doesn't reliably make an unconsented primary account
available.
This CL changes the ProfileMenuClickTests to use helpers from
secondary_account_helper:: instead, since several other browser tests
use these and seem to be fine.

If this resolves the flakiness, a followup item is to investigate what
the relevant difference is between these helpers.

Bug: 1015429
Change-Id: I2be36f30e08827911e7492fd69a6d531563eed34
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1899871Reviewed-by: default avatarThomas Tangl <tangltom@chromium.org>
Commit-Queue: Marc Treib <treib@chromium.org>
Cr-Commit-Position: refs/heads/master@{#712635}
parent e5806b10
......@@ -644,6 +644,11 @@ class ProfileMenuClickTest : public SyncTest,
scoped_feature_list_.InitAndEnableFeature(features::kProfileMenuRevamp);
}
void SetUpInProcessBrowserTestFixture() override {
test_signin_client_factory_ =
secondary_account_helper::SetUpSigninClient(&test_url_loader_factory_);
}
void SetUpOnMainThread() override {
SyncTest::SetUpOnMainThread();
......@@ -740,6 +745,9 @@ class ProfileMenuClickTest : public SyncTest,
ProfileMenuViewBase::GetBubbleForTesting());
}
secondary_account_helper::ScopedSigninClientFactory
test_signin_client_factory_;
base::test::ScopedFeatureList scoped_feature_list_;
base::HistogramTester histogram_tester_;
......@@ -945,13 +953,10 @@ constexpr ProfileMenuViewBase::ActionableItem
// there are no other buttons at the end.
ProfileMenuViewBase::ActionableItem::kPasswordsButton};
// TODO(crbug.com/1015429): Failing on Mac 10.12.
PROFILE_MENU_CLICK_TEST(
kActionableItems_WithUnconsentedPrimaryAccount,
DISABLED_ProfileMenuClickTest_WithUnconsentedPrimaryAccount) {
signin::MakeAccountAvailableWithCookies(identity_manager(),
&test_url_loader_factory_,
"user@example.com", "gaia_id");
PROFILE_MENU_CLICK_TEST(kActionableItems_WithUnconsentedPrimaryAccount,
ProfileMenuClickTest_WithUnconsentedPrimaryAccount) {
secondary_account_helper::SignInSecondaryAccount(
browser()->profile(), &test_url_loader_factory_, "user@example.com");
UnconsentedPrimaryAccountChecker(identity_manager()).Wait();
// Check that the setup was successful.
ASSERT_FALSE(identity_manager()->HasPrimaryAccount());
......
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