| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/mac/mac_util.h" | 9 #include "base/mac/mac_util.h" |
| 10 #import "base/mac/scoped_nsobject.h" | 10 #import "base/mac/scoped_nsobject.h" |
| (...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 747 [partial_mock verify]; | 747 [partial_mock verify]; |
| 748 } | 748 } |
| 749 | 749 |
| 750 // Test that the window uses Auto Layout. Since frame-based layout and Auto | 750 // Test that the window uses Auto Layout. Since frame-based layout and Auto |
| 751 // Layout behave differently in subtle ways, we shouldn't start/stop using it | 751 // Layout behave differently in subtle ways, we shouldn't start/stop using it |
| 752 // accidentally. If we don't want Auto Layout, this test should be changed to | 752 // accidentally. If we don't want Auto Layout, this test should be changed to |
| 753 // expect that chromeContentView has no constraints. | 753 // expect that chromeContentView has no constraints. |
| 754 TEST_F(BrowserWindowControllerTest, UsesAutoLayout) { | 754 TEST_F(BrowserWindowControllerTest, UsesAutoLayout) { |
| 755 // If Auto Layout is on, there will be synthesized constraints based on the | 755 // If Auto Layout is on, there will be synthesized constraints based on the |
| 756 // view's frame and autoresizing mask. | 756 // view's frame and autoresizing mask. |
| 757 EXPECT_NE(0u, [[[controller_ chromeContentView] constraints] count]); | 757 // TODO(sdy): Turn back on (or remove) after investigating a performance |
| 758 // regression: https://crbug.com/706931 |
| 759 EXPECT_EQ(0u, [[[controller_ chromeContentView] constraints] count]); |
| 758 } | 760 } |
| 759 | 761 |
| 760 @interface BrowserWindowControllerFakeFullscreen : BrowserWindowController { | 762 @interface BrowserWindowControllerFakeFullscreen : BrowserWindowController { |
| 761 @private | 763 @private |
| 762 // We release the window ourselves, so we don't have to rely on the unittest | 764 // We release the window ourselves, so we don't have to rely on the unittest |
| 763 // doing it for us. | 765 // doing it for us. |
| 764 base::scoped_nsobject<NSWindow> testFullscreenWindow_; | 766 base::scoped_nsobject<NSWindow> testFullscreenWindow_; |
| 765 } | 767 } |
| 766 @end | 768 @end |
| 767 | 769 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 854 [[NSWindow alloc] initWithContentRect:NSMakeRect(0,0,400,400) | 856 [[NSWindow alloc] initWithContentRect:NSMakeRect(0,0,400,400) |
| 855 styleMask:NSBorderlessWindowMask | 857 styleMask:NSBorderlessWindowMask |
| 856 backing:NSBackingStoreBuffered | 858 backing:NSBackingStoreBuffered |
| 857 defer:NO]); | 859 defer:NO]); |
| 858 [[testFullscreenWindow_ contentView] setWantsLayer:YES]; | 860 [[testFullscreenWindow_ contentView] setWantsLayer:YES]; |
| 859 return testFullscreenWindow_.get(); | 861 return testFullscreenWindow_.get(); |
| 860 } | 862 } |
| 861 @end | 863 @end |
| 862 | 864 |
| 863 /* TODO(???): test other methods of BrowserWindowController */ | 865 /* TODO(???): test other methods of BrowserWindowController */ |
| OLD | NEW |