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

Unified Diff: chrome/browser/ui/cocoa/framed_browser_window_unittest.mm

Issue 2418703002: [mac] Fixed FramedBrowserWindowTest.WindowWidgetLocation. (Closed)
Patch Set: Added comments Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/framed_browser_window_unittest.mm
diff --git a/chrome/browser/ui/cocoa/framed_browser_window_unittest.mm b/chrome/browser/ui/cocoa/framed_browser_window_unittest.mm
index 5e88e91d5140a9c473f964ec2d9e500c2f312bdd..ff640dbea6c931f74509bef62ebd8a59df94414f 100644
--- a/chrome/browser/ui/cocoa/framed_browser_window_unittest.mm
+++ b/chrome/browser/ui/cocoa/framed_browser_window_unittest.mm
@@ -103,8 +103,7 @@ TEST_F(FramedBrowserWindowTest, DISABLED_DoesHideTitle) {
}
// Test to make sure that our window widgets are in the right place.
-// TODO(crbug.com/655112): Fails on Mac 10.11 Tests.
-TEST_F(FramedBrowserWindowTest, DISABLED_WindowWidgetLocation) {
+TEST_F(FramedBrowserWindowTest, WindowWidgetLocation) {
BOOL yes = YES;
BOOL no = NO;
@@ -113,6 +112,8 @@ TEST_F(FramedBrowserWindowTest, DISABLED_WindowWidgetLocation) {
window_ = [[FramedBrowserWindow alloc]
initWithContentRect:NSMakeRect(0, 0, 800, 600)
hasTabStrip:NO];
+ // Update window layout according to existing layout constraints.
+ [window_ layoutIfNeeded];
id controller = [OCMockObject mockForClass:[BrowserWindowController class]];
[[[controller stub] andReturnValue:OCMOCK_VALUE(yes)]
isKindOfClass:[BrowserWindowController class]];
@@ -123,7 +124,8 @@ TEST_F(FramedBrowserWindowTest, DISABLED_WindowWidgetLocation) {
NSView* closeBoxControl = [window_ standardWindowButton:NSWindowCloseButton];
EXPECT_TRUE(closeBoxControl);
- NSRect closeBoxFrame = [closeBoxControl frame];
+ NSRect closeBoxFrame = [closeBoxControl convertRect:[closeBoxControl bounds]
+ toView:nil];
NSRect windowBounds = [window_ frame];
windowBounds = [[window_ contentView] convertRect:windowBounds fromView:nil];
windowBounds.origin = NSZeroPoint;
@@ -136,7 +138,9 @@ TEST_F(FramedBrowserWindowTest, DISABLED_WindowWidgetLocation) {
NSView* miniaturizeControl =
[window_ standardWindowButton:NSWindowMiniaturizeButton];
EXPECT_TRUE(miniaturizeControl);
- NSRect miniaturizeFrame = [miniaturizeControl frame];
+ NSRect miniaturizeFrame =
+ [miniaturizeControl convertRect:[miniaturizeControl bounds]
+ toView:nil];
EXPECT_EQ(NSMaxY(miniaturizeFrame),
NSMaxY(windowBounds) -
kFramedWindowButtonsWithoutTabStripOffsetFromTop);
@@ -149,6 +153,8 @@ TEST_F(FramedBrowserWindowTest, DISABLED_WindowWidgetLocation) {
window_ = [[FramedBrowserWindow alloc]
initWithContentRect:NSMakeRect(0, 0, 800, 600)
hasTabStrip:YES];
+ // Update window layout according to existing layout constraints.
+ [window_ layoutIfNeeded];
controller = [OCMockObject mockForClass:[BrowserWindowController class]];
[[[controller stub] andReturnValue:OCMOCK_VALUE(yes)]
isKindOfClass:[BrowserWindowController class]];
@@ -159,7 +165,8 @@ TEST_F(FramedBrowserWindowTest, DISABLED_WindowWidgetLocation) {
closeBoxControl = [window_ standardWindowButton:NSWindowCloseButton];
EXPECT_TRUE(closeBoxControl);
- closeBoxFrame = [closeBoxControl frame];
+ closeBoxFrame = [closeBoxControl convertRect:[closeBoxControl bounds]
+ toView:nil];
windowBounds = [window_ frame];
windowBounds = [[window_ contentView] convertRect:windowBounds fromView:nil];
windowBounds.origin = NSZeroPoint;
@@ -171,7 +178,8 @@ TEST_F(FramedBrowserWindowTest, DISABLED_WindowWidgetLocation) {
miniaturizeControl = [window_ standardWindowButton:NSWindowMiniaturizeButton];
EXPECT_TRUE(miniaturizeControl);
- miniaturizeFrame = [miniaturizeControl frame];
+ miniaturizeFrame = [miniaturizeControl convertRect:[miniaturizeControl bounds]
+ toView:nil];
EXPECT_EQ(NSMaxY(miniaturizeFrame),
NSMaxY(windowBounds) -
kFramedWindowButtonsWithTabStripOffsetFromTop);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698