summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/bookmark_bar_controller_unittest.mm
diff options
context:
space:
mode:
authormrossetti@chromium.org <mrossetti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-26 20:09:18 +0000
committermrossetti@chromium.org <mrossetti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-26 20:09:18 +0000
commita8e4a8fa39604cd309e1e3d62cf9c552dcfe541d (patch)
tree9ac98acea8834eff2c6298f931d03324b06fab21 /chrome/browser/cocoa/bookmark_bar_controller_unittest.mm
parent6a0ee4ec5905be6182b20218da1c276fc7e457fd (diff)
downloadchromium_src-a8e4a8fa39604cd309e1e3d62cf9c552dcfe541d.zip
chromium_src-a8e4a8fa39604cd309e1e3d62cf9c552dcfe541d.tar.gz
chromium_src-a8e4a8fa39604cd309e1e3d62cf9c552dcfe541d.tar.bz2
Resize the "For quick access..." and "Import bookmarks now..." components shown in the bookmark bar when there are no bookmarks in the bar, when the window resizes. Show ellipses when each gets trimmed and hide them when they get too small.
BookmarkBar.xib changes: Connect the "Import bookmarks now..." button up to the importBookmarksButton_ outlet in the BookmarkBarView. BUG=32557 TEST=1) Start up a browser with no bookmarks on the bookmarks bar. 2) Verify that the "For quick access..." and "Import bookmarks now..." test fully shows. 3) Start shrinking the width of the browser window. 4) Verify that the "Import bookmarks now..." text is shrunk/clipped and finally disappears as the window gets narrower. 5) Continue shrinking the width and verify that the "For quick access..." text is shrunk/clipped with ellipses as the window gets narrower. 6) Grow the window and verify that the "For quick access..." reappears and then the "Import book now..." does. Review URL: http://codereview.chromium.org/2243002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48316 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/bookmark_bar_controller_unittest.mm')
-rw-r--r--chrome/browser/cocoa/bookmark_bar_controller_unittest.mm19
1 files changed, 19 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/bookmark_bar_controller_unittest.mm b/chrome/browser/cocoa/bookmark_bar_controller_unittest.mm
index 300d01c..5c2e8cc 100644
--- a/chrome/browser/cocoa/bookmark_bar_controller_unittest.mm
+++ b/chrome/browser/cocoa/bookmark_bar_controller_unittest.mm
@@ -1593,6 +1593,25 @@ TEST_F(BookmarkBarControllerTest, MoveRemoveAddButtons) {
EXPECT_EQ(oldDisplayedButtons, [bar_ displayedButtonCount]);
}
+TEST_F(BookmarkBarControllerTest, ShrinkOrHideView) {
+ NSRect viewFrame = NSMakeRect(0.0, 0.0, 500.0, 50.0);
+ NSView* view = [[[NSView alloc] initWithFrame:viewFrame] autorelease];
+ EXPECT_FALSE([view isHidden]);
+ [bar_ shrinkOrHideView:view forMaxX:500.0];
+ EXPECT_EQ(500.0, NSWidth([view frame]));
+ EXPECT_FALSE([view isHidden]);
+ [bar_ shrinkOrHideView:view forMaxX:450.0];
+ EXPECT_EQ(450.0, NSWidth([view frame]));
+ EXPECT_FALSE([view isHidden]);
+ [bar_ shrinkOrHideView:view forMaxX:40.0];
+ EXPECT_EQ(40.0, NSWidth([view frame]));
+ EXPECT_FALSE([view isHidden]);
+ [bar_ shrinkOrHideView:view forMaxX:31.0];
+ EXPECT_EQ(31.0, NSWidth([view frame]));
+ EXPECT_FALSE([view isHidden]);
+ [bar_ shrinkOrHideView:view forMaxX:29.0];
+ EXPECT_TRUE([view isHidden]);
+}
class BookmarkBarControllerOpenAllTest : public BookmarkBarControllerTest {
public: