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

Side by Side Diff: chrome/browser/ui/browser_browsertest.cc

Issue 9353010: Add FullscreenController::ToggleFullscreenModeWithExtension (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix copyright, compile erorr. Moved browser.h/cc change to this patch set. Created 8 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 <string> 5 #include <string>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #if defined(OS_MACOSX) 10 #if defined(OS_MACOSX)
(...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after
909 ui_test_utils::WindowedNotificationObserver fullscreen_observer( 909 ui_test_utils::WindowedNotificationObserver fullscreen_observer(
910 chrome::NOTIFICATION_FULLSCREEN_CHANGED, 910 chrome::NOTIFICATION_FULLSCREEN_CHANGED,
911 content::NotificationService::AllSources()); 911 content::NotificationService::AllSources());
912 browser()->ToggleFullscreenModeForTab(fullscreen_tab, true); 912 browser()->ToggleFullscreenModeForTab(fullscreen_tab, true);
913 fullscreen_observer.Wait(); 913 fullscreen_observer.Wait();
914 ASSERT_TRUE(browser()->window()->IsFullscreen()); 914 ASSERT_TRUE(browser()->window()->IsFullscreen());
915 } 915 }
916 916
917 browser()->RequestToLockMouse(fullscreen_tab); 917 browser()->RequestToLockMouse(fullscreen_tab);
918 FullscreenExitBubbleType type = 918 FullscreenExitBubbleType type =
919 browser()->fullscreen_controller_->GetFullscreenExitBubbleType(); 919 browser()->fullscreen_controller_->GetFullscreenExitBubbleType(NULL);
920 bool mouse_lock = false; 920 bool mouse_lock = false;
921 fullscreen_bubble::PermissionRequestedByType(type, NULL, &mouse_lock); 921 fullscreen_bubble::PermissionRequestedByType(type, NULL, &mouse_lock);
922 ASSERT_TRUE(mouse_lock); 922 ASSERT_TRUE(mouse_lock);
923 923
924 browser()->OnAcceptFullscreenPermission(fullscreen_tab->GetURL(), type); 924 browser()->OnAcceptFullscreenPermission(fullscreen_tab->GetURL(), type);
925 type = browser()->fullscreen_controller_->GetFullscreenExitBubbleType(); 925 type = browser()->fullscreen_controller_->GetFullscreenExitBubbleType(NULL);
926 ASSERT_FALSE(fullscreen_bubble::ShowButtonsForType(type)); 926 ASSERT_FALSE(fullscreen_bubble::ShowButtonsForType(type));
927 } 927 }
928 928
929 #if defined(OS_MACOSX) 929 #if defined(OS_MACOSX)
930 // http://crbug.com/100467 930 // http://crbug.com/100467
931 IN_PROC_BROWSER_TEST_F( 931 IN_PROC_BROWSER_TEST_F(
932 BrowserTest, FAILS_TabEntersPresentationModeFromWindowed) { 932 BrowserTest, FAILS_TabEntersPresentationModeFromWindowed) {
933 ASSERT_TRUE(test_server()->Start()); 933 ASSERT_TRUE(test_server()->Start());
934 934
935 AddTabAtIndex( 935 AddTabAtIndex(
(...skipping 10 matching lines...) Expand all
946 browser()->ToggleFullscreenModeForTab(fullscreen_tab, true); 946 browser()->ToggleFullscreenModeForTab(fullscreen_tab, true);
947 fullscreen_observer.Wait(); 947 fullscreen_observer.Wait();
948 ASSERT_TRUE(browser()->window()->IsFullscreen()); 948 ASSERT_TRUE(browser()->window()->IsFullscreen());
949 ASSERT_TRUE(browser()->window()->InPresentationMode()); 949 ASSERT_TRUE(browser()->window()->InPresentationMode());
950 } 950 }
951 951
952 { 952 {
953 ui_test_utils::WindowedNotificationObserver fullscreen_observer( 953 ui_test_utils::WindowedNotificationObserver fullscreen_observer(
954 chrome::NOTIFICATION_FULLSCREEN_CHANGED, 954 chrome::NOTIFICATION_FULLSCREEN_CHANGED,
955 content::NotificationService::AllSources()); 955 content::NotificationService::AllSources());
956 browser()->TogglePresentationMode(false); 956 browser()->TogglePresentationMode();
957 fullscreen_observer.Wait(); 957 fullscreen_observer.Wait();
958 ASSERT_FALSE(browser()->window()->IsFullscreen()); 958 ASSERT_FALSE(browser()->window()->IsFullscreen());
959 ASSERT_FALSE(browser()->window()->InPresentationMode()); 959 ASSERT_FALSE(browser()->window()->InPresentationMode());
960 } 960 }
961 961
962 if (base::mac::IsOSLionOrLater()) { 962 if (base::mac::IsOSLionOrLater()) {
963 // Test that tab fullscreen mode doesn't make presentation mode the default 963 // Test that tab fullscreen mode doesn't make presentation mode the default
964 // on Lion. 964 // on Lion.
965 ui_test_utils::WindowedNotificationObserver fullscreen_observer( 965 ui_test_utils::WindowedNotificationObserver fullscreen_observer(
966 chrome::NOTIFICATION_FULLSCREEN_CHANGED, 966 chrome::NOTIFICATION_FULLSCREEN_CHANGED,
967 content::NotificationService::AllSources()); 967 content::NotificationService::AllSources());
968 browser()->ToggleFullscreenMode(false); 968 browser()->ToggleFullscreenMode();
969 fullscreen_observer.Wait(); 969 fullscreen_observer.Wait();
970 ASSERT_TRUE(browser()->window()->IsFullscreen()); 970 ASSERT_TRUE(browser()->window()->IsFullscreen());
971 ASSERT_FALSE(browser()->window()->InPresentationMode()); 971 ASSERT_FALSE(browser()->window()->InPresentationMode());
972 } 972 }
973 } 973 }
974 #endif 974 #endif
975 975
976 // Chromeos defaults to restoring the last session, so this test isn't 976 // Chromeos defaults to restoring the last session, so this test isn't
977 // applicable. 977 // applicable.
978 #if !defined(OS_CHROMEOS) 978 #if !defined(OS_CHROMEOS)
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
1502 1502
1503 // The normal browser should now have four. 1503 // The normal browser should now have four.
1504 EXPECT_EQ(4, browser()->tab_count()); 1504 EXPECT_EQ(4, browser()->tab_count());
1505 1505
1506 // Close the additional browsers. 1506 // Close the additional browsers.
1507 popup_browser->CloseAllTabs(); 1507 popup_browser->CloseAllTabs();
1508 app_browser->CloseAllTabs(); 1508 app_browser->CloseAllTabs();
1509 app_popup_browser->CloseAllTabs(); 1509 app_popup_browser->CloseAllTabs();
1510 } 1510 }
1511 #endif 1511 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698