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

Unified Diff: chrome/browser/ui/views/passwords/manage_passwords_bubble_view_browsertest.cc

Issue 1028243004: Hide the password bubble when the underlying ManagePasswordsUIController changes its state. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add a Mac test Created 5 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
Index: chrome/browser/ui/views/passwords/manage_passwords_bubble_view_browsertest.cc
diff --git a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view_browsertest.cc b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view_browsertest.cc
index 049b679f44007a129d99f3f963c882fe794e2ca9..654b1d565077ad1488a0ca5ad39e109c437553fa 100644
--- a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view_browsertest.cc
+++ b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view_browsertest.cc
@@ -193,11 +193,12 @@ IN_PROC_BROWSER_TEST_F(ManagePasswordsBubbleViewTest,
SetupAutomaticPassword();
EXPECT_TRUE(ManagePasswordsBubbleView::IsShowing());
ManagePasswordsBubbleView::CloseBubble();
+ content::RunAllPendingInMessageLoop();
// Re-opening should count as manual.
ExecuteManagePasswordsCommand();
EXPECT_TRUE(ManagePasswordsBubbleView::IsShowing());
- scoped_ptr<base::HistogramSamples> samples(
+ scoped_ptr<base::HistogramSamples> samples(
GetSamples(kDisplayDispositionMetric));
EXPECT_EQ(
1,
@@ -244,6 +245,15 @@ IN_PROC_BROWSER_TEST_F(ManagePasswordsBubbleViewTest, CloseOnKey) {
EXPECT_FALSE(ManagePasswordsBubbleView::IsShowing());
}
+IN_PROC_BROWSER_TEST_F(ManagePasswordsBubbleViewTest, CloseOnChangedState) {
+ SetupPendingPassword();
+ EXPECT_TRUE(ManagePasswordsBubbleView::IsShowing());
+ // User navigated very fast and landed on another page with an autofilled
+ // password. The save password bubble should disappear.
+ SetupManagingPasswords();
+ EXPECT_FALSE(ManagePasswordsBubbleView::IsShowing());
+}
+
IN_PROC_BROWSER_TEST_F(ManagePasswordsBubbleViewTest, TwoTabsWithBubble) {
// Set up the first tab with the bubble.
SetupPendingPassword();

Powered by Google App Engine
This is Rietveld 408576698