Index: chrome/browser/cocoa/browser_window_controller_unittest.mm |
=================================================================== |
--- chrome/browser/cocoa/browser_window_controller_unittest.mm (revision 19669) |
+++ chrome/browser/cocoa/browser_window_controller_unittest.mm (working copy) |
@@ -77,4 +77,22 @@ |
EXPECT_TRUE([controller_ fullscreenWindow]); |
} |
+TEST_F(BrowserWindowControllerTest, TestNormal) { |
+ // Make sure a normal BrowserWindowController is, uh, normal. |
+ EXPECT_TRUE([controller_ isNormalWindow]); |
+ |
+ // And make sure a controller for a pop-up window is not normal. |
+ scoped_ptr<Browser> popup_browser(Browser::CreateForPopup( |
+ browser_helper_.profile())); |
+ controller_.reset([[BrowserWindowController alloc] |
+ initWithBrowser:popup_browser.get() |
+ takeOwnership:NO]); |
+ EXPECT_FALSE([controller_ isNormalWindow]); |
+ |
+ // The created BrowserWindowController gets autoreleased, so make |
+ // sure we don't also release it. |
+ // (Confirmed with valgrind). |
+ controller_.release(); |
pink (ping after 24hrs)
2009/07/01 12:53:00
why is this necessary? won't it do that when the t
John Grabowski
2009/07/02 20:28:25
Somehow the controller gets autoreleased. I can c
|
+} |
+ |
/* TODO(???): test other methods of BrowserWindowController */ |