| 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 <stdint.h> |
| 6 |
| 5 #include "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
| 6 #include "chrome/test/remoting/remote_desktop_browsertest.h" | 8 #include "chrome/test/remoting/remote_desktop_browsertest.h" |
| 7 | 9 |
| 8 namespace remoting { | 10 namespace remoting { |
| 9 | 11 |
| 10 class It2MeBrowserTest : public RemoteDesktopBrowserTest { | 12 class It2MeBrowserTest : public RemoteDesktopBrowserTest { |
| 11 protected: | 13 protected: |
| 12 std::string GetAccessCode(content::WebContents* contents); | 14 std::string GetAccessCode(content::WebContents* contents); |
| 13 | 15 |
| 14 // Launches a Chromoting app instance for the helper. | 16 // Launches a Chromoting app instance for the helper. |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 } | 74 } |
| 73 | 75 |
| 74 IN_PROC_BROWSER_TEST_F(It2MeBrowserTest, MANUAL_InvalidAccessCode) { | 76 IN_PROC_BROWSER_TEST_F(It2MeBrowserTest, MANUAL_InvalidAccessCode) { |
| 75 content::WebContents* helpee_content = SetUpTest(); | 77 content::WebContents* helpee_content = SetUpTest(); |
| 76 LoadScript(helpee_content, FILE_PATH_LITERAL("it2me_browser_test.js")); | 78 LoadScript(helpee_content, FILE_PATH_LITERAL("it2me_browser_test.js")); |
| 77 | 79 |
| 78 // Generate an invalid access code by generating a valid access code and | 80 // Generate an invalid access code by generating a valid access code and |
| 79 // changing its PIN portion. | 81 // changing its PIN portion. |
| 80 std::string access_code = GetAccessCode(helpee_content); | 82 std::string access_code = GetAccessCode(helpee_content); |
| 81 | 83 |
| 82 uint64 invalid_access_code = 0; | 84 uint64_t invalid_access_code = 0; |
| 83 ASSERT_TRUE(base::StringToUint64(access_code, &invalid_access_code)); | 85 ASSERT_TRUE(base::StringToUint64(access_code, &invalid_access_code)); |
| 84 std::ostringstream invalid_access_code_string; | 86 std::ostringstream invalid_access_code_string; |
| 85 | 87 |
| 86 invalid_access_code_string << ++invalid_access_code; | 88 invalid_access_code_string << ++invalid_access_code; |
| 87 | 89 |
| 88 content::WebContents* helper_content = SetUpHelperInstance(); | 90 content::WebContents* helper_content = SetUpHelperInstance(); |
| 89 RunJavaScriptTest(helper_content, "InvalidAccessCode", "{" | 91 RunJavaScriptTest(helper_content, "InvalidAccessCode", "{" |
| 90 "accessCode: '" + invalid_access_code_string.str() + "'" | 92 "accessCode: '" + invalid_access_code_string.str() + "'" |
| 91 "}"); | 93 "}"); |
| 92 | 94 |
| 93 Cleanup(); | 95 Cleanup(); |
| 94 } | 96 } |
| 95 | 97 |
| 96 } // namespace remoting | 98 } // namespace remoting |
| OLD | NEW |