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

Unified Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller_unittest.mm

Issue 6257005: Adjustments to bookmark bar folder menu placement issues.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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/cocoa/bookmarks/bookmark_bar_folder_controller_unittest.mm
===================================================================
--- chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller_unittest.mm (revision 71884)
+++ chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller_unittest.mm (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -44,7 +44,7 @@
} else {
CGFloat nextVerticalOffset = [button frame].origin.y;
EXPECT_CGFLOAT_EQ(lastVerticalOffset -
- bookmarks::kBookmarkButtonVerticalSpan,
+ bookmarks::kBookmarkFolderButtonHeight,
nextVerticalOffset);
lastVerticalOffset = nextVerticalOffset;
}
@@ -483,9 +483,11 @@
break;
targetButton = button;
}
+ EXPECT_TRUE(targetButton != nil);
NSPoint hitPoint = [targetButton frame].origin;
hitPoint.x += 50.0;
- hitPoint.y += (bookmarks::kBookmarkButtonHeight / 2.0) - scrollPoint.y;
+ hitPoint.y += (bookmarks::kBookmarkFolderButtonHeight / 2.0) - scrollPoint.y;
+ hitPoint = [targetButton convertPoint:hitPoint toView:scrollView];
for (int i = 0; i < 3; i++) {
CGFloat height = NSHeight([window frame]);
@@ -557,7 +559,7 @@
// the top of the window has moved up, then delete a visible button and
// make sure the top has not moved.
oldTop = newTop;
- const CGFloat scrollOneBookmark = bookmarks::kBookmarkButtonHeight +
+ const CGFloat scrollOneBookmark = bookmarks::kBookmarkFolderButtonHeight +
bookmarks::kBookmarkVerticalPadding;
NSUInteger buttonCounter = 0;
NSUInteger extraButtonLimit = 3;
@@ -729,10 +731,8 @@
// and grown vertically.
NSRect expectedToWindowFrame = oldToWindowFrame;
expectedToWindowFrame.origin.x -= horizontalShift;
- CGFloat diff = (bookmarks::kBookmarkBarHeight +
- 2*bookmarks::kBookmarkVerticalPadding);
- expectedToWindowFrame.origin.y -= diff;
- expectedToWindowFrame.size.height += diff;
+ expectedToWindowFrame.origin.y -= bookmarks::kBookmarkFolderButtonHeight;
+ expectedToWindowFrame.size.height += bookmarks::kBookmarkFolderButtonHeight;
EXPECT_NSRECT_EQ(expectedToWindowFrame, newToWindowFrame);
// Check button spacing.
@@ -796,10 +796,8 @@
EXPECT_NSRECT_EQ(oldToFolderFrame, newToFolderFrame);
// The toWindow should have shifted down vertically and grown vertically.
NSRect expectedToWindowFrame = oldToWindowFrame;
- CGFloat diff = (bookmarks::kBookmarkBarHeight +
- 2*bookmarks::kBookmarkVerticalPadding);
- expectedToWindowFrame.origin.y -= diff;
- expectedToWindowFrame.size.height += diff;
+ expectedToWindowFrame.origin.y -= bookmarks::kBookmarkFolderButtonHeight;
+ expectedToWindowFrame.size.height += bookmarks::kBookmarkFolderButtonHeight;
EXPECT_NSRECT_EQ(expectedToWindowFrame, newToWindowFrame);
// Copy the button back to the bar after "3b".
@@ -875,10 +873,9 @@
EXPECT_NSRECT_EQ(oldToWindowFrame, newToWindowFrame);
NSRect newToSubwindowFrame = [toSubwindow frame];
NSRect expectedToSubwindowFrame = oldToSubwindowFrame;
- expectedToSubwindowFrame.origin.y -=
- (bookmarks::kBookmarkButtonHeight + bookmarks::kVisualHeightOffset);
+ expectedToSubwindowFrame.origin.y -= bookmarks::kBookmarkFolderButtonHeight;
expectedToSubwindowFrame.size.height +=
- (bookmarks::kBookmarkButtonHeight + bookmarks::kVisualHeightOffset);
+ bookmarks::kBookmarkFolderButtonHeight;
EXPECT_NSRECT_EQ(expectedToSubwindowFrame, newToSubwindowFrame);
}
@@ -1181,7 +1178,7 @@
EXPECT_TRUE(folderController);
NSWindow* folderWindow = [folderController window];
EXPECT_TRUE(folderWindow);
- CGFloat expectedHeight = (CGFloat)bookmarks::kBookmarkButtonHeight +
+ CGFloat expectedHeight = (CGFloat)bookmarks::kBookmarkFolderButtonHeight +
(2*bookmarks::kBookmarkVerticalPadding);
NSRect windowFrame = [folderWindow frame];
CGFloat windowHeight = NSHeight(windowFrame);

Powered by Google App Engine
This is Rietveld 408576698