summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/toolbar_controller_unittest.mm
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-28 00:46:49 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-28 00:46:49 +0000
commit110a4e7b14519e6b3771dd9c0501618ed45fc837 (patch)
tree75eeaa9ef1c7569a7aed2282895155f7234b2d15 /chrome/browser/cocoa/toolbar_controller_unittest.mm
parentdf5a4ffbb5531ca94bcf9b6a9825a99a3413c47b (diff)
downloadchromium_src-110a4e7b14519e6b3771dd9c0501618ed45fc837.zip
chromium_src-110a4e7b14519e6b3771dd9c0501618ed45fc837.tar.gz
chromium_src-110a4e7b14519e6b3771dd9c0501618ed45fc837.tar.bz2
Reverting 24700.
Review URL: http://codereview.chromium.org/181002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24708 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/toolbar_controller_unittest.mm')
-rw-r--r--chrome/browser/cocoa/toolbar_controller_unittest.mm28
1 files changed, 28 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/toolbar_controller_unittest.mm b/chrome/browser/cocoa/toolbar_controller_unittest.mm
index 7ca2eee..a39481b 100644
--- a/chrome/browser/cocoa/toolbar_controller_unittest.mm
+++ b/chrome/browser/cocoa/toolbar_controller_unittest.mm
@@ -195,6 +195,34 @@ TEST_F(ToolbarControllerTest, TogglePageWrench) {
EXPECT_NE(NSWidth(originalLocationBarFrame), NSWidth([locationBar frame]));
}
+TEST_F(ToolbarControllerTest, BookmarkBarResizes) {
+ NSView* bookmarkBarView = [[bar_ bookmarkBarController] view];
+ ASSERT_EQ(0, NSHeight([bookmarkBarView frame]));
+ [resizeDelegate_ setHeight:-1];
+
+ // Resize the bookmarkbar to 30px. The toolbar should ask the delegate to
+ // resize to 64px.
+ [bar_ resizeView:bookmarkBarView newHeight:30];
+ EXPECT_EQ(64, [resizeDelegate_ height]);
+ EXPECT_EQ(30, NSHeight([bookmarkBarView frame]));
+
+ // Resize the bookmarkbar back to 0px. Toolbar should be at 39px.
+ [bar_ resizeView:bookmarkBarView newHeight:0];
+ EXPECT_EQ(39, [resizeDelegate_ height]);
+ EXPECT_EQ(0, NSHeight([bookmarkBarView frame]));
+
+ // Resize the bookmarkbar to 5px. Toolbar should stay at 39px.
+ [resizeDelegate_ setHeight:-1];
+ [bar_ resizeView:bookmarkBarView newHeight:5];
+ EXPECT_EQ(39, [resizeDelegate_ height]);
+ EXPECT_EQ(5, NSHeight([bookmarkBarView frame]));
+
+ // Resize the bookmarkbar to 6px. Toolbar should grow to 40px.
+ [bar_ resizeView:bookmarkBarView newHeight:6];
+ EXPECT_EQ(40, [resizeDelegate_ height]);
+ EXPECT_EQ(6, NSHeight([bookmarkBarView frame]));
+}
+
// Make sure, by default, the bookmark bar is the full width of the
// toolbar.
TEST_F(ToolbarControllerTest, BookmarkBarIsFullWidth) {