Commit 571d57e6 authored by Vasilii Sukhanov's avatar Vasilii Sukhanov Committed by Commit Bot

Add more checks to NoPromptForSeperateLoginFormWhenSwitchingFromHttpsToHttp to trace its flakiness

Bug: 355145
Change-Id: I9627c0f70f4f9f27023c937e0d2a3a9db48de63f
Reviewed-on: https://chromium-review.googlesource.com/600328Reviewed-by: default avatarMaxim Kolosovskiy <kolos@chromium.org>
Commit-Queue: Vasilii Sukhanov <vasilii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491727}
parent bdf84c7c
...@@ -1500,6 +1500,10 @@ IN_PROC_BROWSER_TEST_F( ...@@ -1500,6 +1500,10 @@ IN_PROC_BROWSER_TEST_F(
redirect_observer.SetPathToWaitFor("/password/redirect.html"); redirect_observer.SetPathToWaitFor("/password/redirect.html");
redirect_observer.Wait(); redirect_observer.Wait();
WaitForPasswordStore();
BubbleObserver prompt_observer(WebContents());
EXPECT_TRUE(prompt_observer.IsShowingSavePrompt());
// Normally the redirect happens to done.html. Here an attack is simulated // Normally the redirect happens to done.html. Here an attack is simulated
// that hijacks the redirect to a attacker controlled page. // that hijacks the redirect to a attacker controlled page.
GURL http_url( GURL http_url(
...@@ -1513,6 +1517,8 @@ IN_PROC_BROWSER_TEST_F( ...@@ -1513,6 +1517,8 @@ IN_PROC_BROWSER_TEST_F(
attacker_observer.SetPathToWaitFor("/password/simple_password.html"); attacker_observer.SetPathToWaitFor("/password/simple_password.html");
attacker_observer.Wait(); attacker_observer.Wait();
EXPECT_TRUE(prompt_observer.IsShowingSavePrompt());
std::string fill_and_submit_attacker_form = std::string fill_and_submit_attacker_form =
"document.getElementById('username_field').value = 'attacker_username';" "document.getElementById('username_field').value = 'attacker_username';"
"document.getElementById('password_field').value = 'attacker_password';" "document.getElementById('password_field').value = 'attacker_password';"
...@@ -1524,8 +1530,6 @@ IN_PROC_BROWSER_TEST_F( ...@@ -1524,8 +1530,6 @@ IN_PROC_BROWSER_TEST_F(
done_observer.SetPathToWaitFor("/password/done.html"); done_observer.SetPathToWaitFor("/password/done.html");
done_observer.Wait(); done_observer.Wait();
WaitForPasswordStore();
BubbleObserver prompt_observer(WebContents());
EXPECT_TRUE(prompt_observer.IsShowingSavePrompt()); EXPECT_TRUE(prompt_observer.IsShowingSavePrompt());
prompt_observer.AcceptSavePrompt(); prompt_observer.AcceptSavePrompt();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment