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

Side by Side Diff: chrome/browser/ui/views/frame/immersive_mode_controller_ash_unittest.cc

Issue 789533002: Fullscreen: make fullscreen requests come from RenderFrame (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: make try happy Created 5 years, 11 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "chrome/browser/ui/views/frame/immersive_mode_controller_ash.h" 5 #include "chrome/browser/ui/views/frame/immersive_mode_controller_ash.h"
6 6
7 #include "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/root_window_controller.h" 8 #include "ash/root_window_controller.h"
9 #include "ash/shelf/shelf_layout_manager.h" 9 #include "ash/shelf/shelf_layout_manager.h"
10 #include "ash/shelf/shelf_types.h" 10 #include "ash/shelf/shelf_types.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 chrome::ToggleFullscreenMode(browser()); 66 chrome::ToggleFullscreenMode(browser());
67 waiter->Wait(); 67 waiter->Wait();
68 } 68 }
69 69
70 // Set whether the browser is in tab fullscreen. 70 // Set whether the browser is in tab fullscreen.
71 void SetTabFullscreen(bool tab_fullscreen) { 71 void SetTabFullscreen(bool tab_fullscreen) {
72 content::WebContents* web_contents = 72 content::WebContents* web_contents =
73 browser_view()->GetContentsWebViewForTest()->GetWebContents(); 73 browser_view()->GetContentsWebViewForTest()->GetWebContents();
74 scoped_ptr<FullscreenNotificationObserver> waiter( 74 scoped_ptr<FullscreenNotificationObserver> waiter(
75 new FullscreenNotificationObserver()); 75 new FullscreenNotificationObserver());
76 browser()->fullscreen_controller()->ToggleFullscreenModeForTab( 76 if (tab_fullscreen) {
77 web_contents, tab_fullscreen); 77 browser()->fullscreen_controller()->EnterFullscreenModeForTab(
78 web_contents, GURL());
79 } else {
80 browser()->fullscreen_controller()->ExitFullscreenModeForTab(
81 web_contents);
82 }
83
78 waiter->Wait(); 84 waiter->Wait();
79 } 85 }
80 86
81 // Attempt revealing the top-of-window views. 87 // Attempt revealing the top-of-window views.
82 void AttemptReveal() { 88 void AttemptReveal() {
83 if (!revealed_lock_.get()) { 89 if (!revealed_lock_.get()) {
84 revealed_lock_.reset(controller_->GetRevealedLock( 90 revealed_lock_.reset(controller_->GetRevealedLock(
85 ImmersiveModeControllerAsh::ANIMATE_REVEAL_NO)); 91 ImmersiveModeControllerAsh::ANIMATE_REVEAL_NO));
86 } 92 }
87 } 93 }
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 335
330 // Exit immersive fullscreen. The web contents should be back below the window 336 // Exit immersive fullscreen. The web contents should be back below the window
331 // header. 337 // header.
332 ToggleFullscreen(); 338 ToggleFullscreen();
333 EXPECT_FALSE(browser_view()->GetWidget()->IsFullscreen()); 339 EXPECT_FALSE(browser_view()->GetWidget()->IsFullscreen());
334 EXPECT_FALSE(controller()->IsEnabled()); 340 EXPECT_FALSE(controller()->IsEnabled());
335 EXPECT_FALSE(tabstrip->visible()); 341 EXPECT_FALSE(tabstrip->visible());
336 EXPECT_FALSE(toolbar->visible()); 342 EXPECT_FALSE(toolbar->visible());
337 EXPECT_EQ(header_height, GetBoundsInWidget(contents_web_view).y()); 343 EXPECT_EQ(header_height, GetBoundsInWidget(contents_web_view).y());
338 } 344 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698