| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 | 2 |
| 3 # Copyright (c) 2011 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 """PyAuto: Python Interface to Chromium's Automation Proxy. | 7 """PyAuto: Python Interface to Chromium's Automation Proxy. |
| 8 | 8 |
| 9 PyAuto uses swig to expose Automation Proxy interfaces to Python. | 9 PyAuto uses swig to expose Automation Proxy interfaces to Python. |
| 10 For complete documentation on the functionality available, | 10 For complete documentation on the functionality available, |
| (...skipping 1031 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1042 'windex': windex, | 1042 'windex': windex, |
| 1043 'tab_index': tab_index, | 1043 'tab_index': tab_index, |
| 1044 } | 1044 } |
| 1045 # Sending request for a char. | 1045 # Sending request for a char. |
| 1046 self._GetResultFromJSONRequest(cmd_dict, windex=-1) | 1046 self._GetResultFromJSONRequest(cmd_dict, windex=-1) |
| 1047 | 1047 |
| 1048 def WaitForAllDownloadsToComplete(self, windex=0, timeout=-1): | 1048 def WaitForAllDownloadsToComplete(self, windex=0, timeout=-1): |
| 1049 """Wait for all downloads to complete. | 1049 """Wait for all downloads to complete. |
| 1050 | 1050 |
| 1051 Note: This method does not work for dangerous downloads. Use | 1051 Note: This method does not work for dangerous downloads. Use |
| 1052 WaitForGivenDownloadsToComplete (below) instead. | 1052 WaitForDownloadToComplete (below) instead. |
| 1053 """ | 1053 """ |
| 1054 cmd_dict = {'command': 'WaitForAllDownloadsToComplete'} | 1054 cmd_dict = {'command': 'WaitForAllDownloadsToComplete'} |
| 1055 self._GetResultFromJSONRequest(cmd_dict, windex=windex, timeout=timeout) | 1055 self._GetResultFromJSONRequest(cmd_dict, windex=windex, timeout=timeout) |
| 1056 | 1056 |
| 1057 def WaitForDownloadToComplete(self, download_path, timeout=-1): | 1057 def WaitForDownloadToComplete(self, download_path, timeout=-1): |
| 1058 """Wait for the given downloads to complete. | 1058 """Wait for the given downloads to complete. |
| 1059 | 1059 |
| 1060 This method works for dangerous downloads as well as regular downloads. | 1060 This method works for dangerous downloads as well as regular downloads. |
| 1061 | 1061 |
| 1062 Args: | 1062 Args: |
| (...skipping 3055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4118 successful = result.wasSuccessful() | 4118 successful = result.wasSuccessful() |
| 4119 if not successful: | 4119 if not successful: |
| 4120 pyauto_tests_file = os.path.join(self.TestsDir(), self._tests_filename) | 4120 pyauto_tests_file = os.path.join(self.TestsDir(), self._tests_filename) |
| 4121 print >>sys.stderr, 'Tests can be disabled by editing %s. ' \ | 4121 print >>sys.stderr, 'Tests can be disabled by editing %s. ' \ |
| 4122 'Ref: %s' % (pyauto_tests_file, _PYAUTO_DOC_URL) | 4122 'Ref: %s' % (pyauto_tests_file, _PYAUTO_DOC_URL) |
| 4123 sys.exit(not successful) | 4123 sys.exit(not successful) |
| 4124 | 4124 |
| 4125 | 4125 |
| 4126 if __name__ == '__main__': | 4126 if __name__ == '__main__': |
| 4127 Main() | 4127 Main() |
| OLD | NEW |