| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 | 2 |
| 3 # Copyright (c) 2010 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 import copy | 7 import copy |
| 8 import email | 8 import email |
| 9 import os | 9 import os |
| 10 import smtplib | 10 import smtplib |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 username: user log in input. | 80 username: user log in input. |
| 81 password: user log in password input. | 81 password: user log in password input. |
| 82 tab_index: The tab index, default is 0. | 82 tab_index: The tab index, default is 0. |
| 83 windex: The window index, default is 0. | 83 windex: The window index, default is 0. |
| 84 """ | 84 """ |
| 85 email_value = test.GetDOMValue('document.getElementById("Email").value', | 85 email_value = test.GetDOMValue('document.getElementById("Email").value', |
| 86 windex, tab_index) | 86 windex, tab_index) |
| 87 passwd_value = test.GetDOMValue('document.getElementById("Passwd").value', | 87 passwd_value = test.GetDOMValue('document.getElementById("Passwd").value', |
| 88 windex, tab_index) | 88 windex, tab_index) |
| 89 test.assertEqual(email_value, username) | 89 test.assertEqual(email_value, username) |
| 90 test.assertEqual(passwd_value, password) | 90 # Not using assertEqual because if it fails it would end up dumping the |
| 91 # password (which is supposed to be private) |
| 92 test.assertTrue(passwd_value == password) |
| 91 | 93 |
| 92 | 94 |
| 93 def ClearPasswords(test): | 95 def ClearPasswords(test): |
| 94 """Clear saved passwords.""" | 96 """Clear saved passwords.""" |
| 95 test.ClearBrowsingData(['PASSWORDS'], 'EVERYTHING') | 97 test.ClearBrowsingData(['PASSWORDS'], 'EVERYTHING') |
| 96 | 98 |
| 97 | 99 |
| 98 def Shell2(cmd_string, bg=False): | 100 def Shell2(cmd_string, bg=False): |
| 99 """Run a shell command. | 101 """Run a shell command. |
| 100 | 102 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 return_dict[key] = StripUnmatchedKeys(dict1[key], dict2[key]) | 192 return_dict[key] = StripUnmatchedKeys(dict1[key], dict2[key]) |
| 191 return return_dict | 193 return return_dict |
| 192 | 194 |
| 193 item_to_strip_type = type(item_to_strip) | 195 item_to_strip_type = type(item_to_strip) |
| 194 if item_to_strip_type is type(reference_item): | 196 if item_to_strip_type is type(reference_item): |
| 195 if item_to_strip_type is types.ListType: | 197 if item_to_strip_type is types.ListType: |
| 196 return StripList(item_to_strip, reference_item) | 198 return StripList(item_to_strip, reference_item) |
| 197 elif item_to_strip_type is types.DictType: | 199 elif item_to_strip_type is types.DictType: |
| 198 return StripDict(item_to_strip, reference_item) | 200 return StripDict(item_to_strip, reference_item) |
| 199 return copy.deepcopy(item_to_strip) | 201 return copy.deepcopy(item_to_strip) |
| OLD | NEW |