summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-28 23:55:41 +0000
committermattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-28 23:55:41 +0000
commitb9ef2965a07ca50fd94f1ab1d22ffcfdf62a2b6d (patch)
tree13ab349b18895143c33c8a4e207b7400f5d7cf62
parentb98def8645ad4e3239b74d8771eaa377d628212a (diff)
downloadchromium_src-b9ef2965a07ca50fd94f1ab1d22ffcfdf62a2b6d.zip
chromium_src-b9ef2965a07ca50fd94f1ab1d22ffcfdf62a2b6d.tar.gz
chromium_src-b9ef2965a07ca50fd94f1ab1d22ffcfdf62a2b6d.tar.bz2
Revert 144833 - Cleanup fullscreen_controller tests.
Toggling fullscreen and mouse lock no longer take a tab argument, but act on the active tab (as all tests already did). Comments added to several tests missing descriptions. Review URL: https://chromiumcodereview.appspot.com/10702018 TBR=scheib@chromium.org Review URL: https://chromiumcodereview.appspot.com/10693040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144839 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/ui/fullscreen_controller.cc3
-rw-r--r--chrome/browser/ui/fullscreen_controller_browsertest.cc78
-rw-r--r--chrome/browser/ui/fullscreen_controller_interactive_browsertest.cc23
-rw-r--r--chrome/browser/ui/fullscreen_controller_test.cc17
-rw-r--r--chrome/browser/ui/fullscreen_controller_test.h11
5 files changed, 74 insertions, 58 deletions
diff --git a/chrome/browser/ui/fullscreen_controller.cc b/chrome/browser/ui/fullscreen_controller.cc
index c8bdbe6..10a98f8 100644
--- a/chrome/browser/ui/fullscreen_controller.cc
+++ b/chrome/browser/ui/fullscreen_controller.cc
@@ -95,7 +95,6 @@ void FullscreenController::RequestToLockMouse(WebContents* web_contents,
bool user_gesture,
bool last_unlocked_by_target) {
DCHECK(!IsMouseLocked());
- NotifyMouseLockChange();
// Check for command line switch disabling mouse lock when not tab fullscreen.
if (CommandLine::ForCurrentProcess()->HasSwitch(
@@ -105,6 +104,8 @@ void FullscreenController::RequestToLockMouse(WebContents* web_contents,
return;
}
+ NotifyMouseLockChange();
+
// Must have a user gesture to prevent misbehaving sites from constantly
// re-locking the mouse. Exceptions are when the page has unlocked
// (i.e. not the user), or if we're in tab fullscreen (user gesture required
diff --git a/chrome/browser/ui/fullscreen_controller_browsertest.cc b/chrome/browser/ui/fullscreen_controller_browsertest.cc
index 9fca439..4d0f367 100644
--- a/chrome/browser/ui/fullscreen_controller_browsertest.cc
+++ b/chrome/browser/ui/fullscreen_controller_browsertest.cc
@@ -47,7 +47,9 @@ IN_PROC_BROWSER_TEST_F(FullscreenControllerTest,
AddTabAtIndexAndWait(
0, GURL(chrome::kAboutBlankURL), content::PAGE_TRANSITION_TYPED);
- ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreen(true));
+ WebContents* fullscreen_tab = browser()->GetActiveWebContents();
+
+ ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreen(fullscreen_tab, true));
{
FullscreenNotificationObserver fullscreen_observer;
@@ -74,8 +76,9 @@ IN_PROC_BROWSER_TEST_F(FullscreenControllerTest,
AddTabAtIndexAndWait(
0, GURL(chrome::kAboutBlankURL), content::PAGE_TRANSITION_TYPED);
- ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreen(true));
- ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreen(false));
+ WebContents* fullscreen_tab = browser()->GetActiveWebContents();
+ ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreen(fullscreen_tab, true));
+ ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreen(fullscreen_tab, false));
}
// Tests entering fullscreen and then requesting mouse lock results in
@@ -89,10 +92,12 @@ IN_PROC_BROWSER_TEST_F(FullscreenControllerTest,
AddTabAtIndexAndWait(1, GURL(chrome::kAboutBlankURL),
content::PAGE_TRANSITION_TYPED);
- ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreen(true));
+ WebContents* fullscreen_tab = browser()->GetActiveWebContents();
+
+ ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreen(fullscreen_tab, true));
// Request mouse lock and verify the bubble is waiting for user confirmation.
- RequestToLockMouse(true, false);
+ RequestToLockMouse(fullscreen_tab, true, false);
ASSERT_TRUE(IsMouseLockPermissionRequested());
// Accept mouse lock and verify bubble no longer shows confirmation buttons.
@@ -105,12 +110,13 @@ IN_PROC_BROWSER_TEST_F(FullscreenControllerTest,
void FullscreenControllerBrowserTest::TestFullscreenMouseLockContentSettings() {
GURL url = test_server()->GetURL("simple.html");
AddTabAtIndexAndWait(0, url, content::PAGE_TRANSITION_TYPED);
+ WebContents* tab = browser()->GetActiveWebContents();
// Validate that going fullscreen for a URL defaults to asking permision.
ASSERT_FALSE(IsFullscreenPermissionRequested());
- ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreen(true));
+ ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreen(tab, true));
ASSERT_TRUE(IsFullscreenPermissionRequested());
- ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreen(false));
+ ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreen(tab, false));
// Add content setting to ALLOW fullscreen.
HostContentSettingsMap* settings_map =
@@ -124,14 +130,14 @@ void FullscreenControllerBrowserTest::TestFullscreenMouseLockContentSettings() {
// Now, fullscreen should not prompt for permission.
ASSERT_FALSE(IsFullscreenPermissionRequested());
- ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreen(true));
+ ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreen(tab, true));
ASSERT_FALSE(IsFullscreenPermissionRequested());
// Leaving tab in fullscreen, now test mouse lock ALLOW:
// Validate that mouse lock defaults to asking permision.
ASSERT_FALSE(IsMouseLockPermissionRequested());
- RequestToLockMouse(true, false);
+ RequestToLockMouse(tab, true, false);
ASSERT_TRUE(IsMouseLockPermissionRequested());
LostMouseLock();
@@ -143,7 +149,7 @@ void FullscreenControllerBrowserTest::TestFullscreenMouseLockContentSettings() {
// Now, mouse lock should not prompt for permission.
ASSERT_FALSE(IsMouseLockPermissionRequested());
- RequestToLockMouse(true, false);
+ RequestToLockMouse(tab, true, false);
ASSERT_FALSE(IsMouseLockPermissionRequested());
LostMouseLock();
@@ -157,7 +163,7 @@ void FullscreenControllerBrowserTest::TestFullscreenMouseLockContentSettings() {
// Now, mouse lock should not be pending.
ASSERT_FALSE(IsMouseLockPermissionRequested());
- RequestToLockMouse(true, false);
+ RequestToLockMouse(tab, true, false);
ASSERT_FALSE(IsMouseLockPermissionRequested());
}
@@ -194,7 +200,8 @@ IN_PROC_BROWSER_TEST_F(FullscreenControllerTest, BrowserFullscreenExit) {
// Enter tab fullscreen.
AddTabAtIndexAndWait(0, GURL(chrome::kAboutBlankURL),
content::PAGE_TRANSITION_TYPED);
- ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreen(true));
+ WebContents* fullscreen_tab = browser()->GetActiveWebContents();
+ ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreen(fullscreen_tab, true));
// Exit browser fullscreen.
ASSERT_NO_FATAL_FAILURE(ToggleBrowserFullscreen(false));
@@ -210,8 +217,9 @@ IN_PROC_BROWSER_TEST_F(FullscreenControllerTest,
// Enter and then exit tab fullscreen.
AddTabAtIndexAndWait(0, GURL(chrome::kAboutBlankURL),
content::PAGE_TRANSITION_TYPED);
- ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreen(true));
- ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreen(false));
+ WebContents* fullscreen_tab = browser()->GetActiveWebContents();
+ ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreen(fullscreen_tab, true));
+ ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreen(fullscreen_tab, false));
// Verify browser fullscreen still active.
ASSERT_TRUE(IsFullscreenForBrowser());
@@ -222,45 +230,44 @@ IN_PROC_BROWSER_TEST_F(FullscreenControllerTest, FullscreenFileURL) {
ui_test_utils::NavigateToURL(browser(),
ui_test_utils::GetTestUrl(FilePath(FilePath::kCurrentDirectory),
FilePath(kSimpleFile)));
+ WebContents* tab = browser()->GetActiveWebContents();
// Validate that going fullscreen for a file does not ask permision.
ASSERT_FALSE(IsFullscreenPermissionRequested());
- ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreen(true));
+ ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreen(tab, true));
ASSERT_FALSE(IsFullscreenPermissionRequested());
- ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreen(false));
+ ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreen(tab, false));
}
-// Tests fullscreen is exited on page navigation.
-// (Similar to mouse lock version in FullscreenControllerInteractiveTest)
IN_PROC_BROWSER_TEST_F(FullscreenControllerTest,
TestTabExitsFullscreenOnNavigation) {
ASSERT_TRUE(test_server()->Start());
+ WebContents* fullscreen_tab = browser()->GetActiveWebContents();
+
ui_test_utils::NavigateToURL(browser(), GURL("about:blank"));
- ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreen(true));
+ ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreen(fullscreen_tab, true));
ui_test_utils::NavigateToURL(browser(), GURL("chrome://newtab"));
ASSERT_FALSE(browser()->window()->IsFullscreen());
}
-// Tests fullscreen is exited when navigating back.
-// (Similar to mouse lock version in FullscreenControllerInteractiveTest)
IN_PROC_BROWSER_TEST_F(FullscreenControllerTest,
TestTabExitsFullscreenOnGoBack) {
ASSERT_TRUE(test_server()->Start());
+ WebContents* fullscreen_tab = browser()->GetActiveWebContents();
+
ui_test_utils::NavigateToURL(browser(), GURL("about:blank"));
ui_test_utils::NavigateToURL(browser(), GURL("chrome://newtab"));
- ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreen(true));
+ ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreen(fullscreen_tab, true));
GoBack();
ASSERT_FALSE(browser()->window()->IsFullscreen());
}
-// Tests fullscreen is not exited on sub frame navigation.
-// (Similar to mouse lock version in FullscreenControllerInteractiveTest)
IN_PROC_BROWSER_TEST_F(FullscreenControllerTest,
TestTabDoesntExitFullscreenOnSubFrameNavigation) {
ASSERT_TRUE(test_server()->Start());
@@ -268,14 +275,14 @@ IN_PROC_BROWSER_TEST_F(FullscreenControllerTest,
GURL url(ui_test_utils::GetTestUrl(FilePath(FilePath::kCurrentDirectory),
FilePath(kSimpleFile)));
GURL url_with_fragment(url.spec() + "#fragment");
+ WebContents* fullscreen_tab = browser()->GetActiveWebContents();
ui_test_utils::NavigateToURL(browser(), url);
- ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreen(true));
+ ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreen(fullscreen_tab, true));
ui_test_utils::NavigateToURL(browser(), url_with_fragment);
ASSERT_TRUE(IsFullscreenForTabOrPending());
}
-// Tests tab fullscreen exits, but browser fullscreen remains, on navigation.
IN_PROC_BROWSER_TEST_F(FullscreenControllerTest,
TestFullscreenFromTabWhenAlreadyInBrowserFullscreenWorks) {
ASSERT_TRUE(test_server()->Start());
@@ -283,8 +290,10 @@ IN_PROC_BROWSER_TEST_F(FullscreenControllerTest,
ui_test_utils::NavigateToURL(browser(), GURL("about:blank"));
ui_test_utils::NavigateToURL(browser(), GURL("chrome://newtab"));
+ WebContents* fullscreen_tab = browser()->GetActiveWebContents();
+
ASSERT_NO_FATAL_FAILURE(ToggleBrowserFullscreen(true));
- ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreen(true));
+ ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreen(fullscreen_tab, true));
GoBack();
@@ -301,11 +310,13 @@ IN_PROC_BROWSER_TEST_F(
AddTabAtIndexAndWait(
0, GURL(chrome::kAboutBlankURL), content::PAGE_TRANSITION_TYPED);
+ WebContents* fullscreen_tab = browser()->GetActiveWebContents();
+
{
FullscreenNotificationObserver fullscreen_observer;
EXPECT_FALSE(browser()->window()->IsFullscreen());
EXPECT_FALSE(browser()->window()->InPresentationMode());
- browser()->ToggleFullscreenModeForTab(tab, true);
+ browser()->ToggleFullscreenModeForTab(fullscreen_tab, true);
fullscreen_observer.Wait();
ASSERT_TRUE(browser()->window()->IsFullscreen());
ASSERT_TRUE(browser()->window()->InPresentationMode());
@@ -335,19 +346,20 @@ IN_PROC_BROWSER_TEST_F(FullscreenControllerTest,
PendingMouseLockExitsOnTabSwitch) {
AddTabAtIndexAndWait(0, GURL(chrome::kAboutBlankURL),
content::PAGE_TRANSITION_TYPED);
+ WebContents* tab2 = browser()->GetActiveWebContents();
AddTabAtIndexAndWait(0, GURL(chrome::kAboutBlankURL),
content::PAGE_TRANSITION_TYPED);
WebContents* tab1 = browser()->GetActiveWebContents();
// Request mouse lock. Bubble is displayed.
- RequestToLockMouse(true, false);
+ RequestToLockMouse(tab1, true, false);
ASSERT_TRUE(IsFullscreenBubbleDisplayed());
// Activate current tab. Mouse lock bubble remains.
browser()->ActivateTabAt(0, true);
ASSERT_TRUE(IsFullscreenBubbleDisplayed());
- // Activate second tab. Mouse lock bubble clears.
+ // Activate tab2. Mouse lock bubble clears.
{
MouseLockNotificationObserver mouse_lock_observer;
browser()->ActivateTabAt(1, true);
@@ -358,10 +370,10 @@ IN_PROC_BROWSER_TEST_F(FullscreenControllerTest,
// Now, test that closing an unrelated tab does not disturb a request.
// Request mouse lock. Bubble is displayed.
- RequestToLockMouse(true, false);
+ RequestToLockMouse(tab2, true, false);
ASSERT_TRUE(IsFullscreenBubbleDisplayed());
- // Close first tab while second active. Mouse lock bubble remains.
+ // Close tab1. Mouse lock bubble remains.
browser()->CloseTabContents(tab1);
ASSERT_TRUE(IsFullscreenBubbleDisplayed());
}
@@ -375,7 +387,7 @@ IN_PROC_BROWSER_TEST_F(FullscreenControllerTest,
content::PAGE_TRANSITION_TYPED);
// Request mouse lock. Bubble is displayed.
- RequestToLockMouse(true, false);
+ RequestToLockMouse(browser()->GetActiveWebContents(), true, false);
ASSERT_TRUE(IsFullscreenBubbleDisplayed());
// Close tab. Bubble is cleared.
diff --git a/chrome/browser/ui/fullscreen_controller_interactive_browsertest.cc b/chrome/browser/ui/fullscreen_controller_interactive_browsertest.cc
index 3f4249a..9ad9981 100644
--- a/chrome/browser/ui/fullscreen_controller_interactive_browsertest.cc
+++ b/chrome/browser/ui/fullscreen_controller_interactive_browsertest.cc
@@ -145,6 +145,8 @@ IN_PROC_BROWSER_TEST_F(FullscreenControllerInteractiveTest,
ui_test_utils::NavigateToURL(browser(),
test_server()->GetURL(kFullscreenMouseLockHTML));
+ WebContents* tab = browser()->GetActiveWebContents();
+
ASSERT_FALSE(IsFullscreenBubbleDisplayed());
// Lock the mouse without a user gesture, expect no response.
@@ -171,7 +173,7 @@ IN_PROC_BROWSER_TEST_F(FullscreenControllerInteractiveTest,
ASSERT_FALSE(IsFullscreenBubbleDisplayingButtons());
// Enter fullscreen mode, mouse lock should be dropped to present buttons.
- ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreen(true));
+ ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreen(tab, true));
ASSERT_TRUE(IsFullscreenPermissionRequested());
ASSERT_FALSE(IsMouseLockPermissionRequested());
ASSERT_FALSE(IsMouseLocked());
@@ -248,8 +250,6 @@ IN_PROC_BROWSER_TEST_F(FullscreenControllerInteractiveTest,
ASSERT_FALSE(IsFullscreenPermissionRequested());
}
-// Tests mouse lock can be exited and re-entered by an application silently
-// with no UI distraction for users.
IN_PROC_BROWSER_TEST_F(FullscreenControllerInteractiveTest,
MouseLockSilentAfterTargetUnlock) {
ASSERT_TRUE(test_server()->Start());
@@ -272,7 +272,7 @@ IN_PROC_BROWSER_TEST_F(FullscreenControllerInteractiveTest,
ASSERT_TRUE(IsMouseLocked());
ASSERT_TRUE(IsFullscreenBubbleDisplayed());
- // Unlock the mouse from target, make sure it's unlocked.
+ // Unlock the mouse from target, make sure it's unloacked
ASSERT_TRUE(ui_test_utils::SendKeyPressAndWait(
browser(), ui::VKEY_U, false, false, false, false,
chrome::NOTIFICATION_MOUSE_LOCK_CHANGED,
@@ -280,7 +280,7 @@ IN_PROC_BROWSER_TEST_F(FullscreenControllerInteractiveTest,
ASSERT_FALSE(IsMouseLocked());
ASSERT_FALSE(IsFullscreenBubbleDisplayed());
- // Lock mouse again, make sure it works with no bubble.
+ // Lock mouse again, make sure it works with no bubble
ASSERT_TRUE(ui_test_utils::SendKeyPressAndWait(
browser(), ui::VKEY_1, false, false, false, false,
chrome::NOTIFICATION_MOUSE_LOCK_CHANGED,
@@ -288,14 +288,14 @@ IN_PROC_BROWSER_TEST_F(FullscreenControllerInteractiveTest,
ASSERT_TRUE(IsMouseLocked());
ASSERT_FALSE(IsFullscreenBubbleDisplayed());
- // Unlock the mouse again by target.
+ // Unlock the mouse again by target
ASSERT_TRUE(ui_test_utils::SendKeyPressAndWait(
browser(), ui::VKEY_U, false, false, false, false,
chrome::NOTIFICATION_MOUSE_LOCK_CHANGED,
content::NotificationService::AllSources()));
ASSERT_FALSE(IsMouseLocked());
- // Lock from target, not user gesture, make sure it works.
+ // Lock from target, not user gesture, make sure it works
ASSERT_TRUE(ui_test_utils::SendKeyPressAndWait(
browser(), ui::VKEY_D, false, false, false, false,
chrome::NOTIFICATION_MOUSE_LOCK_CHANGED,
@@ -303,14 +303,14 @@ IN_PROC_BROWSER_TEST_F(FullscreenControllerInteractiveTest,
ASSERT_TRUE(IsMouseLocked());
ASSERT_FALSE(IsFullscreenBubbleDisplayed());
- // Unlock by escape.
+ // Unlock by escape
ASSERT_TRUE(ui_test_utils::SendKeyPressAndWait(
browser(), ui::VKEY_ESCAPE, false, false, false, false,
chrome::NOTIFICATION_MOUSE_LOCK_CHANGED,
content::NotificationService::AllSources()));
ASSERT_FALSE(IsMouseLocked());
- // Lock the mouse with a user gesture, make sure we see bubble again.
+ // Lock the mouse with a user gesture, make sure we see bubble again
ASSERT_TRUE(ui_test_utils::SendKeyPressAndWait(
browser(), ui::VKEY_1, false, false, false, false,
chrome::NOTIFICATION_MOUSE_LOCK_CHANGED,
@@ -485,10 +485,11 @@ IN_PROC_BROWSER_TEST_F(FullscreenControllerInteractiveTest,
GURL url = test_server()->GetURL("simple.html");
AddTabAtIndexAndWait(0, url, content::PAGE_TRANSITION_TYPED);
+ WebContents* tab = browser()->GetActiveWebContents();
// Validate that going fullscreen for a URL defaults to asking permision.
ASSERT_FALSE(IsFullscreenPermissionRequested());
- ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreenNoRetries(true));
+ ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreenNoRetries(tab, true));
ASSERT_TRUE(IsFullscreenPermissionRequested());
- ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreenNoRetries(false));
+ ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreenNoRetries(tab, false));
}
diff --git a/chrome/browser/ui/fullscreen_controller_test.cc b/chrome/browser/ui/fullscreen_controller_test.cc
index 93829ac..fc198e2 100644
--- a/chrome/browser/ui/fullscreen_controller_test.cc
+++ b/chrome/browser/ui/fullscreen_controller_test.cc
@@ -23,8 +23,9 @@ void FullscreenControllerTest::SetUpCommandLine(CommandLine* command_line) {
command_line->AppendSwitch(switches::kEnablePointerLock);
}
-void FullscreenControllerTest::ToggleTabFullscreen(bool enter_fullscreen) {
- ToggleTabFullscreen_Internal(enter_fullscreen, true);
+void FullscreenControllerTest::ToggleTabFullscreen(WebContents* tab,
+ bool enter_fullscreen) {
+ ToggleTabFullscreenInternal(tab, enter_fullscreen, true);
}
// |ToggleTabFullscreen| should not need to tolerate the transition failing.
@@ -36,8 +37,8 @@ void FullscreenControllerTest::ToggleTabFullscreen(bool enter_fullscreen) {
// allows a fullscreen_controller_interactive_browsertest.cc test to verify
// that when running serially there is no flakiness in the transition.
void FullscreenControllerTest::ToggleTabFullscreenNoRetries(
- bool enter_fullscreen) {
- ToggleTabFullscreen_Internal(enter_fullscreen, false);
+ WebContents* tab, bool enter_fullscreen) {
+ ToggleTabFullscreenInternal(tab, enter_fullscreen, false);
}
void FullscreenControllerTest::ToggleBrowserFullscreen(bool enter_fullscreen) {
@@ -51,10 +52,9 @@ void FullscreenControllerTest::ToggleBrowserFullscreen(bool enter_fullscreen) {
ASSERT_EQ(IsFullscreenForBrowser(), enter_fullscreen);
}
-void FullscreenControllerTest::RequestToLockMouse(
+void FullscreenControllerTest::RequestToLockMouse(WebContents* tab,
bool user_gesture,
bool last_unlocked_by_target) {
- WebContents* tab = browser()->GetActiveWebContents();
browser()->RequestToLockMouse(tab, user_gesture,
last_unlocked_by_target);
}
@@ -149,9 +149,8 @@ void FullscreenControllerTest::Reload() {
observer.Wait();
}
-void FullscreenControllerTest::ToggleTabFullscreen_Internal(
- bool enter_fullscreen, bool retry_until_success) {
- WebContents* tab = browser()->GetActiveWebContents();
+void FullscreenControllerTest::ToggleTabFullscreenInternal(
+ WebContents* tab, bool enter_fullscreen, bool retry_until_success) {
if (IsFullscreenForBrowser()) {
// Changing tab fullscreen state will not actually change the window
// when browser fullscreen is in effect.
diff --git a/chrome/browser/ui/fullscreen_controller_test.h b/chrome/browser/ui/fullscreen_controller_test.h
index e5d665c..c2f7bd8 100644
--- a/chrome/browser/ui/fullscreen_controller_test.h
+++ b/chrome/browser/ui/fullscreen_controller_test.h
@@ -39,10 +39,12 @@ class FullscreenControllerTest : public InProcessBrowserTest {
FullscreenControllerTest() {}
virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE;
- void ToggleTabFullscreen(bool enter_fullscreen);
- void ToggleTabFullscreenNoRetries(bool enter_fullscreen);
+ void ToggleTabFullscreen(content::WebContents* tab, bool enter_fullscreen);
+ void ToggleTabFullscreenNoRetries(content::WebContents* tab,
+ bool enter_fullscreen);
void ToggleBrowserFullscreen(bool enter_fullscreen);
- void RequestToLockMouse(bool user_gesture,
+ void RequestToLockMouse(content::WebContents* tab,
+ bool user_gesture,
bool last_unlocked_by_target);
void LostMouseLock();
bool SendEscapeToFullscreenController();
@@ -61,7 +63,8 @@ class FullscreenControllerTest : public InProcessBrowserTest {
void Reload();
static const char kFullscreenMouseLockHTML[];
private:
- void ToggleTabFullscreen_Internal(bool enter_fullscreen,
+ void ToggleTabFullscreenInternal(content::WebContents* tab,
+ bool enter_fullscreen,
bool retry_until_success);
DISALLOW_COPY_AND_ASSIGN(FullscreenControllerTest);
};