| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "base/files/file_path.h" | 5 #include "base/files/file_path.h" |
| 6 #include "base/files/file_util.h" | 6 #include "base/files/file_util.h" |
| 7 #include "chrome/browser/ui/browser_window.h" | 7 #include "chrome/browser/ui/browser_window.h" |
| 8 #include "chrome/test/remoting/key_code_test_map.h" | 8 #include "chrome/test/remoting/key_code_test_map.h" |
| 9 #include "chrome/test/remoting/remote_desktop_browsertest.h" | 9 #include "chrome/test/remoting/remote_desktop_browsertest.h" |
| 10 #include "chrome/test/remoting/remote_test_helper.h" | 10 #include "chrome/test/remoting/remote_test_helper.h" |
| 11 #include "chrome/test/remoting/waiter.h" | 11 #include "chrome/test/remoting/waiter.h" |
| 12 #include "extensions/browser/app_window/app_window.h" | 12 #include "extensions/browser/app_window/app_window.h" |
| 13 | 13 |
| 14 namespace remoting { | 14 namespace remoting { |
| 15 | 15 |
| 16 class Me2MeBrowserTest : public RemoteDesktopBrowserTest { | 16 class Me2MeBrowserTest : public RemoteDesktopBrowserTest { |
| 17 protected: | 17 protected: |
| 18 void TestKeypressInput(ui::KeyboardCode, const char*); | 18 void TestKeypressInput(ui::KeyboardCode, const char*); |
| 19 | 19 |
| 20 void ConnectPinlessAndCleanupPairings(bool cleanup_all); | 20 void ConnectPinlessAndCleanupPairings(bool cleanup_all); |
| 21 bool IsPairingSpinnerHidden(); | 21 bool IsPairingSpinnerHidden(); |
| 22 void SetupForRemoteHostTest(); | 22 void SetupForRemoteHostTest(); |
| 23 | 23 |
| 24 void RestoreApp(); | 24 void RestoreApp(); |
| 25 void MinimizeApp(); | 25 void MinimizeApp(); |
| 26 }; | 26 }; |
| 27 | 27 |
| 28 IN_PROC_BROWSER_TEST_F(Me2MeBrowserTest, | 28 IN_PROC_BROWSER_TEST_F(Me2MeBrowserTest, |
| 29 MANUAL_Me2Me_Connect_Local_Host) { | 29 MANUAL_Me2Me_Connect_Local_Host) { |
| 30 SetUpTestForMe2Me(); | 30 SetUpTest(); |
| 31 | 31 |
| 32 ConnectToLocalHost(false); | 32 ConnectToLocalHost(false); |
| 33 | 33 |
| 34 // TODO(chaitali): Change the mouse input test to also work in the | 34 // TODO(chaitali): Change the mouse input test to also work in the |
| 35 // HTTP server framework | 35 // HTTP server framework |
| 36 // TestMouseInput(); | 36 // TestMouseInput(); |
| 37 | 37 |
| 38 DisconnectMe2Me(); | 38 DisconnectMe2Me(); |
| 39 Cleanup(); | 39 Cleanup(); |
| 40 } | 40 } |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 for (int i = 0; i < length; i++) { | 110 for (int i = 0; i < length; i++) { |
| 111 KeyCodeTestMap key = test_numpad_map[i]; | 111 KeyCodeTestMap key = test_numpad_map[i]; |
| 112 TestKeypressInput(key.vkey_code, key.code); | 112 TestKeypressInput(key.vkey_code, key.code); |
| 113 } | 113 } |
| 114 DisconnectMe2Me(); | 114 DisconnectMe2Me(); |
| 115 Cleanup(); | 115 Cleanup(); |
| 116 } | 116 } |
| 117 | 117 |
| 118 IN_PROC_BROWSER_TEST_F(Me2MeBrowserTest, | 118 IN_PROC_BROWSER_TEST_F(Me2MeBrowserTest, |
| 119 MANUAL_Me2Me_Connect_Pinless) { | 119 MANUAL_Me2Me_Connect_Pinless) { |
| 120 SetUpTestForMe2Me(); | 120 SetUpTest(); |
| 121 | 121 |
| 122 ASSERT_FALSE(HtmlElementVisible("paired-client-manager-message")) | 122 ASSERT_FALSE(HtmlElementVisible("paired-client-manager-message")) |
| 123 << "The host must have no pairings before running the pinless test."; | 123 << "The host must have no pairings before running the pinless test."; |
| 124 | 124 |
| 125 // Test that cleanup works with either the Delete or Delete all buttons. | 125 // Test that cleanup works with either the Delete or Delete all buttons. |
| 126 ConnectPinlessAndCleanupPairings(false); | 126 ConnectPinlessAndCleanupPairings(false); |
| 127 ConnectPinlessAndCleanupPairings(true); | 127 ConnectPinlessAndCleanupPairings(true); |
| 128 | 128 |
| 129 Cleanup(); | 129 Cleanup(); |
| 130 } | 130 } |
| 131 | 131 |
| 132 IN_PROC_BROWSER_TEST_F(Me2MeBrowserTest, | 132 IN_PROC_BROWSER_TEST_F(Me2MeBrowserTest, |
| 133 MANUAL_Me2Me_v2_Alive_OnLostFocus) { | 133 MANUAL_Me2Me_v2_Alive_OnLostFocus) { |
| 134 SetUpTestForMe2Me(); | 134 SetUpTest(); |
| 135 | 135 |
| 136 // Connect to host. | 136 // Connect to host. |
| 137 ConnectToLocalHost(false); | 137 ConnectToLocalHost(false); |
| 138 | 138 |
| 139 // Minimize the window | 139 // Minimize the window |
| 140 MinimizeApp(); | 140 MinimizeApp(); |
| 141 | 141 |
| 142 // Wait for a few seconds for app to process any notifications it | 142 // Wait for a few seconds for app to process any notifications it |
| 143 // would have got from minimizing. | 143 // would have got from minimizing. |
| 144 ASSERT_TRUE(TimeoutWaiter(base::TimeDelta::FromSeconds(4)).Wait()); | 144 ASSERT_TRUE(TimeoutWaiter(base::TimeDelta::FromSeconds(4)).Wait()); |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 void Me2MeBrowserTest::RestoreApp() { | 243 void Me2MeBrowserTest::RestoreApp() { |
| 244 extensions::AppWindow* appWindow = GetFirstAppWindow(); | 244 extensions::AppWindow* appWindow = GetFirstAppWindow(); |
| 245 if (appWindow) { | 245 if (appWindow) { |
| 246 appWindow->Restore(); | 246 appWindow->Restore(); |
| 247 } else { | 247 } else { |
| 248 browser()->window()->Restore(); | 248 browser()->window()->Restore(); |
| 249 } | 249 } |
| 250 } | 250 } |
| 251 | 251 |
| 252 } // namespace remoting | 252 } // namespace remoting |
| OLD | NEW |