diff options
author | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-24 20:17:35 +0000 |
---|---|---|
committer | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-24 20:17:35 +0000 |
commit | fda368046397c2e8028c360717f8714fbfcc8a28 (patch) | |
tree | 1485e5d6af41d60dc91ec27c66f06963c1411f1b /chrome | |
parent | 85e92338fddd8256ebefad9ea4eb7d66048b1c5e (diff) | |
download | chromium_src-fda368046397c2e8028c360717f8714fbfcc8a28.zip chromium_src-fda368046397c2e8028c360717f8714fbfcc8a28.tar.gz chromium_src-fda368046397c2e8028c360717f8714fbfcc8a28.tar.bz2 |
Mac cleanup: remove a TODO and add ToolbarControllerTest.NoLocationBar (another TODO).
BUG=none
TEST=ToolbarControllerTest.NoLocationBar passes
Review URL: http://codereview.chromium.org/1737013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45543 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/cocoa/toolbar_controller.mm | 3 | ||||
-rw-r--r-- | chrome/browser/cocoa/toolbar_controller_unittest.mm | 19 |
2 files changed, 18 insertions, 4 deletions
diff --git a/chrome/browser/cocoa/toolbar_controller.mm b/chrome/browser/cocoa/toolbar_controller.mm index a9c4a33..cca1db7 100644 --- a/chrome/browser/cocoa/toolbar_controller.mm +++ b/chrome/browser/cocoa/toolbar_controller.mm @@ -417,8 +417,7 @@ class PrefObserverBridge : public NotificationObserver { [[self view] setHidden:!hasLocationBar_]; // Make location bar not editable when in a pop-up. - // TODO(viettrungluu): is this right (all the time)? - locationBarView_->SetEditable(toolbar ? true : false); + locationBarView_->SetEditable(toolbar); } - (NSView*)view { diff --git a/chrome/browser/cocoa/toolbar_controller_unittest.mm b/chrome/browser/cocoa/toolbar_controller_unittest.mm index dcea565..0b8aaad 100644 --- a/chrome/browser/cocoa/toolbar_controller_unittest.mm +++ b/chrome/browser/cocoa/toolbar_controller_unittest.mm @@ -100,7 +100,8 @@ TEST_F(ToolbarControllerTest, TitlebarOnly) { [bar_ setHasToolbar:NO hasLocationBar:YES]; EXPECT_NE(view, [bar_ view]); - // Simulate a popup going fullscreen and back. + // Simulate a popup going fullscreen and back by performing the reparenting + // that happens during fullscreen transitions NSView* superview = [view superview]; // TODO(jrg): find a way to add an [NSAutoreleasePool drain] in // here. I don't have access to the current @@ -115,7 +116,21 @@ TEST_F(ToolbarControllerTest, TitlebarOnly) { [bar_ setHasToolbar:NO hasLocationBar:YES]; } -// TODO(viettrungluu): make a version of above without location bar. +// Make sure it works in the completely undecorated case. +TEST_F(ToolbarControllerTest, NoLocationBar) { + NSView* view = [bar_ view]; + + [bar_ setHasToolbar:NO hasLocationBar:NO]; + EXPECT_NE(view, [bar_ view]); + EXPECT_TRUE([[bar_ view] isHidden]); + + // Simulate a popup going fullscreen and back by performing the reparenting + // that happens during fullscreen transitions + NSView* superview = [view superview]; + // TODO(jrg): See TODO above. + [view removeFromSuperview]; + [superview addSubview:view]; +} // Make some changes to the enabled state of a few of the buttons and ensure // that we're still in sync. |