Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(377)

Side by Side Diff: chrome/test/pyautolib/pyauto.py

Issue 2810032: PyAuto: minor cleanup (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 2
3 # Copyright (c) 2010 The Chromium Authors. All rights reserved. 3 # Copyright (c) 2010 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 629 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 } 640 }
641 ret_dict = json.loads(self._SendJSONRequest(window_index, 641 ret_dict = json.loads(self._SendJSONRequest(window_index,
642 json.dumps(cmd_dict))) 642 json.dumps(cmd_dict)))
643 if ret_dict.has_key('error'): 643 if ret_dict.has_key('error'):
644 raise JSONInterfaceError(ret_dict['error']) 644 raise JSONInterfaceError(ret_dict['error'])
645 try: 645 try:
646 f = open(filename) 646 f = open(filename)
647 all_data = f.read() 647 all_data = f.read()
648 f.close() 648 f.close()
649 return all_data 649 return all_data
650 except IOError:
651 raise
652 finally: 650 finally:
653 shutil.rmtree(tempdir) 651 shutil.rmtree(tempdir)
654 652
655 653
656 class PyUITestSuite(pyautolib.PyUITestSuiteBase, unittest.TestSuite): 654 class PyUITestSuite(pyautolib.PyUITestSuiteBase, unittest.TestSuite):
657 """Base TestSuite for PyAuto UI tests.""" 655 """Base TestSuite for PyAuto UI tests."""
658 656
659 def __init__(self, args): 657 def __init__(self, args):
660 pyautolib.PyUITestSuiteBase.__init__(self, args) 658 pyautolib.PyUITestSuiteBase.__init__(self, args)
661 659
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
888 if self._options.verbose: 886 if self._options.verbose:
889 verbosity = 2 887 verbosity = 2
890 result = unittest.TextTestRunner(verbosity=verbosity).run(pyauto_suite) 888 result = unittest.TextTestRunner(verbosity=verbosity).run(pyauto_suite)
891 del loaded_tests # Need to destroy test cases before the suite 889 del loaded_tests # Need to destroy test cases before the suite
892 del pyauto_suite 890 del pyauto_suite
893 sys.exit(not result.wasSuccessful()) 891 sys.exit(not result.wasSuccessful())
894 892
895 893
896 if __name__ == '__main__': 894 if __name__ == '__main__':
897 Main() 895 Main()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698