Chromium Code Reviews| 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..dad1ba4848383f4e1dd50b692523416ff3a7cd94 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,7 @@ TEST_F(FramedBrowserWindowTest, DISABLED_WindowWidgetLocation) { |
| window_ = [[FramedBrowserWindow alloc] |
| initWithContentRect:NSMakeRect(0, 0, 800, 600) |
| hasTabStrip:NO]; |
| + [window_ layoutIfNeeded]; |
|
erikchen
2016/10/13 21:57:54
Why is this necessary? Is it because when I presen
Eugene But (OOO till 7-30)
2016/10/13 22:03:26
Yes, layout constraints are not kicked in otherwis
|
| id controller = [OCMockObject mockForClass:[BrowserWindowController class]]; |
| [[[controller stub] andReturnValue:OCMOCK_VALUE(yes)] |
| isKindOfClass:[BrowserWindowController class]]; |
| @@ -123,7 +123,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 +137,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 +152,7 @@ TEST_F(FramedBrowserWindowTest, DISABLED_WindowWidgetLocation) { |
| window_ = [[FramedBrowserWindow alloc] |
| initWithContentRect:NSMakeRect(0, 0, 800, 600) |
| hasTabStrip:YES]; |
| + [window_ layoutIfNeeded]; |
| controller = [OCMockObject mockForClass:[BrowserWindowController class]]; |
| [[[controller stub] andReturnValue:OCMOCK_VALUE(yes)] |
| isKindOfClass:[BrowserWindowController class]]; |
| @@ -159,7 +163,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 +176,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); |