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

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

Issue 520733004: mac, yosemite: Resize button causes fullscreen effect. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase against top of tree. Created 6 years, 3 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 | « no previous file | chrome/browser/ui/cocoa/browser_window_controller_private.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 13 matching lines...) Expand all
24 #import "chrome/browser/ui/cocoa/browser_window_controller_private.h" 24 #import "chrome/browser/ui/cocoa/browser_window_controller_private.h"
25 #import "chrome/browser/ui/cocoa/fast_resize_view.h" 25 #import "chrome/browser/ui/cocoa/fast_resize_view.h"
26 #import "chrome/browser/ui/cocoa/history_overlay_controller.h" 26 #import "chrome/browser/ui/cocoa/history_overlay_controller.h"
27 #import "chrome/browser/ui/cocoa/infobars/infobar_cocoa.h" 27 #import "chrome/browser/ui/cocoa/infobars/infobar_cocoa.h"
28 #import "chrome/browser/ui/cocoa/infobars/infobar_container_controller.h" 28 #import "chrome/browser/ui/cocoa/infobars/infobar_container_controller.h"
29 #import "chrome/browser/ui/cocoa/infobars/infobar_controller.h" 29 #import "chrome/browser/ui/cocoa/infobars/infobar_controller.h"
30 #import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" 30 #import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h"
31 #import "chrome/browser/ui/cocoa/nsview_additions.h" 31 #import "chrome/browser/ui/cocoa/nsview_additions.h"
32 #import "chrome/browser/ui/cocoa/profiles/avatar_base_controller.h" 32 #import "chrome/browser/ui/cocoa/profiles/avatar_base_controller.h"
33 #import "chrome/browser/ui/cocoa/tab_contents/overlayable_contents_controller.h" 33 #import "chrome/browser/ui/cocoa/tab_contents/overlayable_contents_controller.h"
34 #import "chrome/browser/ui/cocoa/tabs/tab_strip_view.h"
34 #include "chrome/browser/ui/extensions/application_launch.h" 35 #include "chrome/browser/ui/extensions/application_launch.h"
35 #include "chrome/browser/ui/find_bar/find_bar_controller.h" 36 #include "chrome/browser/ui/find_bar/find_bar_controller.h"
36 #include "chrome/browser/ui/find_bar/find_bar.h" 37 #include "chrome/browser/ui/find_bar/find_bar.h"
37 #include "chrome/browser/ui/tabs/tab_strip_model.h" 38 #include "chrome/browser/ui/tabs/tab_strip_model.h"
38 #include "chrome/test/base/in_process_browser_test.h" 39 #include "chrome/test/base/in_process_browser_test.h"
39 #include "chrome/test/base/testing_profile.h" 40 #include "chrome/test/base/testing_profile.h"
40 #include "content/public/browser/web_contents.h" 41 #include "content/public/browser/web_contents.h"
41 #include "content/public/test/test_utils.h" 42 #include "content/public/test/test_utils.h"
42 #import "testing/gtest_mac.h" 43 #import "testing/gtest_mac.h"
43 #include "ui/gfx/animation/slide_animation.h" 44 #include "ui/gfx/animation/slide_animation.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 LocationBarViewMac* location_bar_view = [controller() locationBarBridge]; 207 LocationBarViewMac* location_bar_view = [controller() locationBarBridge];
207 NSPoint icon_bottom = location_bar_view->GetPageInfoBubblePoint(); 208 NSPoint icon_bottom = location_bar_view->GetPageInfoBubblePoint();
208 209
209 NSPoint info_bar_top = NSMakePoint(0, 210 NSPoint info_bar_top = NSMakePoint(0,
210 NSHeight([info_bar_container_controller view].frame) - 211 NSHeight([info_bar_container_controller view].frame) -
211 overlapping_tip_height); 212 overlapping_tip_height);
212 info_bar_top = [[info_bar_container_controller view] 213 info_bar_top = [[info_bar_container_controller view]
213 convertPoint:info_bar_top toView:nil]; 214 convertPoint:info_bar_top toView:nil];
214 return icon_bottom.y - info_bar_top.y; 215 return icon_bottom.y - info_bar_top.y;
215 } 216 }
217 // The traffic lights should always be in front of the content view and the
218 // tab strip view. Since the traffic lights change across OSX versions, this
219 // test verifies that the contentView is in the back, and if the tab strip
220 // view is a sibling, it is directly in front of the content view.
221 void VerifyTrafficLightZOrder() const {
222 NSView* contentView = [[controller() window] contentView];
223 NSView* rootView = [contentView superview];
224 EXPECT_EQ(contentView, [[rootView subviews] objectAtIndex:0]);
225
226 NSView* tabStripView = [controller() tabStripView];
227 if ([[rootView subviews] containsObject:tabStripView])
228 EXPECT_EQ(tabStripView, [[rootView subviews] objectAtIndex:1]);
229 }
216 230
217 private: 231 private:
218 DISALLOW_COPY_AND_ASSIGN(BrowserWindowControllerTest); 232 DISALLOW_COPY_AND_ASSIGN(BrowserWindowControllerTest);
219 }; 233 };
220 234
221 // Tests that adding the first profile moves the Lion fullscreen button over 235 // Tests that adding the first profile moves the Lion fullscreen button over
222 // correctly. 236 // correctly.
223 // DISABLED_ because it regularly times out: http://crbug.com/159002. 237 // DISABLED_ because it regularly times out: http://crbug.com/159002.
224 IN_PROC_BROWSER_TEST_F(BrowserWindowControllerTest, 238 IN_PROC_BROWSER_TEST_F(BrowserWindowControllerTest,
225 DISABLED_ProfileAvatarFullscreenButton) { 239 DISABLED_ProfileAvatarFullscreenButton) {
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 EXPECT_TRUE([controller() isBookmarkBarVisible]); 469 EXPECT_TRUE([controller() isBookmarkBarVisible]);
456 EXPECT_EQ(std::min(GetExpectedTopInfoBarTipHeight(), max_tip_height), 470 EXPECT_EQ(std::min(GetExpectedTopInfoBarTipHeight(), max_tip_height),
457 [[controller() infoBarContainerController] overlappingTipHeight]); 471 [[controller() infoBarContainerController] overlappingTipHeight]);
458 472
459 chrome::ExecuteCommand(browser(), IDC_SHOW_BOOKMARK_BAR); 473 chrome::ExecuteCommand(browser(), IDC_SHOW_BOOKMARK_BAR);
460 WaitForBookmarkBarAnimationToFinish(); 474 WaitForBookmarkBarAnimationToFinish();
461 EXPECT_FALSE([controller() isBookmarkBarVisible]); 475 EXPECT_FALSE([controller() isBookmarkBarVisible]);
462 EXPECT_EQ(std::min(GetExpectedTopInfoBarTipHeight(), max_tip_height), 476 EXPECT_EQ(std::min(GetExpectedTopInfoBarTipHeight(), max_tip_height),
463 [[controller() infoBarContainerController] overlappingTipHeight]); 477 [[controller() infoBarContainerController] overlappingTipHeight]);
464 } 478 }
479
480 IN_PROC_BROWSER_TEST_F(BrowserWindowControllerTest, TrafficLightZOrder) {
481 // Verify z order immediately after creation.
482 VerifyTrafficLightZOrder();
483
484 // Toggle overlay, then verify z order.
485 [controller() showOverlay];
486 [controller() removeOverlay];
487 VerifyTrafficLightZOrder();
488
489 // Toggle immersive fullscreen, then verify z order.
490 [controller() enterImmersiveFullscreen];
491 [controller() exitImmersiveFullscreen];
492 VerifyTrafficLightZOrder();
493 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/browser_window_controller_private.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698