Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Side by Side Diff: chrome/browser/ui/cocoa/browser_window_controller_browsertest.mm

Issue 1637943003: Remove HostDesktopType from BrowserList::GetInstance() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@screen-wrapper-land
Patch Set: mac2 Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include <stddef.h> 7 #include <stddef.h>
8 #import "base/mac/mac_util.h" 8 #import "base/mac/mac_util.h"
9 9
10 #include "base/mac/sdk_forward_declarations.h" 10 #include "base/mac/sdk_forward_declarations.h"
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 EXPECT_EQ(NSHeight([window frame]), NSMinY(sheetLocation)); 528 EXPECT_EQ(NSHeight([window frame]), NSMinY(sheetLocation));
529 529
530 // Reset the sheet's size. 530 // Reset the sheet's size.
531 sheet = MockWindowWithFrame(NSMakeRect(0, 0, 300, 200)); 531 sheet = MockWindowWithFrame(NSMakeRect(0, 0, 300, 200));
532 532
533 // Make sure the profile does not have the bookmark visible so that 533 // Make sure the profile does not have the bookmark visible so that
534 // we'll create the shortcut window without the bookmark bar. 534 // we'll create the shortcut window without the bookmark bar.
535 chrome::ToggleBookmarkBarWhenVisible(browser()->profile()); 535 chrome::ToggleBookmarkBarWhenVisible(browser()->profile());
536 // Open application mode window. 536 // Open application mode window.
537 OpenAppShortcutWindow(browser()->profile(), GURL("about:blank")); 537 OpenAppShortcutWindow(browser()->profile(), GURL("about:blank"));
538 Browser* popup_browser = BrowserList::GetInstance( 538 Browser* popup_browser = BrowserList::GetInstance()->GetLastActive();
539 chrome::GetActiveDesktop())->GetLastActive();
540 NSWindow* popupWindow = popup_browser->window()->GetNativeWindow(); 539 NSWindow* popupWindow = popup_browser->window()->GetNativeWindow();
541 BrowserWindowController* popupController = 540 BrowserWindowController* popupController =
542 [BrowserWindowController browserWindowControllerForWindow:popupWindow]; 541 [BrowserWindowController browserWindowControllerForWindow:popupWindow];
543 ASSERT_TRUE([popupController isKindOfClass:[BrowserWindowController class]]); 542 ASSERT_TRUE([popupController isKindOfClass:[BrowserWindowController class]]);
544 EXPECT_FALSE([popupController isTabbedWindow]); 543 EXPECT_FALSE([popupController isTabbedWindow]);
545 EXPECT_FALSE([popupController hasTabStrip]); 544 EXPECT_FALSE([popupController hasTabStrip]);
546 EXPECT_TRUE([popupController hasTitleBar]); 545 EXPECT_TRUE([popupController hasTitleBar]);
547 EXPECT_FALSE([popupController isBookmarkBarVisible]); 546 EXPECT_FALSE([popupController isBookmarkBarVisible]);
548 EXPECT_FALSE([popupController hasToolbar]); 547 EXPECT_FALSE([popupController hasToolbar]);
549 548
(...skipping 10 matching lines...) Expand all
560 } 559 }
561 560
562 // Verify that the info bar tip is hidden when the toolbar is not visible. 561 // Verify that the info bar tip is hidden when the toolbar is not visible.
563 IN_PROC_BROWSER_TEST_F(BrowserWindowControllerTest, 562 IN_PROC_BROWSER_TEST_F(BrowserWindowControllerTest,
564 InfoBarTipHiddenForWindowWithoutToolbar) { 563 InfoBarTipHiddenForWindowWithoutToolbar) {
565 ShowInfoBar(browser()); 564 ShowInfoBar(browser());
566 EXPECT_FALSE( 565 EXPECT_FALSE(
567 [[controller() infoBarContainerController] shouldSuppressTopInfoBarTip]); 566 [[controller() infoBarContainerController] shouldSuppressTopInfoBarTip]);
568 567
569 OpenAppShortcutWindow(browser()->profile(), GURL("about:blank")); 568 OpenAppShortcutWindow(browser()->profile(), GURL("about:blank"));
570 Browser* popup_browser = BrowserList::GetInstance( 569 Browser* popup_browser = BrowserList::GetInstance()->GetLastActive();
571 chrome::HOST_DESKTOP_TYPE_NATIVE)->GetLastActive();
572 NSWindow* popupWindow = popup_browser->window()->GetNativeWindow(); 570 NSWindow* popupWindow = popup_browser->window()->GetNativeWindow();
573 BrowserWindowController* popupController = 571 BrowserWindowController* popupController =
574 [BrowserWindowController browserWindowControllerForWindow:popupWindow]; 572 [BrowserWindowController browserWindowControllerForWindow:popupWindow];
575 EXPECT_FALSE([popupController hasToolbar]); 573 EXPECT_FALSE([popupController hasToolbar]);
576 574
577 // Show infobar for controller. 575 // Show infobar for controller.
578 ShowInfoBar(popup_browser); 576 ShowInfoBar(popup_browser);
579 EXPECT_TRUE( 577 EXPECT_TRUE(
580 [[popupController infoBarContainerController] 578 [[popupController infoBarContainerController]
581 shouldSuppressTopInfoBarTip]); 579 shouldSuppressTopInfoBarTip]);
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 VerifyWindowControlsZOrder(); 633 VerifyWindowControlsZOrder();
636 [controller() removeOverlay]; 634 [controller() removeOverlay];
637 VerifyWindowControlsZOrder(); 635 VerifyWindowControlsZOrder();
638 636
639 // Toggle immersive fullscreen, then verify z order. In immersive fullscreen, 637 // Toggle immersive fullscreen, then verify z order. In immersive fullscreen,
640 // there are no window controls. 638 // there are no window controls.
641 [controller() enterImmersiveFullscreen]; 639 [controller() enterImmersiveFullscreen];
642 [controller() exitImmersiveFullscreen]; 640 [controller() exitImmersiveFullscreen];
643 VerifyWindowControlsZOrder(); 641 VerifyWindowControlsZOrder();
644 } 642 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/apps/quit_with_apps_controller_mac.cc ('k') | chrome/browser/ui/host_desktop.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698