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

Side by Side Diff: chrome/browser/cocoa/browser_window_controller_unittest.mm

Issue 384105: Mac: Animate the bookmark bar showing/hiding. (Closed)
Patch Set: Comments added per rohitrao's review. Created 11 years, 1 month 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) 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 TEST_F(BrowserWindowControllerTest, TestFullScreenWindow) { 98 TEST_F(BrowserWindowControllerTest, TestFullScreenWindow) {
99 // Confirm the fullscreen command doesn't return nil. 99 // Confirm the fullscreen command doesn't return nil.
100 // See BrowserWindowFullScreenControllerTest for more fullscreen tests. 100 // See BrowserWindowFullScreenControllerTest for more fullscreen tests.
101 EXPECT_TRUE([controller_ fullscreenWindow]); 101 EXPECT_TRUE([controller_ fullscreenWindow]);
102 } 102 }
103 103
104 TEST_F(BrowserWindowControllerTest, TestNormal) { 104 TEST_F(BrowserWindowControllerTest, TestNormal) {
105 // Force the bookmark bar to be shown. 105 // Force the bookmark bar to be shown.
106 browser_helper_.profile()->GetPrefs()-> 106 browser_helper_.profile()->GetPrefs()->
107 SetBoolean(prefs::kShowBookmarkBar, true); 107 SetBoolean(prefs::kShowBookmarkBar, true);
108 [controller_ updateBookmarkBarVisibilityWithAnimation:NO];
108 109
109 // Make sure a normal BrowserWindowController is, uh, normal. 110 // Make sure a normal BrowserWindowController is, uh, normal.
110 EXPECT_TRUE([controller_ isNormalWindow]); 111 EXPECT_TRUE([controller_ isNormalWindow]);
111 EXPECT_TRUE([controller_ isBookmarkBarVisible]); 112 EXPECT_TRUE([controller_ isBookmarkBarVisible]);
112 113
113 // And make sure a controller for a pop-up window is not normal. 114 // And make sure a controller for a pop-up window is not normal.
114 // popup_browser will be owned by its window. 115 // popup_browser will be owned by its window.
115 Browser *popup_browser(Browser::CreateForPopup(browser_helper_.profile())); 116 Browser *popup_browser(Browser::CreateForPopup(browser_helper_.profile()));
116 NSWindow *cocoaWindow = popup_browser->window()->GetNativeHandle(); 117 NSWindow *cocoaWindow = popup_browser->window()->GetNativeHandle();
117 BrowserWindowController* controller = 118 BrowserWindowController* controller =
(...skipping 14 matching lines...) Expand all
132 } 133 }
133 134
134 TEST_F(BrowserWindowControllerTest, BookmarkBarControllerIndirection) { 135 TEST_F(BrowserWindowControllerTest, BookmarkBarControllerIndirection) {
135 EXPECT_FALSE([controller_ isBookmarkBarVisible]); 136 EXPECT_FALSE([controller_ isBookmarkBarVisible]);
136 137
137 // Explicitly show the bar. Can't use bookmark_utils::ToggleWhenVisible() 138 // Explicitly show the bar. Can't use bookmark_utils::ToggleWhenVisible()
138 // because of the notification issues. 139 // because of the notification issues.
139 browser_helper_.profile()->GetPrefs()-> 140 browser_helper_.profile()->GetPrefs()->
140 SetBoolean(prefs::kShowBookmarkBar, true); 141 SetBoolean(prefs::kShowBookmarkBar, true);
141 142
142 [controller_ updateBookmarkBarVisibility]; 143 [controller_ updateBookmarkBarVisibilityWithAnimation:NO];
143 EXPECT_TRUE([controller_ isBookmarkBarVisible]); 144 EXPECT_TRUE([controller_ isBookmarkBarVisible]);
144 } 145 }
145 146
146 #if 0 147 #if 0
147 // TODO(jrg): This crashes trying to create the BookmarkBarController, adding 148 // TODO(jrg): This crashes trying to create the BookmarkBarController, adding
148 // an observer to the BookmarkModel. 149 // an observer to the BookmarkModel.
149 TEST_F(BrowserWindowControllerTest, TestIncognitoWidthSpace) { 150 TEST_F(BrowserWindowControllerTest, TestIncognitoWidthSpace) {
150 scoped_ptr<TestingProfile> incognito_profile(new TestingProfile()); 151 scoped_ptr<TestingProfile> incognito_profile(new TestingProfile());
151 incognito_profile->set_off_the_record(true); 152 incognito_profile->set_off_the_record(true);
152 scoped_ptr<Browser> browser(new Browser(Browser::TYPE_NORMAL, 153 scoped_ptr<Browser> browser(new Browser(Browser::TYPE_NORMAL,
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 fullscreenWindow_.reset( 580 fullscreenWindow_.reset(
580 [[NSWindow alloc] initWithContentRect:NSMakeRect(0,0,400,400) 581 [[NSWindow alloc] initWithContentRect:NSMakeRect(0,0,400,400)
581 styleMask:NSBorderlessWindowMask 582 styleMask:NSBorderlessWindowMask
582 backing:NSBackingStoreBuffered 583 backing:NSBackingStoreBuffered
583 defer:NO]); 584 defer:NO]);
584 return fullscreenWindow_.get(); 585 return fullscreenWindow_.get();
585 } 586 }
586 @end 587 @end
587 588
588 /* TODO(???): test other methods of BrowserWindowController */ 589 /* TODO(???): test other methods of BrowserWindowController */
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/browser_window_controller.mm ('k') | chrome/browser/cocoa/toolbar_compressable.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698