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

Unified Diff: chrome/browser/ui/cocoa/location_bar/zoom_decoration_browsertest.mm

Issue 968213003: Don't hide the zoom icon when not at default zoom. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add regression test. Created 5 years, 10 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 | « chrome/browser/ui/cocoa/location_bar/zoom_decoration.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/location_bar/zoom_decoration_browsertest.mm
diff --git a/chrome/browser/ui/cocoa/location_bar/zoom_decoration_browsertest.mm b/chrome/browser/ui/cocoa/location_bar/zoom_decoration_browsertest.mm
index 0e4d425eb3c4a9b4767f62c3282ebd4872417fd1..e9d92b84a298109de5d213de47991400934d1e02 100644
--- a/chrome/browser/ui/cocoa/location_bar/zoom_decoration_browsertest.mm
+++ b/chrome/browser/ui/cocoa/location_bar/zoom_decoration_browsertest.mm
@@ -108,6 +108,32 @@ IN_PROC_BROWSER_TEST_F(ZoomDecorationTest, BubbleAtDefaultZoom) {
EXPECT_FALSE(zoom_decoration->IsVisible());
}
+// Regression test for https://crbug.com/462482.
+IN_PROC_BROWSER_TEST_F(ZoomDecorationTest, IconRemainsVisibleAfterBubble) {
+ ZoomDecoration* zoom_decoration = GetZoomDecoration();
+
+ // See comment in BubbleAtDefaultZoom regarding this next line.
+ ui_zoom::ZoomController::FromWebContents(
+ GetLocationBar()->GetWebContents())->SetShowsNotificationBubble(false);
+
+ // Zoom in to turn on decoration icon.
+ EXPECT_FALSE(zoom_decoration->IsVisible());
+ Zoom(content::PAGE_ZOOM_IN);
+ EXPECT_TRUE(zoom_decoration->IsVisible());
+
+ // Show zoom bubble, verify decoration icon remains visible.
+ zoom_decoration->ShowBubble(/* auto_close = */false);
+ EXPECT_TRUE(zoom_decoration->IsVisible());
+
+ // Close bubble and verify the decoration is still visible.
+ zoom_decoration->CloseBubble();
+ EXPECT_TRUE(zoom_decoration->IsVisible());
+
+ // Verify the decoration does go away when we expect it to.
+ Zoom(content::PAGE_ZOOM_RESET);
+ EXPECT_FALSE(zoom_decoration->IsVisible());
+}
+
IN_PROC_BROWSER_TEST_F(ZoomDecorationTest, HideOnInputProgress) {
ZoomDecoration* zoom_decoration = GetZoomDecoration();
« no previous file with comments | « chrome/browser/ui/cocoa/location_bar/zoom_decoration.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698