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

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

Issue 2174823002: Fix flaky CredentialManagerBrowserTest.AutoSigninOldCredentialAndNavigation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 978620b2821d5e49f899747b22aa1efc1b773365..388d76429db472803a46f02b4f8683636612eed3 100644
--- a/chrome/browser/password_manager/credential_manager_browsertest.cc
+++ b/chrome/browser/password_manager/credential_manager_browsertest.cc
@@ -117,16 +117,9 @@ IN_PROC_BROWSER_TEST_F(CredentialManagerBrowserTest,
EXPECT_FALSE(form.skip_zero_click);
}
-// TODO(crbug.com/626759): flakily failing on Mac.
-#if defined(OS_MACOSX)
-#define MAYBE_AutoSigninOldCredentialAndNavigation \
- DISABLED_AutoSigninOldCredentialAndNavigation
-#else
-#define MAYBE_AutoSigninOldCredentialAndNavigation \
- AutoSigninOldCredentialAndNavigation
-#endif
+
IN_PROC_BROWSER_TEST_F(CredentialManagerBrowserTest,
- MAYBE_AutoSigninOldCredentialAndNavigation) {
+ AutoSigninOldCredentialAndNavigation) {
// Save credentials with 'skip_zero_click' false.
scoped_refptr<password_manager::TestPasswordStore> password_store =
static_cast<password_manager::TestPasswordStore*>(
@@ -150,11 +143,15 @@ IN_PROC_BROWSER_TEST_F(CredentialManagerBrowserTest,
"document.getElementById('password_field').value = 'trash';";
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_password));
- // Call the API to trigger the notification to the client.
+ // Call the API with a delay to trigger the notification to the client. The
+ // delay ensures that parsing password forms won't happen again after the API
+ // call making the test flaky.
ASSERT_TRUE(content::ExecuteScript(
RenderViewHost(),
- "navigator.credentials.get({password: true})"
- ".then(cred => window.location = '/password/done.html')"));
+ "setTimeout( function() {"
+ "navigator.credentials.get({password: true})"
+ ".then(cred => window.location = '/password/done.html');"
+ "}, 1000)"));
NavigationObserver observer(WebContents());
observer.SetPathToWaitFor("/password/done.html");
« 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