OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #include "base/file_util.h" |
| 6 #include "base/files/file_path.h" |
| 7 #include "chrome/test/remoting/remote_desktop_browsertest.h" |
| 8 #include "chrome/test/remoting/waiter.h" |
| 9 |
| 10 namespace remoting { |
| 11 |
| 12 class FullscreenBrowserTest : public RemoteDesktopBrowserTest { |
| 13 protected: |
| 14 bool WaitForFullscreenChange(bool expect_fullscreen); |
| 15 }; |
| 16 |
| 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(), |
| 26 javascript)); |
| 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(); |
| 32 return result; |
| 33 } |
| 34 |
| 35 IN_PROC_BROWSER_TEST_F(FullscreenBrowserTest, MANUAL_Me2Me_Fullscreen) { |
| 36 SetUpTestForMe2Me(); |
| 37 ConnectToLocalHost(false); |
| 38 |
| 39 // Verify that we're initially not full-screen. |
| 40 EXPECT_FALSE(ExecuteScriptAndExtractBool( |
| 41 "remoting.fullscreen.isActive()")); |
| 42 |
| 43 // Click the full-screen button and verify that it activates full-screen mode. |
| 44 ClickOnControl("toggle-full-screen"); |
| 45 EXPECT_TRUE(WaitForFullscreenChange(true)); |
| 46 |
| 47 // Click the full-screen button again and verify that it deactivates |
| 48 // full-screen mode. |
| 49 ClickOnControl("toggle-full-screen"); |
| 50 EXPECT_TRUE(WaitForFullscreenChange(false)); |
| 51 |
| 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)); |
| 58 DisconnectMe2Me(); |
| 59 EXPECT_TRUE(WaitForFullscreenChange(false)); |
| 60 |
| 61 Cleanup(); |
| 62 } |
| 63 |
| 64 IN_PROC_BROWSER_TEST_F(FullscreenBrowserTest, MANUAL_Me2Me_Bump_Scroll) { |
| 65 SetUpTestForMe2Me(); |
| 66 |
| 67 content::WebContents* content = app_web_content(); |
| 68 LoadScript(content, FILE_PATH_LITERAL("bump_scroll_browser_test.js")); |
| 69 |
| 70 RunJavaScriptTest(content, "Bump_Scroll", "{pin: '" + me2me_pin() + "'}"); |
| 71 |
| 72 Cleanup(); |
| 73 } |
| 74 |
| 75 } // namespace remoting |
OLD | NEW |