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

Unified Diff: chrome/browser/ui/cocoa/base_bubble_controller_unittest.mm

Issue 75543008: Fix alignment for bubbles with center-arrows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Kill blank line. Created 7 years, 1 month 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/base_bubble_controller.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/base_bubble_controller_unittest.mm
diff --git a/chrome/browser/ui/cocoa/base_bubble_controller_unittest.mm b/chrome/browser/ui/cocoa/base_bubble_controller_unittest.mm
index f2e8bb5e64f890cef393e1328bc8503538569feb..7a69dfccd80416f58d979f64d24e6a5bf46b8597 100644
--- a/chrome/browser/ui/cocoa/base_bubble_controller_unittest.mm
+++ b/chrome/browser/ui/cocoa/base_bubble_controller_unittest.mm
@@ -114,6 +114,22 @@ TEST_F(BaseBubbleControllerTest, AnchorAlignRightArrow) {
EXPECT_GE(NSMaxY(frame), kAnchorPointY);
}
+// Test that kAlignArrowToAnchor and a center bubble arrow correctly align
+// the bubble towards the anchor point.
+TEST_F(BaseBubbleControllerTest, AnchorAlignCenterArrow) {
+ [[controller_ bubble] setArrowLocation:info_bubble::kTopCenter];
+ [[controller_ bubble] setAlignment:info_bubble::kAlignArrowToAnchor];
+ [controller_ showWindow:nil];
+
+ NSRect frame = [[controller_ window] frame];
+ // Make sure the bubble size hasn't changed.
+ EXPECT_EQ(frame.size.width, kBubbleWindowWidth);
+ EXPECT_EQ(frame.size.height, kBubbleWindowHeight);
+ // Make sure the bubble arrow points to the anchor.
+ EXPECT_EQ(NSMidX(frame), kAnchorPointX);
+ EXPECT_GE(NSMaxY(frame), kAnchorPointY);
+}
+
// Tests that when a new window gets key state (and the bubble resigns) that
// the key window changes.
TEST_F(BaseBubbleControllerTest, ResignKeyCloses) {
« no previous file with comments | « chrome/browser/ui/cocoa/base_bubble_controller.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698