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

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

Issue 181002: Reverting 24700. (Closed) Base URL: svn://chrome-svn/chrome/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 24707)
+++ chrome/browser/cocoa/toolbar_controller_unittest.mm (working copy)
@@ -195,6 +195,34 @@
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) {
« 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