| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """PyAuto: Python Interface to Chromium's Automation Proxy. | 6 """PyAuto: Python Interface to Chromium's Automation Proxy. |
| 7 | 7 |
| 8 PyAuto uses swig to expose Automation Proxy interfaces to Python. | 8 PyAuto uses swig to expose Automation Proxy interfaces to Python. |
| 9 For complete documentation on the functionality available, | 9 For complete documentation on the functionality available, |
| 10 run pydoc on this file. | 10 run pydoc on this file. |
| (...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 for item in os.listdir(chronos_dir): | 435 for item in os.listdir(chronos_dir): |
| 436 if item != 'user' and not item.startswith('.'): | 436 if item != 'user' and not item.startswith('.'): |
| 437 pyauto_utils.RemovePath(os.path.join(chronos_dir, item)) | 437 pyauto_utils.RemovePath(os.path.join(chronos_dir, item)) |
| 438 | 438 |
| 439 @staticmethod | 439 @staticmethod |
| 440 def CleanupFlimflamDirsOnChromeOS(): | 440 def CleanupFlimflamDirsOnChromeOS(): |
| 441 """Clean the contents of flimflam profiles and restart flimflam.""" | 441 """Clean the contents of flimflam profiles and restart flimflam.""" |
| 442 PyUITest.RunSuperuserActionOnChromeOS('CleanFlimflamDirs') | 442 PyUITest.RunSuperuserActionOnChromeOS('CleanFlimflamDirs') |
| 443 | 443 |
| 444 @staticmethod | 444 @staticmethod |
| 445 def RemoveAllCryptohomeVaultsOnChromeOS(): |
| 446 """Remove any existing cryptohome vaults.""" |
| 447 PyUITest.RunSuperuserActionOnChromeOS('RemoveAllCryptohomeVaults') |
| 448 |
| 449 @staticmethod |
| 445 def _IsInodeNew(path, old_inode): | 450 def _IsInodeNew(path, old_inode): |
| 446 """Determine whether an inode has changed. POSIX only. | 451 """Determine whether an inode has changed. POSIX only. |
| 447 | 452 |
| 448 Args: | 453 Args: |
| 449 path: The file path to check for changes. | 454 path: The file path to check for changes. |
| 450 old_inode: The old inode number. | 455 old_inode: The old inode number. |
| 451 | 456 |
| 452 Returns: | 457 Returns: |
| 453 True if the path exists and its inode number is different from old_inode. | 458 True if the path exists and its inode number is different from old_inode. |
| 454 False otherwise. | 459 False otherwise. |
| (...skipping 4791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5246 successful = result.wasSuccessful() | 5251 successful = result.wasSuccessful() |
| 5247 if not successful: | 5252 if not successful: |
| 5248 pyauto_tests_file = os.path.join(self.TestsDir(), self._tests_filename) | 5253 pyauto_tests_file = os.path.join(self.TestsDir(), self._tests_filename) |
| 5249 print >>sys.stderr, 'Tests can be disabled by editing %s. ' \ | 5254 print >>sys.stderr, 'Tests can be disabled by editing %s. ' \ |
| 5250 'Ref: %s' % (pyauto_tests_file, _PYAUTO_DOC_URL) | 5255 'Ref: %s' % (pyauto_tests_file, _PYAUTO_DOC_URL) |
| 5251 sys.exit(not successful) | 5256 sys.exit(not successful) |
| 5252 | 5257 |
| 5253 | 5258 |
| 5254 if __name__ == '__main__': | 5259 if __name__ == '__main__': |
| 5255 Main() | 5260 Main() |
| OLD | NEW |