diff options
Diffstat (limited to 'chrome/browser/cocoa/browser_window_controller_unittest.mm')
-rw-r--r-- | chrome/browser/cocoa/browser_window_controller_unittest.mm | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/browser_window_controller_unittest.mm b/chrome/browser/cocoa/browser_window_controller_unittest.mm index 1597e69..2550f44 100644 --- a/chrome/browser/cocoa/browser_window_controller_unittest.mm +++ b/chrome/browser/cocoa/browser_window_controller_unittest.mm @@ -50,6 +50,14 @@ return [findBarCocoaController_ view]; } +- (NSView*)devToolsView { + return [devToolsController_ view]; +} + +- (NSView*)sidebarView { + return [sidebarController_ view]; +} + - (BOOL)bookmarkBarVisible { return [bookmarkBarController_ isVisible]; } @@ -548,6 +556,20 @@ TEST_F(BrowserWindowControllerTest, TestFindBarOnTop) { EXPECT_GT(findBar_index, bookmark_index); } +// Tests that the sidebar view and devtools view are both non-opaque. +TEST_F(BrowserWindowControllerTest, TestSplitViewsAreNotOpaque) { + // Add a subview to the sidebar view to mimic what happens when a tab is added + // to the window. NSSplitView only marks itself as non-opaque when one of its + // subviews is non-opaque, so the test will not pass without this subview. + scoped_nsobject<NSView> view( + [[NSView alloc] initWithFrame:NSMakeRect(0, 0, 10, 10)]); + [[controller_ sidebarView] addSubview:view]; + + EXPECT_FALSE([[controller_ tabContentArea] isOpaque]); + EXPECT_FALSE([[controller_ devToolsView] isOpaque]); + EXPECT_FALSE([[controller_ sidebarView] isOpaque]); +} + @interface BrowserWindowControllerFakeFullscreen : BrowserWindowController { @private // We release the window ourselves, so we don't have to rely on the unittest |