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

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

Issue 2166823004: Place WaitForPasswordStore() before checking the store/prompt in CredentialManagerBrowserTest* (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 e1bc760f1b89fd9de09f7cb2b9b7bfdfa47040dc..e4854093f00e51bc1194b7a2ff8eb498b67ef3c8 100644
--- a/chrome/browser/password_manager/credential_manager_browsertest.cc
+++ b/chrome/browser/password_manager/credential_manager_browsertest.cc
@@ -104,9 +104,12 @@ IN_PROC_BROWSER_TEST_F(CredentialManagerBrowserTest,
// Verify that the form's 'skip_zero_click' is updated and not overwritten
// by the autofill password manager on successful login.
- auto& passwords_map = password_store->stored_passwords();
+ WaitForPasswordStore();
+ password_manager::TestPasswordStore::PasswordMap passwords_map =
+ password_store->stored_passwords();
ASSERT_EQ(1u, passwords_map.size());
- auto& passwords_vector = passwords_map.begin()->second;
+ const std::vector<autofill::PasswordForm>& passwords_vector =
+ passwords_map.begin()->second;
ASSERT_EQ(1u, passwords_vector.size());
const autofill::PasswordForm& form = passwords_vector[0];
EXPECT_EQ(base::ASCIIToUTF16("user"), form.username_value);
@@ -177,6 +180,9 @@ IN_PROC_BROWSER_TEST_F(CredentialManagerBrowserTest,
RenderViewHost(),
"var c = new PasswordCredential({ id: 'user', password: '12345' });"
"navigator.credentials.store(c);"));
+ // Wait for the password store before checking the prompt because it pops up
+ // after the store replies.
+ WaitForPasswordStore();
std::unique_ptr<BubbleObserver> prompt_observer(
new BubbleObserver(WebContents()));
EXPECT_TRUE(prompt_observer->IsShowingSavePrompt());
@@ -235,11 +241,13 @@ IN_PROC_BROWSER_TEST_F(CredentialManagerBrowserTest, UpdateViaAPIAndAutofill) {
"document.getElementById('input_submit_button').click();"));
form_submit_observer.Wait();
+ // Wait for the password store before checking the prompt because it pops up
+ // after the store replies.
+ WaitForPasswordStore();
std::unique_ptr<BubbleObserver> prompt_observer(
new BubbleObserver(WebContents()));
EXPECT_FALSE(prompt_observer->IsShowingSavePrompt());
EXPECT_FALSE(prompt_observer->IsShowingUpdatePrompt());
- WaitForPasswordStore();
signin_form.skip_zero_click = false;
signin_form.times_used = 1;
signin_form.password_value = base::ASCIIToUTF16("API");
« 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