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

Unified Diff: chrome/browser/ui/views/frame/browser_non_client_frame_view_ash_browsertest.cc

Issue 27458002: Allow setting different hit test bounds overrides for mouse and touch (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/frame/browser_non_client_frame_view_ash_browsertest.cc
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash_browsertest.cc b/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash_browsertest.cc
index a38408c9a8fa3887907ff0079b561e81ece93dff..4ab7d1a5ec42479f2366b25c61edf5f6db5237ca 100644
--- a/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash_browsertest.cc
+++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash_browsertest.cc
@@ -132,6 +132,7 @@ IN_PROC_BROWSER_TEST_F(BrowserNonClientFrameViewAshTest, ImmersiveFullscreen) {
// We know we're using Views, so static cast.
BrowserView* browser_view = static_cast<BrowserView*>(browser()->window());
+ content::WebContents* web_contents = browser_view->GetActiveWebContents();
Widget* widget = browser_view->GetWidget();
// We know we're using Ash, so static cast.
BrowserNonClientFrameViewAsh* frame_view =
@@ -142,7 +143,6 @@ IN_PROC_BROWSER_TEST_F(BrowserNonClientFrameViewAshTest, ImmersiveFullscreen) {
static_cast<ImmersiveModeControllerAsh*>(
browser_view->immersive_mode_controller());
immersive_mode_controller->DisableAnimationsForTest();
- immersive_mode_controller->SetForceHideTabIndicatorsForTest(true);
// Immersive mode starts disabled.
ASSERT_FALSE(widget->IsFullscreen());
@@ -151,8 +151,22 @@ IN_PROC_BROWSER_TEST_F(BrowserNonClientFrameViewAshTest, ImmersiveFullscreen) {
// Frame paints by default.
EXPECT_TRUE(frame_view->ShouldPaint());
- // Going fullscreen enables immersive mode.
- chrome::ToggleFullscreenMode(browser());
+ // Enter both browser fullscreen and tab fullscreen. Entering browser
+ // fullscreen should enable immersive fullscreen.
+ {
+ // NOTIFICATION_FULLSCREEN_CHANGED is sent asynchronously.
+ scoped_ptr<FullscreenNotificationObserver> waiter(
+ new FullscreenNotificationObserver());
+ chrome::ToggleFullscreenMode(browser());
+ waiter->Wait();
+ }
+ {
+ scoped_ptr<FullscreenNotificationObserver> waiter(
+ new FullscreenNotificationObserver());
+ browser()->fullscreen_controller()->ToggleFullscreenModeForTab(
+ web_contents, true);
+ waiter->Wait();
+ }
EXPECT_TRUE(immersive_mode_controller->IsEnabled());
// An immersive reveal shows the buttons and the top of the frame.
@@ -163,15 +177,21 @@ IN_PROC_BROWSER_TEST_F(BrowserNonClientFrameViewAshTest, ImmersiveFullscreen) {
EXPECT_TRUE(frame_view->UseShortHeader());
EXPECT_FALSE(frame_view->UseImmersiveLightbarHeaderStyle());
- // End the reveal. As the header does not paint a light bar when the
- // top-of-window views are not revealed, nothing should be painted.
+ // End the reveal. When in both immersive browser fullscreen and tab
+ // fullscreen, the tab lightbars should not be painted.
immersive_mode_controller->SetMouseHoveredForTest(false);
EXPECT_FALSE(immersive_mode_controller->IsRevealed());
EXPECT_FALSE(frame_view->ShouldPaint());
- // Repeat test but with the tab light bar visible when the top-of-window views
- // are not revealed.
- immersive_mode_controller->SetForceHideTabIndicatorsForTest(false);
+ // Repeat test but without tab fullscreen. The tab lightbars should now show
+ // when the top-of-window views are not revealed.
+ {
+ scoped_ptr<FullscreenNotificationObserver> waiter(
+ new FullscreenNotificationObserver());
+ browser()->fullscreen_controller()->ToggleFullscreenModeForTab(
+ web_contents, false);
+ waiter->Wait();
+ }
// Immersive reveal should have same behavior as before.
immersive_mode_controller->StartRevealForTest(true);
@@ -190,7 +210,12 @@ IN_PROC_BROWSER_TEST_F(BrowserNonClientFrameViewAshTest, ImmersiveFullscreen) {
EXPECT_TRUE(frame_view->UseImmersiveLightbarHeaderStyle());
// Exiting fullscreen exits immersive mode.
- browser_view->ExitFullscreen();
+ {
+ scoped_ptr<FullscreenNotificationObserver> waiter(
+ new FullscreenNotificationObserver());
+ browser_view->ExitFullscreen();
+ waiter->Wait();
+ }
EXPECT_FALSE(immersive_mode_controller->IsEnabled());
// Exiting immersive mode makes controls and frame visible again.

Powered by Google App Engine
This is Rietveld 408576698