| 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) 2011 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 logging | 9 import logging |
| 10 import os | 10 import os |
| 11 import smtplib | 11 import smtplib |
| 12 import types | 12 import types |
| 13 | 13 |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 | 210 |
| 211 Args: | 211 Args: |
| 212 content_string: string to search for within content | 212 content_string: string to search for within content |
| 213 have_list: list of strings found within content | 213 have_list: list of strings found within content |
| 214 nothave_list: list of strings not found within content | 214 nothave_list: list of strings not found within content |
| 215 """ | 215 """ |
| 216 for s in have_list: | 216 for s in have_list: |
| 217 test.assertTrue(s in content_string, s) | 217 test.assertTrue(s in content_string, s) |
| 218 for s in nothave_list: | 218 for s in nothave_list: |
| 219 test.assertTrue(s not in content_string) | 219 test.assertTrue(s not in content_string) |
| 220 | |
| 221 | |
| 222 def CallFunctionWithNewTimeout(self, new_timeout, function): | |
| 223 """Sets the timeout to |new_timeout| and calls |function|. | |
| 224 | |
| 225 This method resets the timeout before returning. | |
| 226 """ | |
| 227 timeout_changer = pyauto.PyUITest.CmdExecutionTimeoutChanger( | |
| 228 self, new_timeout) | |
| 229 logging.info('Automation execution timeout has been changed to %d. ' | |
| 230 'If the timeout is large the test might appear to hang.' | |
| 231 % new_timeout) | |
| 232 function() | |
| 233 del timeout_changer | |
| OLD | NEW |