diff options
author | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-07 16:36:18 +0000 |
---|---|---|
committer | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-07 16:36:18 +0000 |
commit | 328f0791c6da4e93ccb371d6abc929305344dfcd (patch) | |
tree | 0fe165ccdc2575c4e10640e97d1606f268f223a7 /chrome/browser/cocoa/browser_window_controller_unittest.mm | |
parent | 1eb05d5beba66ecd25c63e5060794b9e4dfa573d (diff) | |
download | chromium_src-328f0791c6da4e93ccb371d6abc929305344dfcd.zip chromium_src-328f0791c6da4e93ccb371d6abc929305344dfcd.tar.gz chromium_src-328f0791c6da4e93ccb371d6abc929305344dfcd.tar.bz2 |
Mac: Find bar should be drawn on top of all other toolbars.
BUG=24000
Review URL: http://codereview.chromium.org/255101
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28258 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/browser_window_controller_unittest.mm')
-rw-r--r-- | chrome/browser/cocoa/browser_window_controller_unittest.mm | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/browser_window_controller_unittest.mm b/chrome/browser/cocoa/browser_window_controller_unittest.mm index 5df2fdd..e4ad364 100644 --- a/chrome/browser/cocoa/browser_window_controller_unittest.mm +++ b/chrome/browser/cocoa/browser_window_controller_unittest.mm @@ -9,6 +9,7 @@ #include "chrome/browser/cocoa/browser_test_helper.h" #include "chrome/browser/cocoa/browser_window_controller.h" #include "chrome/browser/cocoa/cocoa_test_helper.h" +#include "chrome/browser/cocoa/find_bar_bridge.h" #include "chrome/common/pref_names.h" #include "chrome/common/pref_service.h" #include "chrome/test/testing_browser_process.h" @@ -43,6 +44,10 @@ return [bookmarkBarController_ view]; } +- (NSView*)findBarView { + return [findBarCocoaController_ view]; +} + - (BOOL)bookmarkBarVisible { return [bookmarkBarController_ isVisible]; } @@ -436,5 +441,25 @@ TEST_F(BrowserWindowControllerTest, TestZoomFrame) { EXPECT_EQ(screenFrame.origin.y, zoomFrame.origin.y); } +TEST_F(BrowserWindowControllerTest, TestFindBarOnTop) { + FindBarBridge bridge; + [controller_.get() addFindBar:bridge.find_bar_cocoa_controller()]; + + // Test that the Z-order of the find bar is on top of everything. + NSArray* subviews = [[[controller_.get() window] contentView] subviews]; + NSUInteger findBar_index = + [subviews indexOfObject:[controller_.get() findBarView]]; + EXPECT_NE(NSNotFound, findBar_index); + NSUInteger toolbar_index = + [subviews indexOfObject:[controller_.get() toolbarView]]; + EXPECT_NE(NSNotFound, toolbar_index); + NSUInteger bookmark_index = + [subviews indexOfObject:[controller_.get() bookmarkView]]; + EXPECT_NE(NSNotFound, bookmark_index); + + EXPECT_GT(findBar_index, toolbar_index); + EXPECT_GT(findBar_index, bookmark_index); +} + /* TODO(???): test other methods of BrowserWindowController */ |