diff options
author | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-14 01:01:17 +0000 |
---|---|---|
committer | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-14 01:01:17 +0000 |
commit | 919905ddd11db90bf0b4a03f9b3e79b9c289aa04 (patch) | |
tree | e5586bbcff8540fdb241845f7f7e075fc33ad996 /chrome/browser/cocoa/toolbar_controller_unittest.mm | |
parent | 0207043ab2d23d96a700bcb9bfb9044bd240ae7b (diff) | |
download | chromium_src-919905ddd11db90bf0b4a03f9b3e79b9c289aa04.zip chromium_src-919905ddd11db90bf0b4a03f9b3e79b9c289aa04.tar.gz chromium_src-919905ddd11db90bf0b4a03f9b3e79b9c289aa04.tar.bz2 |
Mac: Animate the bookmark bar showing/hiding.
There's a huge refactoring of the bookmark bar controller in this CL, so that animation-related code is in only a few places (instead of scattered all over the place).
Changes to BookmarkBar.xib: Since BookmarkBarToolbarView now inherits from AnimatableView, I had to hook up its delegate_ member to File's Owner (i.e., the BookmarkBarController).
Not yet implemented: morphing between the detached bar (on the NTP) and anything else.
BUG=25600
TEST=Go to a normal page, show/hide the bookmark bar (Shift-Cmd-B), watch it animate.
Review URL: http://codereview.chromium.org/384105
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31977 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/toolbar_controller_unittest.mm')
-rw-r--r-- | chrome/browser/cocoa/toolbar_controller_unittest.mm | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/chrome/browser/cocoa/toolbar_controller_unittest.mm b/chrome/browser/cocoa/toolbar_controller_unittest.mm index 5c731fd..37b20cb 100644 --- a/chrome/browser/cocoa/toolbar_controller_unittest.mm +++ b/chrome/browser/cocoa/toolbar_controller_unittest.mm @@ -296,14 +296,11 @@ TEST_F(ToolbarControllerTest, PopulateEncodingMenu) { EXPECT_NE(0, [encodings numberOfItems]); } -TEST_F(ToolbarControllerTest, CorrectHeightWhenCompressed) { - [bar_ setShouldBeCompressed:YES]; - EXPECT_EQ(30.0, [resizeDelegate_ height]); -} - -TEST_F(ToolbarControllerTest, CorrectHeightWhenUnompressed) { - [bar_ setShouldBeCompressed:NO]; - EXPECT_EQ(36.0, [resizeDelegate_ height]); +TEST_F(ToolbarControllerTest, HeightCompression) { + for (int i = 0; i <= 10; i++) { + [bar_ setHeightCompression:static_cast<CGFloat>(i)]; + EXPECT_EQ(static_cast<CGFloat>(36 - i), [resizeDelegate_ height]); + } } } // namespace |