| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/mac/scoped_nsobject.h" | 7 #include "base/mac/scoped_nsobject.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #import "chrome/browser/ui/cocoa/browser_window_layout.h" | 9 #import "chrome/browser/ui/cocoa/browser_window_layout.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 base::scoped_nsobject<BrowserWindowLayout> layout; | 40 base::scoped_nsobject<BrowserWindowLayout> layout; |
| 41 | 41 |
| 42 // Updates the layout parameters with the state associated with a typical | 42 // Updates the layout parameters with the state associated with a typical |
| 43 // fullscreened window. | 43 // fullscreened window. |
| 44 void ApplyStandardFullscreenLayoutParameters() { | 44 void ApplyStandardFullscreenLayoutParameters() { |
| 45 // Content view has same size as window in AppKit Fullscreen. | 45 // Content view has same size as window in AppKit Fullscreen. |
| 46 [layout setContentViewSize:NSMakeSize(600, 622)]; | 46 [layout setContentViewSize:NSMakeSize(600, 622)]; |
| 47 [layout setInAnyFullscreen:YES]; | 47 [layout setInAnyFullscreen:YES]; |
| 48 [layout setFullscreenSlidingStyle:fullscreen_mac::OMNIBOX_TABS_PRESENT]; | 48 [layout setFullscreenSlidingStyle:fullscreen_mac::OMNIBOX_TABS_PRESENT]; |
| 49 [layout setFullscreenMenubarOffset:0]; | 49 [layout setFullscreenMenubarOffset:0]; |
| 50 [layout setFullscreenToolbarFraction:0]; | 50 [layout setFullscreenToolbarFraction:1]; |
| 51 [layout setFullscreenButtonFrame:NSZeroRect]; | 51 [layout setFullscreenButtonFrame:NSZeroRect]; |
| 52 } | 52 } |
| 53 | 53 |
| 54 private: | 54 private: |
| 55 DISALLOW_COPY_AND_ASSIGN(BrowserWindowLayoutTest); | 55 DISALLOW_COPY_AND_ASSIGN(BrowserWindowLayoutTest); |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 TEST_F(BrowserWindowLayoutTest, TestAllViews) { | 58 TEST_F(BrowserWindowLayoutTest, TestAllViews) { |
| 59 chrome::LayoutOutput output = [layout computeLayout]; | 59 chrome::LayoutOutput output = [layout computeLayout]; |
| 60 | 60 |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 } | 206 } |
| 207 | 207 |
| 208 // Tests that the avatar button is not aligned on the half pixel. | 208 // Tests that the avatar button is not aligned on the half pixel. |
| 209 TEST_F(BrowserWindowLayoutTest, TestAvatarButtonPixelAlignment) { | 209 TEST_F(BrowserWindowLayoutTest, TestAvatarButtonPixelAlignment) { |
| 210 [layout setAvatarSize:NSMakeSize(28, 28)]; | 210 [layout setAvatarSize:NSMakeSize(28, 28)]; |
| 211 | 211 |
| 212 chrome::LayoutOutput output = [layout computeLayout]; | 212 chrome::LayoutOutput output = [layout computeLayout]; |
| 213 | 213 |
| 214 EXPECT_NSEQ(NSMakeRect(537, 589, 28, 28), output.tabStripLayout.avatarFrame); | 214 EXPECT_NSEQ(NSMakeRect(537, 589, 28, 28), output.tabStripLayout.avatarFrame); |
| 215 } | 215 } |
| OLD | NEW |