| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 5 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
| 6 | 6 |
| 7 #import "base/mac/mac_util.h" | 7 #import "base/mac/mac_util.h" |
| 8 #include "base/mac/sdk_forward_declarations.h" | 8 #include "base/mac/sdk_forward_declarations.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 [BrowserWindowController browserWindowControllerForWindow:popupWindow]; | 332 [BrowserWindowController browserWindowControllerForWindow:popupWindow]; |
| 333 EXPECT_FALSE([popupController hasToolbar]); | 333 EXPECT_FALSE([popupController hasToolbar]); |
| 334 | 334 |
| 335 // Show infobar for controller. | 335 // Show infobar for controller. |
| 336 ShowInfoBar(popup_browser); | 336 ShowInfoBar(popup_browser); |
| 337 EXPECT_TRUE( | 337 EXPECT_TRUE( |
| 338 [[popupController infoBarContainerController] | 338 [[popupController infoBarContainerController] |
| 339 shouldSuppressTopInfoBarTip]); | 339 shouldSuppressTopInfoBarTip]); |
| 340 } | 340 } |
| 341 | 341 |
| 342 // Verify that AllowOverlappingViews is set while the history overlay is | |
| 343 // visible. | |
| 344 IN_PROC_BROWSER_TEST_F(BrowserWindowControllerTest, | |
| 345 AllowOverlappingViewsHistoryOverlay) { | |
| 346 content::WebContents* web_contents = | |
| 347 browser()->tab_strip_model()->GetActiveWebContents(); | |
| 348 EXPECT_TRUE(web_contents->GetAllowOverlappingViews()); | |
| 349 | |
| 350 base::scoped_nsobject<HistoryOverlayController> overlay( | |
| 351 [[HistoryOverlayController alloc] initForMode:kHistoryOverlayModeBack]); | |
| 352 [overlay showPanelForView:web_contents->GetNativeView()]; | |
| 353 EXPECT_TRUE(web_contents->GetAllowOverlappingViews()); | |
| 354 | |
| 355 overlay.reset(); | |
| 356 EXPECT_TRUE(web_contents->GetAllowOverlappingViews()); | |
| 357 } | |
| 358 | |
| 359 // Tests that status bubble's base frame does move when devTools are docked. | 342 // Tests that status bubble's base frame does move when devTools are docked. |
| 360 IN_PROC_BROWSER_TEST_F(BrowserWindowControllerTest, | 343 IN_PROC_BROWSER_TEST_F(BrowserWindowControllerTest, |
| 361 StatusBubblePositioning) { | 344 StatusBubblePositioning) { |
| 362 NSPoint origin = [controller() statusBubbleBaseFrame].origin; | 345 NSPoint origin = [controller() statusBubbleBaseFrame].origin; |
| 363 | 346 |
| 364 DevToolsWindow* devtools_window = | 347 DevToolsWindow* devtools_window = |
| 365 DevToolsWindowTesting::OpenDevToolsWindowSync(browser(), true); | 348 DevToolsWindowTesting::OpenDevToolsWindowSync(browser(), true); |
| 366 DevToolsWindowTesting::Get(devtools_window)->SetInspectedPageBounds( | 349 DevToolsWindowTesting::Get(devtools_window)->SetInspectedPageBounds( |
| 367 gfx::Rect(10, 10, 100, 100)); | 350 gfx::Rect(10, 10, 100, 100)); |
| 368 | 351 |
| 369 NSPoint originWithDevTools = [controller() statusBubbleBaseFrame].origin; | 352 NSPoint originWithDevTools = [controller() statusBubbleBaseFrame].origin; |
| 370 EXPECT_FALSE(NSEqualPoints(origin, originWithDevTools)); | 353 EXPECT_FALSE(NSEqualPoints(origin, originWithDevTools)); |
| 371 | 354 |
| 372 DevToolsWindowTesting::CloseDevToolsWindowSync(devtools_window); | 355 DevToolsWindowTesting::CloseDevToolsWindowSync(devtools_window); |
| 373 } | 356 } |
| OLD | NEW |