diff options
author | rohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-15 17:38:32 +0000 |
---|---|---|
committer | rohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-15 17:38:32 +0000 |
commit | 5845cffa85aabe4a05d6b3e41a769d60fd6658fa (patch) | |
tree | c91d06ec7b47b8f7875126f3edbd558ee262f63c /chrome/browser/cocoa/browser_window_controller_unittest.mm | |
parent | 5306d118a2880703b2e7d24d1267f7c3e67b376b (diff) | |
download | chromium_src-5845cffa85aabe4a05d6b3e41a769d60fd6658fa.zip chromium_src-5845cffa85aabe4a05d6b3e41a769d60fd6658fa.tar.gz chromium_src-5845cffa85aabe4a05d6b3e41a769d60fd6658fa.tar.bz2 |
[Mac] Bring the correct window to the front when calling BrowserWindow::Activate(). Before this would ignore the existence of fullscreen windows.
BUG=http://crbug.com/21145
TEST=Trigger a javascript alert dialog. The original non-fullscreen window should not appear.
Review URL: http://codereview.chromium.org/274060
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29137 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 | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/browser_window_controller_unittest.mm b/chrome/browser/cocoa/browser_window_controller_unittest.mm index 29a3221..4df1482 100644 --- a/chrome/browser/cocoa/browser_window_controller_unittest.mm +++ b/chrome/browser/cocoa/browser_window_controller_unittest.mm @@ -132,6 +132,27 @@ TEST_F(BrowserWindowControllerTest, TestFullscreen) { EXPECT_TRUE([controller_ fullscreenWindow]); } +TEST_F(BrowserWindowControllerTest, TestActivate) { + // Note use of "controller", not "controller_" + scoped_nsobject<BrowserWindowController> controller; + controller.reset([[BrowserWindowControllerFakeFullscreen alloc] + initWithBrowser:browser_helper_.browser() + takeOwnership:NO]); + EXPECT_FALSE([controller isFullscreen]); + + [controller activate]; + NSWindow* frontmostWindow = [[NSApp orderedWindows] objectAtIndex:0]; + EXPECT_EQ(frontmostWindow, [controller window]); + + [controller setFullscreen:YES]; + [controller activate]; + frontmostWindow = [[NSApp orderedWindows] objectAtIndex:0]; + EXPECT_EQ(frontmostWindow, [controller fullscreenWindow]); + + // We have to cleanup after ourselves by unfullscreening. + [controller setFullscreen:NO]; +} + TEST_F(BrowserWindowControllerTest, TestNormal) { // Force the bookmark bar to be shown. browser_helper_.profile()->GetPrefs()-> |