Chromium Code Reviews| 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 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 527 if ret_dict.has_key('error'): | 527 if ret_dict.has_key('error'): |
| 528 raise JSONInterfaceError(ret_dict['error']) | 528 raise JSONInterfaceError(ret_dict['error']) |
| 529 return ret_dict | 529 return ret_dict |
| 530 | 530 |
| 531 def GetBookmarkModel(self): | 531 def GetBookmarkModel(self): |
| 532 """Return the bookmark model as a BookmarkModel object. | 532 """Return the bookmark model as a BookmarkModel object. |
| 533 | 533 |
| 534 This is a snapshot of the bookmark model; it is not a proxy and | 534 This is a snapshot of the bookmark model; it is not a proxy and |
| 535 does not get updated as the bookmark model changes. | 535 does not get updated as the bookmark model changes. |
| 536 """ | 536 """ |
| 537 return bookmark_model.BookmarkModel(self._GetBookmarksAsJSON()) | 537 bookmarksAsJSON = self._GetBookmarksAsJSON() |
|
Nirnimesh
2011/05/05 23:02:01
nit: s/bookmarksAsJSON/bookmarks_as_json/
| |
| 538 if bookmarksAsJSON == None: | |
| 539 raise JSONInterfaceError('Could not resolve browser proxy.') | |
| 540 return bookmark_model.BookmarkModel(bookmarksAsJSON) | |
| 538 | 541 |
| 539 def GetDownloadsInfo(self, windex=0): | 542 def GetDownloadsInfo(self, windex=0): |
| 540 """Return info about downloads. | 543 """Return info about downloads. |
| 541 | 544 |
| 542 This includes all the downloads recognized by the history system. | 545 This includes all the downloads recognized by the history system. |
| 543 | 546 |
| 544 Returns: | 547 Returns: |
| 545 an instance of downloads_info.DownloadInfo | 548 an instance of downloads_info.DownloadInfo |
| 546 """ | 549 """ |
| 547 return download_info.DownloadInfo( | 550 return download_info.DownloadInfo( |
| (...skipping 2814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3362 if self._options.verbose: | 3365 if self._options.verbose: |
| 3363 verbosity = 2 | 3366 verbosity = 2 |
| 3364 result = PyAutoTextTestRuner(verbosity=verbosity).run(pyauto_suite) | 3367 result = PyAutoTextTestRuner(verbosity=verbosity).run(pyauto_suite) |
| 3365 del loaded_tests # Need to destroy test cases before the suite | 3368 del loaded_tests # Need to destroy test cases before the suite |
| 3366 del pyauto_suite | 3369 del pyauto_suite |
| 3367 sys.exit(not result.wasSuccessful()) | 3370 sys.exit(not result.wasSuccessful()) |
| 3368 | 3371 |
| 3369 | 3372 |
| 3370 if __name__ == '__main__': | 3373 if __name__ == '__main__': |
| 3371 Main() | 3374 Main() |
| OLD | NEW |