Fix flaky CredentialManagerBrowserTest.AccountChooserWithOldCredentialAndNavigation and StoreSavesPSLMatchedCredential

navigator.credentials.get is dispatched via Mojo from renderer to browser. The test should wait for this call to be processed. Here is an example of the failure.

[ RUN      ] CredentialManagerBrowserTest.AccountChooserWithOldCredentialAndNavigation
[38019:771:0421/041104.591122:WARNING:ipc_message_attachment_set.cc(49)] MessageAttachmentSet destroyed with unconsumed attachments: 0/1
[38019:59655:0421/041105.028129:WARNING:embedded_test_server.cc(219)] Request not handled. Returning 404: /favicon.ico
../../chrome/browser/password_manager/credential_manager_browsertest.cc:80: Failure
Value of: PasswordsModelDelegateFromWebContents(WebContents())->GetState()
  Actual: 3
Expected: password_manager::ui::CREDENTIAL_REQUEST_STATE
Which is: 4

BUG=629459

Review-Url: https://codereview.chromium.org/2831343002
Cr-Commit-Position: refs/heads/master@{#466326}
1 file changed