summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/toolbar_controller_unittest.mm
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-15 22:46:03 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-15 22:46:03 +0000
commit413df1b5ebacf0f3bc2ad03020e9f93b92717803 (patch)
tree92381b78a0b3a1682523b338428688bd4e23cd9e /chrome/browser/cocoa/toolbar_controller_unittest.mm
parent76665e75f3f10a3171efd3bebfbd9c59a7648a00 (diff)
downloadchromium_src-413df1b5ebacf0f3bc2ad03020e9f93b92717803.zip
chromium_src-413df1b5ebacf0f3bc2ad03020e9f93b92717803.tar.gz
chromium_src-413df1b5ebacf0f3bc2ad03020e9f93b92717803.tar.bz2
Convert the AutocompletePopupPositioner into a BubblePositioner in preparation for using it to position both the Omnibox bubble and InfoBubbles. It now gets the bounds of the location stack, which can be turned into useful coordinates for both items.
This should not result in any visible change. BUG=21028 TEST=none Review URL: http://codereview.chromium.org/194110 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26288 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/toolbar_controller_unittest.mm')
-rw-r--r--chrome/browser/cocoa/toolbar_controller_unittest.mm21
1 files changed, 9 insertions, 12 deletions
diff --git a/chrome/browser/cocoa/toolbar_controller_unittest.mm b/chrome/browser/cocoa/toolbar_controller_unittest.mm
index 21f9e61..9ba3236 100644
--- a/chrome/browser/cocoa/toolbar_controller_unittest.mm
+++ b/chrome/browser/cocoa/toolbar_controller_unittest.mm
@@ -273,7 +273,7 @@ TEST_F(ToolbarControllerTest, StarButtonInWindowCoordinates) {
EXPECT_TRUE(NSContainsRect(all, star));
}
-TEST_F(ToolbarControllerTest, AutocompletePopupPosition) {
+TEST_F(ToolbarControllerTest, BubblePosition) {
NSView* locationBar = [[bar_ toolbarViews] objectAtIndex:kLocationIndex];
// The window frame (in window base coordinates).
@@ -281,17 +281,14 @@ TEST_F(ToolbarControllerTest, AutocompletePopupPosition) {
// 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 above the bottom of the
- // location bar.
- EXPECT_GE(popupFrame.bottom(), NSMinY(locationFrame));
+ // The frame of the location stack in window base coordinates. The horizontal
+ // coordinates here are used for the omnibox dropdown.
+ gfx::Rect locationStackFrame = [bar_ locationStackBounds];
+
+ // Make sure the location stack starts to the left of and ends to the right of
+ // the location bar.
+ EXPECT_LT(locationStackFrame.x(), NSMinX(locationFrame));
+ EXPECT_GT(locationStackFrame.right(), NSMaxX(locationFrame));
}
TEST_F(ToolbarControllerTest, HoverButtonForEvent) {