| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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/strings/string_number_conversions.h" | 5 #include "base/strings/string_number_conversions.h" |
| 6 #include "chrome/test/remoting/remote_desktop_browsertest.h" | 6 #include "chrome/test/remoting/remote_desktop_browsertest.h" |
| 7 | 7 |
| 8 namespace remoting { | 8 namespace remoting { |
| 9 | 9 |
| 10 class It2MeBrowserTest : public RemoteDesktopBrowserTest { | 10 class It2MeBrowserTest : public RemoteDesktopBrowserTest { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 LoadScript(helpee_content, FILE_PATH_LITERAL("it2me_browser_test.js")); | 35 LoadScript(helpee_content, FILE_PATH_LITERAL("it2me_browser_test.js")); |
| 36 | 36 |
| 37 content::WebContents* helper_content = SetUpHelperInstance(); | 37 content::WebContents* helper_content = SetUpHelperInstance(); |
| 38 RunJavaScriptTest(helper_content, "ConnectIt2Me", "{" | 38 RunJavaScriptTest(helper_content, "ConnectIt2Me", "{" |
| 39 "accessCode: '" + GetAccessCode(helpee_content) + "'" | 39 "accessCode: '" + GetAccessCode(helpee_content) + "'" |
| 40 "}"); | 40 "}"); |
| 41 | 41 |
| 42 Cleanup(); | 42 Cleanup(); |
| 43 } | 43 } |
| 44 | 44 |
| 45 IN_PROC_BROWSER_TEST_F(It2MeBrowserTest, MANUAL_CancelShare) { |
| 46 content::WebContents* helpee_content = SetUpTest(); |
| 47 LoadScript(helpee_content, FILE_PATH_LITERAL("it2me_browser_test.js")); |
| 48 std::string access_code = GetAccessCode(helpee_content); |
| 49 RunJavaScriptTest(helpee_content, "CancelShare", "{}"); |
| 50 |
| 51 content::WebContents* helper_content = SetUpHelperInstance(); |
| 52 RunJavaScriptTest(helper_content, "InvalidAccessCode", "{" |
| 53 "accessCode: '" + access_code + "'" |
| 54 "}"); |
| 55 Cleanup(); |
| 56 } |
| 57 |
| 58 IN_PROC_BROWSER_TEST_F(It2MeBrowserTest, MANUAL_VerifyAccessCodeNonReusable) { |
| 59 content::WebContents* helpee_content = SetUpTest(); |
| 60 LoadScript(helpee_content, FILE_PATH_LITERAL("it2me_browser_test.js")); |
| 61 std::string access_code = GetAccessCode(helpee_content); |
| 62 |
| 63 content::WebContents* helper_content = SetUpHelperInstance(); |
| 64 RunJavaScriptTest(helper_content, "ConnectIt2Me", "{" |
| 65 "accessCode: '" + access_code + "'" |
| 66 "}"); |
| 67 |
| 68 RunJavaScriptTest(helper_content, "InvalidAccessCode", "{" |
| 69 "accessCode: '" + access_code + "'" |
| 70 "}"); |
| 71 Cleanup(); |
| 72 } |
| 73 |
| 45 IN_PROC_BROWSER_TEST_F(It2MeBrowserTest, MANUAL_InvalidAccessCode) { | 74 IN_PROC_BROWSER_TEST_F(It2MeBrowserTest, MANUAL_InvalidAccessCode) { |
| 46 content::WebContents* helpee_content = SetUpTest(); | 75 content::WebContents* helpee_content = SetUpTest(); |
| 47 LoadScript(helpee_content, FILE_PATH_LITERAL("it2me_browser_test.js")); | 76 LoadScript(helpee_content, FILE_PATH_LITERAL("it2me_browser_test.js")); |
| 48 | 77 |
| 49 // Generate an invalid access code by generating a valid access code and | 78 // Generate an invalid access code by generating a valid access code and |
| 50 // changing its PIN portion. | 79 // changing its PIN portion. |
| 51 std::string access_code = GetAccessCode(helpee_content); | 80 std::string access_code = GetAccessCode(helpee_content); |
| 52 | 81 |
| 53 uint64 invalid_access_code = 0; | 82 uint64 invalid_access_code = 0; |
| 54 ASSERT_TRUE(base::StringToUint64(access_code, &invalid_access_code)); | 83 ASSERT_TRUE(base::StringToUint64(access_code, &invalid_access_code)); |
| 55 std::ostringstream invalid_access_code_string; | 84 std::ostringstream invalid_access_code_string; |
| 56 | 85 |
| 57 invalid_access_code_string << ++invalid_access_code; | 86 invalid_access_code_string << ++invalid_access_code; |
| 58 | 87 |
| 59 content::WebContents* helper_content = SetUpHelperInstance(); | 88 content::WebContents* helper_content = SetUpHelperInstance(); |
| 60 RunJavaScriptTest(helper_content, "InvalidAccessCode", "{" | 89 RunJavaScriptTest(helper_content, "InvalidAccessCode", "{" |
| 61 "accessCode: '" + invalid_access_code_string.str() + "'" | 90 "accessCode: '" + invalid_access_code_string.str() + "'" |
| 62 "}"); | 91 "}"); |
| 63 | 92 |
| 64 Cleanup(); | 93 Cleanup(); |
| 65 } | 94 } |
| 66 | 95 |
| 67 } // namespace remoting | 96 } // namespace remoting |
| OLD | NEW |