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

Side by Side Diff: chrome/browser/ui/cocoa/browser_window_layout_unittest.mm

Issue 2373943002: Mac: Don't call -[BWC layoutSubviews] before updating the fullscreen bubble. (Closed)
Patch Set: Layout() unused 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_layout.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 78
79 EXPECT_NSEQ(NSMakeRect(0, 585, 600, 37), output.tabStripLayout.frame); 79 EXPECT_NSEQ(NSMakeRect(0, 585, 600, 37), output.tabStripLayout.frame);
80 EXPECT_NSEQ(NSMakeRect(533, 589, 63, 28), output.tabStripLayout.avatarFrame); 80 EXPECT_NSEQ(NSMakeRect(533, 589, 63, 28), output.tabStripLayout.avatarFrame);
81 EXPECT_EQ(0, output.tabStripLayout.leftIndent); 81 EXPECT_EQ(0, output.tabStripLayout.leftIndent);
82 EXPECT_FALSE(output.tabStripLayout.addCustomWindowControls); 82 EXPECT_FALSE(output.tabStripLayout.addCustomWindowControls);
83 EXPECT_EQ(67, output.tabStripLayout.rightIndent); 83 EXPECT_EQ(67, output.tabStripLayout.rightIndent);
84 EXPECT_NSEQ(NSMakeRect(0, 553, 600, 32), output.toolbarFrame); 84 EXPECT_NSEQ(NSMakeRect(0, 553, 600, 32), output.toolbarFrame);
85 EXPECT_NSEQ(NSMakeRect(0, 527, 600, 26), output.bookmarkFrame); 85 EXPECT_NSEQ(NSMakeRect(0, 527, 600, 26), output.bookmarkFrame);
86 EXPECT_NSEQ(NSMakeRect(0, 527, 600, 95), output.fullscreenBackingBarFrame); 86 EXPECT_NSEQ(NSMakeRect(0, 527, 600, 95), output.fullscreenBackingBarFrame);
87 EXPECT_EQ(527, output.findBarMaxY); 87 EXPECT_EQ(527, output.findBarMaxY);
88 EXPECT_EQ(527, output.fullscreenExitButtonMaxY);
89 EXPECT_NSEQ(NSMakeRect(0, 455, 600, 111), output.infoBarFrame); 88 EXPECT_NSEQ(NSMakeRect(0, 455, 600, 111), output.infoBarFrame);
90 EXPECT_NSEQ(NSMakeRect(0, 0, 600, 44), output.downloadShelfFrame); 89 EXPECT_NSEQ(NSMakeRect(0, 0, 600, 44), output.downloadShelfFrame);
91 EXPECT_NSEQ(NSMakeRect(0, 44, 600, 411), output.contentAreaFrame); 90 EXPECT_NSEQ(NSMakeRect(0, 44, 600, 411), output.contentAreaFrame);
92 } 91 }
93 92
94 // In fullscreen mode for Yosemite, the tab strip's left indent should be 93 // In fullscreen mode for Yosemite, the tab strip's left indent should be
95 // sufficiently large to accomodate the addition of traffic light buttons. 94 // sufficiently large to accomodate the addition of traffic light buttons.
96 TEST_F(BrowserWindowLayoutTest, TestYosemiteFullscreenTrafficLights) { 95 TEST_F(BrowserWindowLayoutTest, TestYosemiteFullscreenTrafficLights) {
97 ApplyStandardFullscreenLayoutParameters(); 96 ApplyStandardFullscreenLayoutParameters();
98 [layout setOSYosemiteOrLater:YES]; 97 [layout setOSYosemiteOrLater:YES];
(...skipping 12 matching lines...) Expand all
111 110
112 EXPECT_NSEQ(NSMakeRect(0, 575, 600, 37), output.tabStripLayout.frame); 111 EXPECT_NSEQ(NSMakeRect(0, 575, 600, 37), output.tabStripLayout.frame);
113 EXPECT_NSEQ(NSMakeRect(533, 579, 63, 28), output.tabStripLayout.avatarFrame); 112 EXPECT_NSEQ(NSMakeRect(533, 579, 63, 28), output.tabStripLayout.avatarFrame);
114 EXPECT_EQ(0, output.tabStripLayout.leftIndent); 113 EXPECT_EQ(0, output.tabStripLayout.leftIndent);
115 EXPECT_FALSE(output.tabStripLayout.addCustomWindowControls); 114 EXPECT_FALSE(output.tabStripLayout.addCustomWindowControls);
116 EXPECT_EQ(67, output.tabStripLayout.rightIndent); 115 EXPECT_EQ(67, output.tabStripLayout.rightIndent);
117 EXPECT_NSEQ(NSMakeRect(0, 543, 600, 32), output.toolbarFrame); 116 EXPECT_NSEQ(NSMakeRect(0, 543, 600, 32), output.toolbarFrame);
118 EXPECT_NSEQ(NSMakeRect(0, 517, 600, 26), output.bookmarkFrame); 117 EXPECT_NSEQ(NSMakeRect(0, 517, 600, 26), output.bookmarkFrame);
119 EXPECT_NSEQ(NSMakeRect(0, 517, 600, 95), output.fullscreenBackingBarFrame); 118 EXPECT_NSEQ(NSMakeRect(0, 517, 600, 95), output.fullscreenBackingBarFrame);
120 EXPECT_EQ(517, output.findBarMaxY); 119 EXPECT_EQ(517, output.findBarMaxY);
121 EXPECT_EQ(517, output.fullscreenExitButtonMaxY);
122 EXPECT_NSEQ(NSMakeRect(0, 445, 600, 111), output.infoBarFrame); 120 EXPECT_NSEQ(NSMakeRect(0, 445, 600, 111), output.infoBarFrame);
123 EXPECT_NSEQ(NSMakeRect(0, 0, 600, 44), output.downloadShelfFrame); 121 EXPECT_NSEQ(NSMakeRect(0, 0, 600, 44), output.downloadShelfFrame);
124 EXPECT_NSEQ(NSMakeRect(0, 44, 600, 411), output.contentAreaFrame); 122 EXPECT_NSEQ(NSMakeRect(0, 44, 600, 411), output.contentAreaFrame);
125 } 123 }
126 124
127 TEST_F(BrowserWindowLayoutTest, TestPopupWindow) { 125 TEST_F(BrowserWindowLayoutTest, TestPopupWindow) {
128 [layout setHasTabStrip:NO]; 126 [layout setHasTabStrip:NO];
129 [layout setHasToolbar:NO]; 127 [layout setHasToolbar:NO];
130 [layout setHasLocationBar:YES]; 128 [layout setHasLocationBar:YES];
131 [layout setBookmarkBarHidden:YES]; 129 [layout setBookmarkBarHidden:YES];
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 } 204 }
207 205
208 // Tests that the avatar button is not aligned on the half pixel. 206 // Tests that the avatar button is not aligned on the half pixel.
209 TEST_F(BrowserWindowLayoutTest, TestAvatarButtonPixelAlignment) { 207 TEST_F(BrowserWindowLayoutTest, TestAvatarButtonPixelAlignment) {
210 [layout setAvatarSize:NSMakeSize(28, 28)]; 208 [layout setAvatarSize:NSMakeSize(28, 28)];
211 209
212 chrome::LayoutOutput output = [layout computeLayout]; 210 chrome::LayoutOutput output = [layout computeLayout];
213 211
214 EXPECT_NSEQ(NSMakeRect(537, 589, 28, 28), output.tabStripLayout.avatarFrame); 212 EXPECT_NSEQ(NSMakeRect(537, 589, 28, 28), output.tabStripLayout.avatarFrame);
215 } 213 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_layout.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698