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/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 view_list.push_back(VIEW_ID_INFO_BAR); | 310 view_list.push_back(VIEW_ID_INFO_BAR); |
311 view_list.push_back(VIEW_ID_TAB_CONTENT_AREA); | 311 view_list.push_back(VIEW_ID_TAB_CONTENT_AREA); |
312 view_list.push_back(VIEW_ID_FULLSCREEN_FLOATING_BAR); | 312 view_list.push_back(VIEW_ID_FULLSCREEN_FLOATING_BAR); |
313 view_list.push_back(VIEW_ID_BOOKMARK_BAR); | 313 view_list.push_back(VIEW_ID_BOOKMARK_BAR); |
314 view_list.push_back(VIEW_ID_TOOLBAR); | 314 view_list.push_back(VIEW_ID_TOOLBAR); |
315 view_list.push_back(VIEW_ID_FIND_BAR); | 315 view_list.push_back(VIEW_ID_FIND_BAR); |
316 view_list.push_back(VIEW_ID_DOWNLOAD_SHELF); | 316 view_list.push_back(VIEW_ID_DOWNLOAD_SHELF); |
317 VerifyZOrder(view_list); | 317 VerifyZOrder(view_list); |
318 } | 318 } |
319 | 319 |
| 320 // Verify that in presentation mode, Instant search results are below the |
| 321 // floating toolbar. |
| 322 IN_PROC_BROWSER_TEST_F(BrowserWindowControllerTest, |
| 323 DISABLED_OverlayOffsetInstantPresentationMode) { |
| 324 chrome::ToggleFullscreenMode(browser()); |
| 325 ShowInstantResults(); |
| 326 [controller() setFloatingBarShownFraction:0.0]; |
| 327 EXPECT_EQ( |
| 328 0, [[controller() overlayableContentsController] overlayContentsOffset]); |
| 329 EXPECT_EQ( |
| 330 0, [[controller() overlayableContentsController] activeContainerOffset]); |
| 331 [controller() setFloatingBarShownFraction:1.0]; |
| 332 |
| 333 NSView* floating_bar = GetViewWithID(VIEW_ID_FULLSCREEN_FLOATING_BAR); |
| 334 CGFloat floating_bar_height = NSHeight([floating_bar frame]); |
| 335 EXPECT_EQ( |
| 336 floating_bar_height, |
| 337 [[controller() overlayableContentsController] overlayContentsOffset]); |
| 338 EXPECT_EQ( |
| 339 floating_bar_height, |
| 340 [[controller() overlayableContentsController] activeContainerOffset]); |
| 341 } |
| 342 |
320 // Verify that if the fullscreen floating bar view is below the tab content area | 343 // Verify that if the fullscreen floating bar view is below the tab content area |
321 // then calling |updateSubviewZOrder:| will correctly move back above. | 344 // then calling |updateSubviewZOrder:| will correctly move back above. |
322 IN_PROC_BROWSER_TEST_F(BrowserWindowControllerTest, | 345 IN_PROC_BROWSER_TEST_F(BrowserWindowControllerTest, |
323 DISABLED_FloatingBarBelowContentView) { | 346 DISABLED_FloatingBarBelowContentView) { |
324 // TODO(kbr): re-enable: http://crbug.com/222296 | 347 // TODO(kbr): re-enable: http://crbug.com/222296 |
325 if (base::mac::IsOSMountainLionOrLater()) | 348 if (base::mac::IsOSMountainLionOrLater()) |
326 return; | 349 return; |
327 | 350 |
328 chrome::ToggleFullscreenMode(browser()); | 351 chrome::ToggleFullscreenMode(browser()); |
329 | 352 |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 | 482 |
460 NSView* bookmarkView = [[controller() bookmarkBarController] view]; | 483 NSView* bookmarkView = [[controller() bookmarkBarController] view]; |
461 NSView* contentView = [[controller() window] contentView]; | 484 NSView* contentView = [[controller() window] contentView]; |
462 NSPoint point = [bookmarkView convertPoint:NSMakePoint(1, 1) | 485 NSPoint point = [bookmarkView convertPoint:NSMakePoint(1, 1) |
463 toView:[contentView superview]]; | 486 toView:[contentView superview]]; |
464 | 487 |
465 EXPECT_FALSE([[contentView hitTest:point] isDescendantOf:bookmarkView]); | 488 EXPECT_FALSE([[contentView hitTest:point] isDescendantOf:bookmarkView]); |
466 EXPECT_TRUE([[contentView hitTest:point] | 489 EXPECT_TRUE([[contentView hitTest:point] |
467 isDescendantOf:[controller() tabContentArea]]); | 490 isDescendantOf:[controller() tabContentArea]]); |
468 } | 491 } |
OLD | NEW |