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

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

Issue 12594015: Alternate NTP Mac: Push down overlay in presentation mode (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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 | Annotate | Revision Log
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/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 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 view_list.push_back(VIEW_ID_INFO_BAR); 307 view_list.push_back(VIEW_ID_INFO_BAR);
308 view_list.push_back(VIEW_ID_TAB_CONTENT_AREA); 308 view_list.push_back(VIEW_ID_TAB_CONTENT_AREA);
309 view_list.push_back(VIEW_ID_FULLSCREEN_FLOATING_BAR); 309 view_list.push_back(VIEW_ID_FULLSCREEN_FLOATING_BAR);
310 view_list.push_back(VIEW_ID_BOOKMARK_BAR); 310 view_list.push_back(VIEW_ID_BOOKMARK_BAR);
311 view_list.push_back(VIEW_ID_TOOLBAR); 311 view_list.push_back(VIEW_ID_TOOLBAR);
312 view_list.push_back(VIEW_ID_FIND_BAR); 312 view_list.push_back(VIEW_ID_FIND_BAR);
313 view_list.push_back(VIEW_ID_DOWNLOAD_SHELF); 313 view_list.push_back(VIEW_ID_DOWNLOAD_SHELF);
314 VerifyZOrder(view_list); 314 VerifyZOrder(view_list);
315 } 315 }
316 316
317 // Verify that in presentation mode, instant search results are below the
dhollowa 2013/03/25 16:28:18 nit: "Instant"
sail 2013/03/26 00:16:43 Done.
318 // floating toolbar.
319 IN_PROC_BROWSER_TEST_F(BrowserWindowControllerTest,
320 OverlayOffsetInstantPresentationMode) {
321 chrome::ToggleFullscreenMode(browser());
322 ShowInstantResults();
323 [controller() setFloatingBarShownFraction:0.0];
324 EXPECT_EQ(
325 0, [[controller() overlayableContentsController] overlayContentsOffset]);
326 EXPECT_EQ(
327 0, [[controller() overlayableContentsController] activeContainerOffset]);
328 [controller() setFloatingBarShownFraction:1.0];
329
330 NSView* floating_bar = GetViewWithID(VIEW_ID_FULLSCREEN_FLOATING_BAR);
331 CGFloat floating_bar_height = NSHeight([floating_bar frame]);
332 EXPECT_EQ(
333 floating_bar_height,
334 [[controller() overlayableContentsController] overlayContentsOffset]);
335 EXPECT_EQ(
336 floating_bar_height,
337 [[controller() overlayableContentsController] activeContainerOffset]);
338 }
339
317 // Verify that if the fullscreen floating bar view is below the tab content area 340 // Verify that if the fullscreen floating bar view is below the tab content area
318 // then calling |updateSubviewZOrder:| will correctly move back above. 341 // then calling |updateSubviewZOrder:| will correctly move back above.
319 IN_PROC_BROWSER_TEST_F(BrowserWindowControllerTest, 342 IN_PROC_BROWSER_TEST_F(BrowserWindowControllerTest,
320 FloatingBarBelowContentView) { 343 FloatingBarBelowContentView) {
321 chrome::ToggleFullscreenMode(browser()); 344 chrome::ToggleFullscreenMode(browser());
322 345
323 NSView* fullscreen_floating_bar = 346 NSView* fullscreen_floating_bar =
324 GetViewWithID(VIEW_ID_FULLSCREEN_FLOATING_BAR); 347 GetViewWithID(VIEW_ID_FULLSCREEN_FLOATING_BAR);
325 [fullscreen_floating_bar removeFromSuperview]; 348 [fullscreen_floating_bar removeFromSuperview];
326 [[[controller() window] contentView] addSubview:fullscreen_floating_bar 349 [[[controller() window] contentView] addSubview:fullscreen_floating_bar
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 471
449 NSView* bookmarkView = [[controller() bookmarkBarController] view]; 472 NSView* bookmarkView = [[controller() bookmarkBarController] view];
450 NSView* contentView = [[controller() window] contentView]; 473 NSView* contentView = [[controller() window] contentView];
451 NSPoint point = [bookmarkView convertPoint:NSMakePoint(1, 1) 474 NSPoint point = [bookmarkView convertPoint:NSMakePoint(1, 1)
452 toView:[contentView superview]]; 475 toView:[contentView superview]];
453 476
454 EXPECT_FALSE([[contentView hitTest:point] isDescendantOf:bookmarkView]); 477 EXPECT_FALSE([[contentView hitTest:point] isDescendantOf:bookmarkView]);
455 EXPECT_TRUE([[contentView hitTest:point] 478 EXPECT_TRUE([[contentView hitTest:point]
456 isDescendantOf:[controller() tabContentArea]]); 479 isDescendantOf:[controller() tabContentArea]]);
457 } 480 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698