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

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

Issue 12674019: Alternate NTP Mac: Show overlay at fixed position (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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 | Annotate | Revision Log
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 "base/mac/mac_util.h" 7 #include "base/mac/mac_util.h"
8 #import "base/memory/scoped_nsobject.h" 8 #import "base/memory/scoped_nsobject.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
11 #include "base/utf_string_conversions.h" 11 #include "base/utf_string_conversions.h"
12 #include "chrome/app/chrome_command_ids.h" 12 #include "chrome/app/chrome_command_ids.h"
13 #include "chrome/browser/signin/fake_auth_status_provider.h" 13 #include "chrome/browser/signin/fake_auth_status_provider.h"
14 #include "chrome/browser/signin/signin_global_error.h" 14 #include "chrome/browser/signin/signin_global_error.h"
15 #include "chrome/browser/signin/signin_manager.h" 15 #include "chrome/browser/signin/signin_manager.h"
16 #include "chrome/browser/signin/signin_manager_factory.h" 16 #include "chrome/browser/signin/signin_manager_factory.h"
17 #include "chrome/browser/signin/signin_manager_fake.h" 17 #include "chrome/browser/signin/signin_manager_fake.h"
18 #include "chrome/browser/sync/profile_sync_service.h" 18 #include "chrome/browser/sync/profile_sync_service.h"
19 #include "chrome/browser/sync/profile_sync_service_factory.h" 19 #include "chrome/browser/sync/profile_sync_service_factory.h"
20 #include "chrome/browser/sync/profile_sync_service_mock.h" 20 #include "chrome/browser/sync/profile_sync_service_mock.h"
21 #include "chrome/browser/sync/sync_global_error.h" 21 #include "chrome/browser/sync/sync_global_error.h"
22 #include "chrome/browser/ui/browser_list.h" 22 #include "chrome/browser/ui/browser_list.h"
23 #include "chrome/browser/ui/browser_window.h" 23 #include "chrome/browser/ui/browser_window.h"
24 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" 24 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h"
25 #include "chrome/browser/ui/cocoa/find_bar/find_bar_bridge.h" 25 #include "chrome/browser/ui/cocoa/find_bar/find_bar_bridge.h"
26 #include "chrome/browser/ui/cocoa/tabs/tab_strip_view.h" 26 #include "chrome/browser/ui/cocoa/tabs/tab_strip_view.h"
27 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h"
27 #include "chrome/browser/ui/host_desktop.h" 28 #include "chrome/browser/ui/host_desktop.h"
28 #include "chrome/common/chrome_notification_types.h" 29 #include "chrome/common/chrome_notification_types.h"
29 #include "chrome/common/pref_names.h" 30 #include "chrome/common/pref_names.h"
30 #include "chrome/test/base/testing_profile.h" 31 #include "chrome/test/base/testing_profile.h"
31 #include "content/public/browser/notification_service.h" 32 #include "content/public/browser/notification_service.h"
32 #include "content/public/test/test_utils.h" 33 #include "content/public/test/test_utils.h"
33 #include "grit/chromium_strings.h" 34 #include "grit/chromium_strings.h"
34 #include "grit/generated_resources.h" 35 #include "grit/generated_resources.h"
35 #include "testing/gmock/include/gmock/gmock.h" 36 #include "testing/gmock/include/gmock/gmock.h"
36 #include "ui/base/l10n/l10n_util.h" 37 #include "ui/base/l10n/l10n_util.h"
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 void CheckViewPositions(BrowserWindowController* controller) { 248 void CheckViewPositions(BrowserWindowController* controller) {
248 NSRect contentView = [[[controller window] contentView] bounds]; 249 NSRect contentView = [[[controller window] contentView] bounds];
249 NSRect tabstrip = [[controller tabStripView] frame]; 250 NSRect tabstrip = [[controller tabStripView] frame];
250 NSRect toolbar = [[controller toolbarView] frame]; 251 NSRect toolbar = [[controller toolbarView] frame];
251 NSRect infobar = [[controller infoBarContainerView] frame]; 252 NSRect infobar = [[controller infoBarContainerView] frame];
252 NSRect contentArea = [[controller tabContentArea] frame]; 253 NSRect contentArea = [[controller tabContentArea] frame];
253 NSRect download = [[[controller downloadShelf] view] frame]; 254 NSRect download = [[[controller downloadShelf] view] frame];
254 255
255 EXPECT_EQ(NSMinY(contentView), NSMinY(download)); 256 EXPECT_EQ(NSMinY(contentView), NSMinY(download));
256 EXPECT_EQ(NSMaxY(download), NSMinY(contentArea)); 257 EXPECT_EQ(NSMaxY(download), NSMinY(contentArea));
257 EXPECT_EQ(NSMaxY(contentArea), NSMinY(toolbar)); 258
259 CGFloat min_toolbar_height = [[controller toolbarController]
260 desiredHeightForCompression:bookmarks::kBookmarkBarOverlap];
261 EXPECT_EQ(NSMaxY(contentArea), NSMaxY(toolbar) - min_toolbar_height);
258 262
259 // Bookmark bar frame is random memory when hidden. 263 // Bookmark bar frame is random memory when hidden.
260 if ([controller bookmarkBarVisible]) { 264 if ([controller bookmarkBarVisible]) {
261 NSRect bookmark = [[controller bookmarkView] frame]; 265 NSRect bookmark = [[controller bookmarkView] frame];
262 EXPECT_EQ(NSMaxY(infobar), NSMinY(bookmark)); 266 EXPECT_EQ(NSMaxY(infobar), NSMinY(bookmark));
263 EXPECT_EQ(NSMaxY(bookmark), NSMinY(toolbar)); 267 EXPECT_EQ(NSMaxY(bookmark), NSMinY(toolbar));
264 EXPECT_FALSE([[controller bookmarkView] isHidden]); 268 EXPECT_FALSE([[controller bookmarkView] isHidden]);
265 } else { 269 } else {
266 EXPECT_EQ(NSMaxY(infobar), NSMinY(toolbar)); 270 EXPECT_EQ(NSMaxY(infobar), NSMinY(toolbar));
267 EXPECT_TRUE([[controller bookmarkView] isHidden]); 271 EXPECT_TRUE([[controller bookmarkView] isHidden]);
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after
895 testFullscreenWindow_.reset( 899 testFullscreenWindow_.reset(
896 [[NSWindow alloc] initWithContentRect:NSMakeRect(0,0,400,400) 900 [[NSWindow alloc] initWithContentRect:NSMakeRect(0,0,400,400)
897 styleMask:NSBorderlessWindowMask 901 styleMask:NSBorderlessWindowMask
898 backing:NSBackingStoreBuffered 902 backing:NSBackingStoreBuffered
899 defer:NO]); 903 defer:NO]);
900 return testFullscreenWindow_.get(); 904 return testFullscreenWindow_.get();
901 } 905 }
902 @end 906 @end
903 907
904 /* TODO(???): test other methods of BrowserWindowController */ 908 /* TODO(???): test other methods of BrowserWindowController */
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller_private.mm ('k') | chrome/browser/ui/cocoa/dev_tools_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698