Commit d9dd01f3 authored by Owen Min's avatar Owen Min Committed by Commit Bot

Fix flaky profile window browsertest

Fix ProfileWindowBrowserTest.OpenBrowserWindowForProfileWithSigninRequired on Linux
The test is flaky due to race conditionin the test body.

Bug: 904397, 901430
Change-Id: I80b73f507e3826fc7a707379b89b39a3e7aa68c5
Reviewed-on: https://chromium-review.googlesource.com/c/1330032Reviewed-by: default avatarMihai Sardarescu <msarda@chromium.org>
Commit-Queue: Owen Min <zmin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#607260}
parent 63962d3e
......@@ -247,10 +247,12 @@ IN_PROC_BROWSER_TEST_F(ProfileWindowBrowserTest,
.GetProfileAttributesWithPath(profile->GetPath(), &entry));
entry->SetIsSigninRequired(true);
size_t num_browsers = BrowserList::GetInstance()->size();
base::RunLoop run_loop;
UserManager::AddOnUserManagerShownCallbackForTesting(run_loop.QuitClosure());
profiles::OpenBrowserWindowForProfile(
ProfileManager::CreateCallback(), true, false, false, profile,
Profile::CreateStatus::CREATE_STATUS_INITIALIZED);
base::RunLoop().RunUntilIdle();
run_loop.Run();
EXPECT_EQ(num_browsers, BrowserList::GetInstance()->size());
EXPECT_TRUE(UserManager::IsShowing());
}
......
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