| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 import copy | 5 import copy |
| 6 import ctypes | 6 import ctypes |
| 7 import email | 7 import email |
| 8 import logging | 8 import logging |
| 9 import os | 9 import os |
| 10 import platform | 10 import platform |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 email_value = test.GetDOMValue('document.getElementById("Email").value', | 128 email_value = test.GetDOMValue('document.getElementById("Email").value', |
| 129 tab_index, windex) | 129 tab_index, windex) |
| 130 passwd_value = test.GetDOMValue('document.getElementById("Passwd").value', | 130 passwd_value = test.GetDOMValue('document.getElementById("Passwd").value', |
| 131 tab_index, windex) | 131 tab_index, windex) |
| 132 test.assertEqual(email_value, username) | 132 test.assertEqual(email_value, username) |
| 133 # Not using assertEqual because if it fails it would end up dumping the | 133 # Not using assertEqual because if it fails it would end up dumping the |
| 134 # password (which is supposed to be private) | 134 # password (which is supposed to be private) |
| 135 test.assertTrue(passwd_value == password) | 135 test.assertTrue(passwd_value == password) |
| 136 | 136 |
| 137 | 137 |
| 138 def ClearPasswords(test): | |
| 139 """Clear saved passwords.""" | |
| 140 test.ClearBrowsingData(['PASSWORDS'], 'EVERYTHING') | |
| 141 | |
| 142 | |
| 143 def Shell2(cmd_string, bg=False): | 138 def Shell2(cmd_string, bg=False): |
| 144 """Run a shell command. | 139 """Run a shell command. |
| 145 | 140 |
| 146 Args: | 141 Args: |
| 147 cmd_string: command to run | 142 cmd_string: command to run |
| 148 bg: should the process be run in background? Default: False | 143 bg: should the process be run in background? Default: False |
| 149 | 144 |
| 150 Returns: | 145 Returns: |
| 151 Output, return code | 146 Output, return code |
| 152 """ | 147 """ |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 """This test opens crosh. | 450 """This test opens crosh. |
| 456 | 451 |
| 457 This function assumes that no browser windows are open. | 452 This function assumes that no browser windows are open. |
| 458 """ | 453 """ |
| 459 self.assertEqual(0, self.GetBrowserWindowCount()) | 454 self.assertEqual(0, self.GetBrowserWindowCount()) |
| 460 self.OpenCrosh() | 455 self.OpenCrosh() |
| 461 self.assertEqual(1, self.GetBrowserWindowCount()) | 456 self.assertEqual(1, self.GetBrowserWindowCount()) |
| 462 self.assertEqual(1, self.GetTabCount(), | 457 self.assertEqual(1, self.GetTabCount(), |
| 463 msg='Could not open crosh') | 458 msg='Could not open crosh') |
| 464 self.assertEqual('crosh', self.GetActiveTabTitle()) | 459 self.assertEqual('crosh', self.GetActiveTabTitle()) |
| OLD | NEW |