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

Unified Diff: chrome/browser/cocoa/toolbar_controller_unittest.mm

Issue 173439: [Mac] The autocomplete popup now gets its position from the toolbar controlle... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 4 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/cocoa/toolbar_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/cocoa/toolbar_controller_unittest.mm
===================================================================
--- chrome/browser/cocoa/toolbar_controller_unittest.mm (revision 24441)
+++ chrome/browser/cocoa/toolbar_controller_unittest.mm (working copy)
@@ -256,5 +256,26 @@
EXPECT_TRUE(NSContainsRect(all, star));
}
+TEST_F(ToolbarControllerTest, AutocompletePopupPosition) {
+ NSView* locationBar = [[bar_ toolbarViews] objectAtIndex:kLocationIndex];
+ // The window frame (in window base coordinates).
+ NSRect all = [[[bar_ view] window] frame];
+ // The frame of the location bar in window base coordinates.
+ NSRect locationFrame =
+ [locationBar convertRect:[locationBar bounds] toView:nil];
+ // The frame of the popup in window base coordinates.
+ gfx::Rect popupFrame = [bar_ autocompletePopupPosition];
+
+ // Make sure the popup starts to the left of and ends to the right of the
+ // location bar.
+ EXPECT_LT(popupFrame.x(), NSMinX(locationFrame));
+ EXPECT_GT(popupFrame.right(), NSMaxX(locationFrame));
+
+ // Make sure the popup frame is positioned at the bottom of the location bar.
+ EXPECT_EQ(popupFrame.bottom(), NSMinY(locationFrame));
+}
+
+
+
} // namespace
« no previous file with comments | « chrome/browser/cocoa/toolbar_controller.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698