| OLD | NEW |
| 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 <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
| 6 | 6 |
| 7 #include "base/debug/debugger.h" | 7 #include "base/debug/debugger.h" |
| 8 #include "base/mac/scoped_nsobject.h" | 8 #include "base/mac/scoped_nsobject.h" |
| 9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
| 10 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 10 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 FramedBrowserWindow* window_; | 70 FramedBrowserWindow* window_; |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 // Baseline test that the window creates, displays, closes, and | 73 // Baseline test that the window creates, displays, closes, and |
| 74 // releases. | 74 // releases. |
| 75 TEST_F(FramedBrowserWindowTest, ShowAndClose) { | 75 TEST_F(FramedBrowserWindowTest, ShowAndClose) { |
| 76 [window_ display]; | 76 [window_ display]; |
| 77 } | 77 } |
| 78 | 78 |
| 79 // Test that undocumented title-hiding API we're using does the job. | 79 // Test that undocumented title-hiding API we're using does the job. |
| 80 // TODO(crbug.com/655112): Fails on Mac 10.11 Tests. | 80 TEST_F(FramedBrowserWindowTest, DoesHideTitle) { |
| 81 TEST_F(FramedBrowserWindowTest, DISABLED_DoesHideTitle) { | |
| 82 // The -display calls are not strictly necessary, but they do | 81 // The -display calls are not strictly necessary, but they do |
| 83 // make it easier to see what's happening when debugging (without | 82 // make it easier to see what's happening when debugging (without |
| 84 // them the changes are never flushed to the screen). | 83 // them the changes are never flushed to the screen). |
| 85 | 84 |
| 86 [window_ setTitle:@""]; | 85 [window_ setTitle:@""]; |
| 87 [window_ display]; | 86 [window_ display]; |
| 88 NSData* emptyTitleData = WindowContentsAsTIFF(); | 87 NSData* emptyTitleData = WindowContentsAsTIFF(); |
| 89 | 88 |
| 90 [window_ setTitle:@"This is a title"]; | 89 [window_ setTitle:@"This is a title"]; |
| 91 [window_ display]; | 90 [window_ display]; |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 EXPECT_TRUE(miniaturizeControl); | 302 EXPECT_TRUE(miniaturizeControl); |
| 304 miniaturizeFrame = [miniaturizeControl convertRect:[miniaturizeControl bounds] | 303 miniaturizeFrame = [miniaturizeControl convertRect:[miniaturizeControl bounds] |
| 305 toView:nil]; | 304 toView:nil]; |
| 306 EXPECT_EQ(NSMaxY(miniaturizeFrame), | 305 EXPECT_EQ(NSMaxY(miniaturizeFrame), |
| 307 NSMaxY(windowBounds) - | 306 NSMaxY(windowBounds) - |
| 308 kFramedWindowButtonsWithTabStripOffsetFromTop); | 307 kFramedWindowButtonsWithTabStripOffsetFromTop); |
| 309 EXPECT_EQ(NSMinX(miniaturizeFrame), | 308 EXPECT_EQ(NSMinX(miniaturizeFrame), |
| 310 NSMaxX(closeBoxFrame) + [window_ windowButtonsInterButtonSpacing]); | 309 NSMaxX(closeBoxFrame) + [window_ windowButtonsInterButtonSpacing]); |
| 311 [window_ setWindowController:nil]; | 310 [window_ setWindowController:nil]; |
| 312 } | 311 } |
| OLD | NEW |