Implement full-screen browser-test for apps v1.

Review URL: https://codereview.chromium.org/408643002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284562 0039d316-1c4b-4281-b951-d872f2087c98
parent d85f0ac4
...@@ -16,6 +16,7 @@ class Me2MeBrowserTest : public RemoteDesktopBrowserTest { ...@@ -16,6 +16,7 @@ class Me2MeBrowserTest : public RemoteDesktopBrowserTest {
void ConnectPinlessAndCleanupPairings(bool cleanup_all); void ConnectPinlessAndCleanupPairings(bool cleanup_all);
bool IsPairingSpinnerHidden(); bool IsPairingSpinnerHidden();
bool WaitForFullscreenChange(bool expect_fullscreen);
}; };
IN_PROC_BROWSER_TEST_F(Me2MeBrowserTest, IN_PROC_BROWSER_TEST_F(Me2MeBrowserTest,
...@@ -78,6 +79,42 @@ IN_PROC_BROWSER_TEST_F(Me2MeBrowserTest, ...@@ -78,6 +79,42 @@ IN_PROC_BROWSER_TEST_F(Me2MeBrowserTest,
Cleanup(); Cleanup();
} }
IN_PROC_BROWSER_TEST_F(Me2MeBrowserTest, MANUAL_Me2Me_Fullscreen) {
VerifyInternetAccess();
Install();
LaunchChromotingApp();
// Authorize, Authenticate, and Approve.
Auth();
ExpandMe2Me();
ConnectToLocalHost(false);
// Verify that we're initially not full-screen.
EXPECT_FALSE(ExecuteScriptAndExtractBool(
"remoting.fullscreen.isActive()"));
// Click the full-screen button and verify that it activates full-screen mode.
ClickOnControl("toggle-full-screen");
EXPECT_TRUE(WaitForFullscreenChange(true));
// Click the full-screen button again and verify that it deactivates
// full-screen mode.
ClickOnControl("toggle-full-screen");
EXPECT_TRUE(WaitForFullscreenChange(false));
// Enter full-screen mode again, then disconnect and verify that full-screen
// mode is deactivated upon disconnection.
// TODO(jamiewalch): For the v2 app, activate full-screen mode indirectly by
// maximizing the window for the second test.
ClickOnControl("toggle-full-screen");
EXPECT_TRUE(WaitForFullscreenChange(true));
DisconnectMe2Me();
EXPECT_TRUE(WaitForFullscreenChange(false));
Cleanup();
}
void Me2MeBrowserTest::TestKeyboardInput() { void Me2MeBrowserTest::TestKeyboardInput() {
// We will assume here that the browser window is already open on the host // We will assume here that the browser window is already open on the host
// and in focus. // and in focus.
...@@ -162,4 +199,17 @@ bool Me2MeBrowserTest::IsPairingSpinnerHidden() { ...@@ -162,4 +199,17 @@ bool Me2MeBrowserTest::IsPairingSpinnerHidden() {
return !HtmlElementVisible("paired-client-manager-dialog-working"); return !HtmlElementVisible("paired-client-manager-dialog-working");
} }
bool Me2MeBrowserTest::WaitForFullscreenChange(bool expect_fullscreen) {
std::string javascript = expect_fullscreen ?
"remoting.fullscreen.isActive()" :
"!remoting.fullscreen.isActive()";
ConditionalTimeoutWaiter waiter(
base::TimeDelta::FromSeconds(10),
base::TimeDelta::FromMilliseconds(500),
base::Bind(&RemoteDesktopBrowserTest::IsHostActionComplete,
active_web_contents(),
javascript));
return waiter.Wait();
}
} // namespace remoting } // namespace remoting
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment