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

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

Issue 2759353004: Enable CredentialManagerBrowserTest.ObsoleteHttpCredentialMovedOnMigrationToHstsSite (Closed)
Patch Set: comments Created 3 years, 9 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 | chrome/browser/password_manager/password_manager_browsertest.cc » ('j') | 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 95fad6eca0f5847e780ba6f3c3700cae82fa8bac..f88f028417c153d4679029f6e0c29f71349795b5 100644
--- a/chrome/browser/password_manager/credential_manager_browsertest.cc
+++ b/chrome/browser/password_manager/credential_manager_browsertest.cc
@@ -162,9 +162,8 @@ IN_PROC_BROWSER_TEST_F(CredentialManagerBrowserTest,
EXPECT_TRUE(base::ContainsKey(passwords, www_url.spec()));
}
-// Flaky. See crbug.com/703305
IN_PROC_BROWSER_TEST_F(CredentialManagerBrowserTest,
- DISABLED_ObsoleteHttpCredentialMovedOnMigrationToHstsSite) {
+ ObsoleteHttpCredentialMovedOnMigrationToHstsSite) {
// Add an http credential to the password store.
GURL https_origin = https_test_server().base_url();
ASSERT_TRUE(https_origin.SchemeIs(url::kHttpsScheme));
@@ -191,29 +190,13 @@ IN_PROC_BROWSER_TEST_F(CredentialManagerBrowserTest,
ui_test_utils::NavigateToURL(
browser(), https_test_server().GetURL("/password/done.html"));
- // Call the API to trigger |get| and |store| and redirect.
+ // Call the API to trigger the account chooser.
ASSERT_TRUE(content::ExecuteScript(
RenderViewHost(), "navigator.credentials.get({password: true})"));
+ BubbleObserver(WebContents()).WaitForAccountChooser();
- // Issue the query for HTTPS credentials.
- WaitForPasswordStore();
-
- // Realize there are no HTTPS credentials and issue the query for HTTP
- // credentials instead.
+ // Wait for the migration logic to actually touch the password store.
WaitForPasswordStore();
-
- // Sync with IO thread before continuing. This is necessary, because the
- // credential migration triggers a query for the HSTS state which gets
- // executed on the IO thread. The actual task is empty, because only the reply
- // is relevant. By the time the reply is executed it is guaranteed that the
- // migration is completed.
- const auto empty_lambda = []() {};
- base::RunLoop run_loop;
- content::BrowserThread::PostTaskAndReply(content::BrowserThread::IO,
- FROM_HERE, base::Bind(empty_lambda),
- run_loop.QuitClosure());
- run_loop.Run();
-
// Only HTTPS passwords should be present.
EXPECT_TRUE(
password_store->stored_passwords().at(http_origin.spec()).empty());
« no previous file with comments | « no previous file | chrome/browser/password_manager/password_manager_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698