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 #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 Loading... |
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 Loading... |
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 } |
OLD | NEW |