1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "base/files/file_path.h"
6 #include "base/files/file_util.h"
7 #include "chrome/test/remoting/remote_desktop_browsertest.h"
8 #include "chrome/test/remoting/waiter.h"
12 class FullscreenBrowserTest
: public RemoteDesktopBrowserTest
{
14 bool WaitForFullscreenChange(bool expect_fullscreen
);
17 bool FullscreenBrowserTest::WaitForFullscreenChange(bool expect_fullscreen
) {
18 std::string javascript
= expect_fullscreen
?
19 "remoting.fullscreen.isActive()" :
20 "!remoting.fullscreen.isActive()";
21 ConditionalTimeoutWaiter
waiter(
22 base::TimeDelta::FromSeconds(20),
23 base::TimeDelta::FromSeconds(1),
24 base::Bind(&RemoteDesktopBrowserTest::IsHostActionComplete
,
25 active_web_contents(),
27 bool result
= waiter
.Wait();
28 // Entering or leaving full-screen mode causes local and remote desktop
29 // reconfigurations that can take a while to settle down, so wait a few
30 // seconds before continuing.
31 TimeoutWaiter(base::TimeDelta::FromSeconds(10)).Wait();
35 IN_PROC_BROWSER_TEST_F(FullscreenBrowserTest
, MANUAL_Me2Me_Fullscreen
) {
37 ConnectToLocalHost(false);
39 // Verify that we're initially not full-screen.
40 EXPECT_FALSE(ExecuteScriptAndExtractBool(
41 "remoting.fullscreen.isActive()"));
43 // Click the full-screen button and verify that it activates full-screen mode.
44 ClickOnControl("toggle-full-screen");
45 EXPECT_TRUE(WaitForFullscreenChange(true));
47 // Click the full-screen button again and verify that it deactivates
49 ClickOnControl("toggle-full-screen");
50 EXPECT_TRUE(WaitForFullscreenChange(false));
52 // Enter full-screen mode again, then disconnect and verify that full-screen
53 // mode is deactivated upon disconnection.
54 // TODO(jamiewalch): For the v2 app, activate full-screen mode indirectly by
55 // maximizing the window for the second test.
56 ClickOnControl("toggle-full-screen");
57 EXPECT_TRUE(WaitForFullscreenChange(true));
59 EXPECT_TRUE(WaitForFullscreenChange(false));
64 IN_PROC_BROWSER_TEST_F(FullscreenBrowserTest
, MANUAL_Me2Me_Bump_Scroll
) {
67 content::WebContents
* content
= app_web_content();
68 LoadScript(content
, FILE_PATH_LITERAL("bump_scroll_browser_test.js"));
70 RunJavaScriptTest(content
, "Bump_Scroll", "{pin: '" + me2me_pin() + "'}");
75 } // namespace remoting