| 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 4013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4024 return self.WaitUntil( | 4024 return self.WaitUntil( |
| 4025 lambda: self.GetDOMValue('document.readyState', | 4025 lambda: self.GetDOMValue('document.readyState', |
| 4026 tab_index, windex, frame_xpath), | 4026 tab_index, windex, frame_xpath), |
| 4027 expect_retval='complete') | 4027 expect_retval='complete') |
| 4028 | 4028 |
| 4029 def SimulateAsanMemoryBug(self): | 4029 def SimulateAsanMemoryBug(self): |
| 4030 """Simulates a memory bug for Address Sanitizer to catch. | 4030 """Simulates a memory bug for Address Sanitizer to catch. |
| 4031 | 4031 |
| 4032 Address Sanitizer (if it was built it) will catch the bug and abort | 4032 Address Sanitizer (if it was built it) will catch the bug and abort |
| 4033 the process. | 4033 the process. |
| 4034 This method returns immediately before it actually causes a crash. |
| 4034 """ | 4035 """ |
| 4035 cmd_dict = { 'command': 'SimulateAsanMemoryBug' } | 4036 cmd_dict = { 'command': 'SimulateAsanMemoryBug' } |
| 4036 self._GetResultFromJSONRequest(cmd_dict, windex=None) | 4037 self._GetResultFromJSONRequest(cmd_dict, windex=None) |
| 4037 | 4038 |
| 4038 ## ChromeOS section | 4039 ## ChromeOS section |
| 4039 | 4040 |
| 4040 def GetLoginInfo(self): | 4041 def GetLoginInfo(self): |
| 4041 """Returns information about login and screen locker state. | 4042 """Returns information about login and screen locker state. |
| 4042 | 4043 |
| 4043 This includes things like whether a user is logged in, the username | 4044 This includes things like whether a user is logged in, the username |
| (...skipping 1730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5774 successful = result.wasSuccessful() | 5775 successful = result.wasSuccessful() |
| 5775 if not successful: | 5776 if not successful: |
| 5776 pyauto_tests_file = os.path.join(self.TestsDir(), self._tests_filename) | 5777 pyauto_tests_file = os.path.join(self.TestsDir(), self._tests_filename) |
| 5777 print >>sys.stderr, 'Tests can be disabled by editing %s. ' \ | 5778 print >>sys.stderr, 'Tests can be disabled by editing %s. ' \ |
| 5778 'Ref: %s' % (pyauto_tests_file, _PYAUTO_DOC_URL) | 5779 'Ref: %s' % (pyauto_tests_file, _PYAUTO_DOC_URL) |
| 5779 sys.exit(not successful) | 5780 sys.exit(not successful) |
| 5780 | 5781 |
| 5781 | 5782 |
| 5782 if __name__ == '__main__': | 5783 if __name__ == '__main__': |
| 5783 Main() | 5784 Main() |
| OLD | NEW |