Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1600)

Unified Diff: chrome/browser/password_manager/credential_manager_browsertest.cc

Issue 2831343002: Fix flaky CredentialManagerBrowserTest.AccountChooserWithOldCredentialAndNavigation and StoreSavesP… (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/password_manager/credential_manager_browsertest.cc
diff --git a/chrome/browser/password_manager/credential_manager_browsertest.cc b/chrome/browser/password_manager/credential_manager_browsertest.cc
index f88f028417c153d4679029f6e0c29f71349795b5..07f77a8be4186270f2b18e8b0981df374ab3f9e5 100644
--- a/chrome/browser/password_manager/credential_manager_browsertest.cc
+++ b/chrome/browser/password_manager/credential_manager_browsertest.cc
@@ -74,10 +74,8 @@ IN_PROC_BROWSER_TEST_F(CredentialManagerBrowserTest,
RenderViewHost(),
"navigator.credentials.get({password: true})"
".then(cred => window.location = '/password/done.html')"));
- WaitForPasswordStore();
- ASSERT_EQ(
- password_manager::ui::CREDENTIAL_REQUEST_STATE,
- PasswordsModelDelegateFromWebContents(WebContents())->GetState());
+ // Mojo calls from the renderer are asynchronous.
+ BubbleObserver(WebContents()).WaitForAccountChooser();
PasswordsModelDelegateFromWebContents(WebContents())->ChooseCredential(
signin_form,
password_manager::CredentialType::CREDENTIAL_TYPE_PASSWORD);
@@ -134,9 +132,8 @@ IN_PROC_BROWSER_TEST_F(CredentialManagerBrowserTest,
".then(cred => "
"window.location = '/password/done.html'))"));
- WaitForPasswordStore();
- ASSERT_EQ(password_manager::ui::CREDENTIAL_REQUEST_STATE,
- PasswordsModelDelegateFromWebContents(WebContents())->GetState());
+ // Mojo calls from the renderer are asynchronous.
+ BubbleObserver(WebContents()).WaitForAccountChooser();
PasswordsModelDelegateFromWebContents(WebContents())
->ChooseCredential(
signin_form,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698