summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/toolbar_controller_unittest.mm
diff options
context:
space:
mode:
authorjrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-10 18:05:17 +0000
committerjrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-10 18:05:17 +0000
commit562dc9544aa2668b51a35793a90ad5cffec97c8f (patch)
tree9bc9eef579afa8105c1c69d92e2ff135db3a2381 /chrome/browser/cocoa/toolbar_controller_unittest.mm
parentd2ee25b6cb2cd1dd4267eb2a8972ef4a951caa29 (diff)
downloadchromium_src-562dc9544aa2668b51a35793a90ad5cffec97c8f.zip
chromium_src-562dc9544aa2668b51a35793a90ad5cffec97c8f.tar.gz
chromium_src-562dc9544aa2668b51a35793a90ad5cffec97c8f.tar.bz2
Fix bookmark bar chevron not being pinned to right when launch with bar open.
TEST=\ Make browser window thin (e.g. 400pix wide). Show bookmark bar. Quit. Relaunch. Make sure the "off the side" chevron on the bookmark bar is pinned to the right of the window. Resize width wider and thinner a little; make sure chevron stays pinned. Make browser window wide (e.g. 1000pix wide). Quit. Relaunch. Make sure chevron is pinned to the right of the window. Repeat all these tests but close the bookmark bar before quitting so it starts life closed. Review URL: http://codereview.chromium.org/165207 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22926 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/toolbar_controller_unittest.mm')
-rw-r--r--chrome/browser/cocoa/toolbar_controller_unittest.mm25
1 files changed, 25 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/toolbar_controller_unittest.mm b/chrome/browser/cocoa/toolbar_controller_unittest.mm
index aa053bc..aa0257193 100644
--- a/chrome/browser/cocoa/toolbar_controller_unittest.mm
+++ b/chrome/browser/cocoa/toolbar_controller_unittest.mm
@@ -223,4 +223,29 @@ TEST_F(ToolbarControllerTest, BookmarkBarResizes) {
EXPECT_EQ(6, NSHeight([bookmarkBarView frame]));
}
+// Make sure, by default, the bookmark bar is the full width of the
+// toolbar.
+TEST_F(ToolbarControllerTest, BookmarkBarIsFullWidth) {
+ // Set the pref to the bookmark bar is visible when the toolbar is
+ // first created.
+ helper_.profile()->GetPrefs()->SetBoolean(prefs::kShowBookmarkBar, true);
+
+ // Create a new bar (after the pref is set)
+ Browser* browser = helper_.browser();
+ bar_.reset(
+ [[ToolbarController alloc] initWithModel:browser->toolbar_model()
+ commands:browser->command_updater()
+ profile:helper_.profile()
+ browser:browser
+ resizeDelegate:resizeDelegate_.get()
+ bookmarkDelegate:nil]);
+ EXPECT_TRUE([bar_ view]);
+
+ // Make sure the bookmark bar is the same width as the toolbar
+ NSView* bookmarkBarView = [[bar_ bookmarkBarController] view];
+ EXPECT_EQ([[bar_ view] frame].size.width,
+ [bookmarkBarView frame].size.width);
+ EXPECT_TRUE([bookmarkBarView isDescendantOf:[bar_ view]]);
+}
+
} // namespace