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 "chrome/browser/ui/cocoa/browser_window_controller.h" | 5 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
6 | 6 |
7 #import "base/mac/mac_util.h" | 7 #import "base/mac/mac_util.h" |
8 #include "base/mac/sdk_forward_declarations.h" | 8 #include "base/mac/sdk_forward_declarations.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 return icon_bottom.y - info_bar_top.y; | 223 return icon_bottom.y - info_bar_top.y; |
224 } | 224 } |
225 | 225 |
226 // The traffic lights should always be in front of the content view and the | 226 // The traffic lights should always be in front of the content view and the |
227 // tab strip view. Since the traffic lights change across OSX versions, this | 227 // tab strip view. Since the traffic lights change across OSX versions, this |
228 // test verifies that the contentView is in the back, and if the tab strip | 228 // test verifies that the contentView is in the back, and if the tab strip |
229 // view is a sibling, it is directly in front of the content view. | 229 // view is a sibling, it is directly in front of the content view. |
230 void VerifyTrafficLightZOrder() const { | 230 void VerifyTrafficLightZOrder() const { |
231 NSView* contentView = [[controller() window] contentView]; | 231 NSView* contentView = [[controller() window] contentView]; |
232 NSView* rootView = [contentView superview]; | 232 NSView* rootView = [contentView superview]; |
233 EXPECT_EQ(contentView, [[rootView subviews] objectAtIndex:0]); | 233 NSArray* subviews = [rootView subviews]; |
| 234 |
| 235 EXPECT_EQ([controller() tabStripBackgroundView], |
| 236 [subviews objectAtIndex:0]); |
| 237 EXPECT_EQ(contentView, [subviews objectAtIndex:1]); |
234 | 238 |
235 NSView* tabStripView = [controller() tabStripView]; | 239 NSView* tabStripView = [controller() tabStripView]; |
236 if ([[rootView subviews] containsObject:tabStripView]) | 240 if ([subviews containsObject:tabStripView]) |
237 EXPECT_EQ(tabStripView, [[rootView subviews] objectAtIndex:1]); | 241 EXPECT_EQ(tabStripView, [subviews objectAtIndex:2]); |
238 } | 242 } |
239 | 243 |
240 private: | 244 private: |
241 DISALLOW_COPY_AND_ASSIGN(BrowserWindowControllerTest); | 245 DISALLOW_COPY_AND_ASSIGN(BrowserWindowControllerTest); |
242 }; | 246 }; |
243 | 247 |
244 // Tests that adding the first profile moves the Lion fullscreen button over | 248 // Tests that adding the first profile moves the Lion fullscreen button over |
245 // correctly. | 249 // correctly. |
246 // DISABLED_ because it regularly times out: http://crbug.com/159002. | 250 // DISABLED_ because it regularly times out: http://crbug.com/159002. |
247 IN_PROC_BROWSER_TEST_F(BrowserWindowControllerTest, | 251 IN_PROC_BROWSER_TEST_F(BrowserWindowControllerTest, |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
501 // Toggle overlay, then verify z order. | 505 // Toggle overlay, then verify z order. |
502 [controller() showOverlay]; | 506 [controller() showOverlay]; |
503 [controller() removeOverlay]; | 507 [controller() removeOverlay]; |
504 VerifyTrafficLightZOrder(); | 508 VerifyTrafficLightZOrder(); |
505 | 509 |
506 // Toggle immersive fullscreen, then verify z order. | 510 // Toggle immersive fullscreen, then verify z order. |
507 [controller() enterImmersiveFullscreen]; | 511 [controller() enterImmersiveFullscreen]; |
508 [controller() exitImmersiveFullscreen]; | 512 [controller() exitImmersiveFullscreen]; |
509 VerifyTrafficLightZOrder(); | 513 VerifyTrafficLightZOrder(); |
510 } | 514 } |
OLD | NEW |