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

Side by Side Diff: chrome/browser/ui/fullscreen/fullscreen_controller_interactive_browsertest.cc

Issue 12018007: Refactor BrowserWindow fullscreen and presentation on Mac to be consistent with other platforms. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge TOT Created 7 years, 10 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 #include "build/build_config.h" 5 #include "build/build_config.h"
6 #include "chrome/browser/content_settings/host_content_settings_map.h" 6 #include "chrome/browser/content_settings/host_content_settings_map.h"
7 #include "chrome/browser/profiles/profile.h" 7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/browser/ui/browser.h" 8 #include "chrome/browser/ui/browser.h"
9 #include "chrome/browser/ui/browser_commands.h" 9 #include "chrome/browser/ui/browser_commands.h"
10 #include "chrome/browser/ui/browser_tabstrip.h" 10 #include "chrome/browser/ui/browser_tabstrip.h"
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 FullscreenControllerTest, DISABLED_TabEntersPresentationModeFromWindowed) { 361 FullscreenControllerTest, DISABLED_TabEntersPresentationModeFromWindowed) {
362 ASSERT_TRUE(test_server()->Start()); 362 ASSERT_TRUE(test_server()->Start());
363 363
364 AddTabAtIndex(0, GURL(kAboutBlankURL), PAGE_TRANSITION_TYPED); 364 AddTabAtIndex(0, GURL(kAboutBlankURL), PAGE_TRANSITION_TYPED);
365 365
366 WebContents* tab = chrome::GetActiveWebContents(browser()); 366 WebContents* tab = chrome::GetActiveWebContents(browser());
367 367
368 { 368 {
369 FullscreenNotificationObserver fullscreen_observer; 369 FullscreenNotificationObserver fullscreen_observer;
370 EXPECT_FALSE(browser()->window()->IsFullscreen()); 370 EXPECT_FALSE(browser()->window()->IsFullscreen());
371 EXPECT_FALSE(browser()->window()->InPresentationMode()); 371 EXPECT_FALSE(browser()->window()->IsFullscreenWithChrome());
372 EXPECT_FALSE(browser()->window()->IsFullscreenWithoutChrome());
372 browser()->ToggleFullscreenModeForTab(tab, true); 373 browser()->ToggleFullscreenModeForTab(tab, true);
373 fullscreen_observer.Wait(); 374 fullscreen_observer.Wait();
374 ASSERT_TRUE(browser()->window()->IsFullscreen()); 375 EXPECT_TRUE(browser()->window()->IsFullscreen());
375 ASSERT_TRUE(browser()->window()->InPresentationMode()); 376 EXPECT_FALSE(browser()->window()->IsFullscreenWithChrome());
377 EXPECT_TRUE(browser()->window()->IsFullscreenWithoutChrome());
376 } 378 }
377 379
378 { 380 {
379 FullscreenNotificationObserver fullscreen_observer; 381 FullscreenNotificationObserver fullscreen_observer;
380 browser()->TogglePresentationMode(); 382 browser()->TogglePresentationMode();
381 fullscreen_observer.Wait(); 383 fullscreen_observer.Wait();
382 ASSERT_FALSE(browser()->window()->IsFullscreen()); 384 EXPECT_FALSE(browser()->window()->IsFullscreen());
383 ASSERT_FALSE(browser()->window()->InPresentationMode()); 385 EXPECT_FALSE(browser()->window()->IsFullscreenWithChrome());
386 EXPECT_FALSE(browser()->window()->IsFullscreenWithoutChrome());
384 } 387 }
385 388
386 if (base::mac::IsOSLionOrLater()) { 389 if (base::mac::IsOSLionOrLater()) {
387 // Test that tab fullscreen mode doesn't make presentation mode the default 390 // Test that tab fullscreen mode doesn't make presentation mode the default
388 // on Lion. 391 // on Lion.
389 FullscreenNotificationObserver fullscreen_observer; 392 FullscreenNotificationObserver fullscreen_observer;
390 chrome::ToggleFullscreenMode(browser()); 393 chrome::ToggleFullscreenMode(browser());
391 fullscreen_observer.Wait(); 394 fullscreen_observer.Wait();
392 ASSERT_TRUE(browser()->window()->IsFullscreen()); 395 EXPECT_TRUE(browser()->window()->IsFullscreen());
393 ASSERT_FALSE(browser()->window()->InPresentationMode()); 396 EXPECT_TRUE(browser()->window()->IsFullscreenWithChrome());
397 EXPECT_FALSE(browser()->window()->IsFullscreenWithoutChrome());
394 } 398 }
395 } 399 }
396 #endif 400 #endif
397 401
398 // Tests mouse lock can be escaped with ESC key. 402 // Tests mouse lock can be escaped with ESC key.
399 IN_PROC_BROWSER_TEST_F(FullscreenControllerInteractiveTest, EscapingMouseLock) { 403 IN_PROC_BROWSER_TEST_F(FullscreenControllerInteractiveTest, EscapingMouseLock) {
400 ASSERT_TRUE(test_server()->Start()); 404 ASSERT_TRUE(test_server()->Start());
401 ui_test_utils::NavigateToURL(browser(), 405 ui_test_utils::NavigateToURL(browser(),
402 test_server()->GetURL(kFullscreenMouseLockHTML)); 406 test_server()->GetURL(kFullscreenMouseLockHTML));
403 407
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
870 874
871 GURL url = test_server()->GetURL("simple.html"); 875 GURL url = test_server()->GetURL("simple.html");
872 AddTabAtIndex(0, url, PAGE_TRANSITION_TYPED); 876 AddTabAtIndex(0, url, PAGE_TRANSITION_TYPED);
873 877
874 // Validate that going fullscreen for a URL defaults to asking permision. 878 // Validate that going fullscreen for a URL defaults to asking permision.
875 ASSERT_FALSE(IsFullscreenPermissionRequested()); 879 ASSERT_FALSE(IsFullscreenPermissionRequested());
876 ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreenNoRetries(true)); 880 ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreenNoRetries(true));
877 ASSERT_TRUE(IsFullscreenPermissionRequested()); 881 ASSERT_TRUE(IsFullscreenPermissionRequested());
878 ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreenNoRetries(false)); 882 ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreenNoRetries(false));
879 } 883 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698