OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #include "app/l10n_util_mac.h" | 5 #include "app/l10n_util_mac.h" |
6 #include "base/scoped_nsobject.h" | 6 #include "base/scoped_nsobject.h" |
7 #include "base/scoped_nsautorelease_pool.h" | 7 #include "base/scoped_nsautorelease_pool.h" |
8 #include "base/scoped_ptr.h" | 8 #include "base/scoped_ptr.h" |
9 #include "chrome/app/chrome_dll_resource.h" | 9 #include "chrome/app/chrome_dll_resource.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 } | 97 } |
98 | 98 |
99 TEST_F(BrowserWindowControllerTest, TestNormal) { | 99 TEST_F(BrowserWindowControllerTest, TestNormal) { |
100 // Force the bookmark bar to be shown. | 100 // Force the bookmark bar to be shown. |
101 browser_helper_.profile()->GetPrefs()-> | 101 browser_helper_.profile()->GetPrefs()-> |
102 SetBoolean(prefs::kShowBookmarkBar, true); | 102 SetBoolean(prefs::kShowBookmarkBar, true); |
103 [controller_ updateBookmarkBarVisibilityWithAnimation:NO]; | 103 [controller_ updateBookmarkBarVisibilityWithAnimation:NO]; |
104 | 104 |
105 // Make sure a normal BrowserWindowController is, uh, normal. | 105 // Make sure a normal BrowserWindowController is, uh, normal. |
106 EXPECT_TRUE([controller_ isNormalWindow]); | 106 EXPECT_TRUE([controller_ isNormalWindow]); |
| 107 EXPECT_TRUE([controller_ hasTabStrip]); |
| 108 EXPECT_FALSE([controller_ hasTitleBar]); |
107 EXPECT_TRUE([controller_ isBookmarkBarVisible]); | 109 EXPECT_TRUE([controller_ isBookmarkBarVisible]); |
108 | 110 |
109 // And make sure a controller for a pop-up window is not normal. | 111 // And make sure a controller for a pop-up window is not normal. |
110 // popup_browser will be owned by its window. | 112 // popup_browser will be owned by its window. |
111 Browser *popup_browser(Browser::CreateForPopup(browser_helper_.profile())); | 113 Browser *popup_browser(Browser::CreateForPopup(browser_helper_.profile())); |
112 NSWindow *cocoaWindow = popup_browser->window()->GetNativeHandle(); | 114 NSWindow *cocoaWindow = popup_browser->window()->GetNativeHandle(); |
113 BrowserWindowController* controller = | 115 BrowserWindowController* controller = |
114 static_cast<BrowserWindowController*>([cocoaWindow windowController]); | 116 static_cast<BrowserWindowController*>([cocoaWindow windowController]); |
115 ASSERT_TRUE([controller isKindOfClass:[BrowserWindowController class]]); | 117 ASSERT_TRUE([controller isKindOfClass:[BrowserWindowController class]]); |
116 EXPECT_FALSE([controller isNormalWindow]); | 118 EXPECT_FALSE([controller isNormalWindow]); |
| 119 EXPECT_FALSE([controller hasTabStrip]); |
| 120 EXPECT_TRUE([controller hasTitleBar]); |
117 EXPECT_FALSE([controller isBookmarkBarVisible]); | 121 EXPECT_FALSE([controller isBookmarkBarVisible]); |
118 [controller close]; | 122 [controller close]; |
119 } | 123 } |
120 | 124 |
121 @interface GTMTheme (BrowserThemeProviderInitialization) | 125 @interface GTMTheme (BrowserThemeProviderInitialization) |
122 + (GTMTheme *)themeWithBrowserThemeProvider:(BrowserThemeProvider *)provider | 126 + (GTMTheme *)themeWithBrowserThemeProvider:(BrowserThemeProvider *)provider |
123 isOffTheRecord:(BOOL)isOffTheRecord; | 127 isOffTheRecord:(BOOL)isOffTheRecord; |
124 @end | 128 @end |
125 | 129 |
126 TEST_F(BrowserWindowControllerTest, TestTheme) { | 130 TEST_F(BrowserWindowControllerTest, TestTheme) { |
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
619 fullscreenWindow_.reset( | 623 fullscreenWindow_.reset( |
620 [[NSWindow alloc] initWithContentRect:NSMakeRect(0,0,400,400) | 624 [[NSWindow alloc] initWithContentRect:NSMakeRect(0,0,400,400) |
621 styleMask:NSBorderlessWindowMask | 625 styleMask:NSBorderlessWindowMask |
622 backing:NSBackingStoreBuffered | 626 backing:NSBackingStoreBuffered |
623 defer:NO]); | 627 defer:NO]); |
624 return fullscreenWindow_.get(); | 628 return fullscreenWindow_.get(); |
625 } | 629 } |
626 @end | 630 @end |
627 | 631 |
628 /* TODO(???): test other methods of BrowserWindowController */ | 632 /* TODO(???): test other methods of BrowserWindowController */ |
OLD | NEW |