| 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 1295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1306 u'width': 925, | 1306 u'width': 925, |
| 1307 u'x': 26, | 1307 u'x': 26, |
| 1308 u'y': 44}]} | 1308 u'y': 44}]} |
| 1309 | 1309 |
| 1310 Raises: | 1310 Raises: |
| 1311 pyauto_errors.JSONInterfaceError if the automation call returns an error. | 1311 pyauto_errors.JSONInterfaceError if the automation call returns an error. |
| 1312 """ | 1312 """ |
| 1313 cmd_dict = { # Prepare command for the json interface | 1313 cmd_dict = { # Prepare command for the json interface |
| 1314 'command': 'GetBrowserInfo', | 1314 'command': 'GetBrowserInfo', |
| 1315 } | 1315 } |
| 1316 return self._GetResultFromJSONRequest(cmd_dict) | 1316 return self._GetResultFromJSONRequest(cmd_dict, windex=-1) |
| 1317 | 1317 |
| 1318 def GetNavigationInfo(self, tab_index=0, windex=0): | 1318 def GetNavigationInfo(self, tab_index=0, windex=0): |
| 1319 """Get info about the navigation state of a given tab. | 1319 """Get info about the navigation state of a given tab. |
| 1320 | 1320 |
| 1321 Args: | 1321 Args: |
| 1322 tab_index: The tab index, default is 0. | 1322 tab_index: The tab index, default is 0. |
| 1323 window_index: The window index, default is 0. | 1323 window_index: The window index, default is 0. |
| 1324 | 1324 |
| 1325 Returns: | 1325 Returns: |
| 1326 a dictionary. | 1326 a dictionary. |
| (...skipping 2953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4280 successful = result.wasSuccessful() | 4280 successful = result.wasSuccessful() |
| 4281 if not successful: | 4281 if not successful: |
| 4282 pyauto_tests_file = os.path.join(self.TestsDir(), self._tests_filename) | 4282 pyauto_tests_file = os.path.join(self.TestsDir(), self._tests_filename) |
| 4283 print >>sys.stderr, 'Tests can be disabled by editing %s. ' \ | 4283 print >>sys.stderr, 'Tests can be disabled by editing %s. ' \ |
| 4284 'Ref: %s' % (pyauto_tests_file, _PYAUTO_DOC_URL) | 4284 'Ref: %s' % (pyauto_tests_file, _PYAUTO_DOC_URL) |
| 4285 sys.exit(not successful) | 4285 sys.exit(not successful) |
| 4286 | 4286 |
| 4287 | 4287 |
| 4288 if __name__ == '__main__': | 4288 if __name__ == '__main__': |
| 4289 Main() | 4289 Main() |
| OLD | NEW |