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

Side by Side Diff: tools/testing/run_selenium.py

Issue 11088038: Fix IEDriver error on closing. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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) 2011, the Dart project authors. Please see the AUTHORS file 3 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
4 # for details. All rights reserved. Use of this source code is governed by a 4 # for details. All rights reserved. Use of this source code is governed by a
5 # BSD-style license that can be found in the LICENSE file. 5 # BSD-style license that can be found in the LICENSE file.
6 # 6 #
7 7
8 """Script to actually open a browser and perform the test, and reports back with 8 """Script to actually open a browser and perform the test, and reports back with
9 the result. It uses Selenium WebDriver when possible for running the tests. It 9 the result. It uses Selenium WebDriver when possible for running the tests. It
10 uses Selenium RC for Safari. 10 uses Selenium RC for Safari.
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 raise Exception('Incompatible browser and platform combination.') 205 raise Exception('Incompatible browser and platform combination.')
206 206
207 def close_browser(browser): 207 def close_browser(browser):
208 if browser is None: 208 if browser is None:
209 return 209 return
210 if isinstance(browser, selenium.selenium): 210 if isinstance(browser, selenium.selenium):
211 browser.stop() 211 browser.stop()
212 return 212 return
213 213
214 # A timeout exception is thrown if nothing happens within the time limit. 214 # A timeout exception is thrown if nothing happens within the time limit.
215 if browser != 'chrome': 215 if (type(browser) is not selenium.webdriver.chrome.webdriver.WebDriver and
216 type(browser) is not selenium.webdriver.ie.webdriver.WebDriver):
216 browser.close() 217 browser.close()
217 try: 218 browser.quit()
218 browser.quit()
219 except selenium.common.exceptions.WebDriverException:
220 # TODO(efortuna): Figure out why this crashes.... and avoid?
221 pass
222 219
223 def report_results(mode, source): 220 def report_results(mode, source):
224 # TODO(vsm): Add a failure check for Dromaeo. 221 # TODO(vsm): Add a failure check for Dromaeo.
225 if mode != 'correctness': 222 if mode != 'correctness':
226 # We're running a performance test. 223 # We're running a performance test.
227 print source.encode('utf8') 224 print source.encode('utf8')
228 sys.stdout.flush() 225 sys.stdout.flush()
229 if 'NaN' in source: 226 if 'NaN' in source:
230 return 1 227 return 1
231 else: 228 else:
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 browser = start_browser(browser_name, executable_path, html_out) 326 browser = start_browser(browser_name, executable_path, html_out)
330 327
331 try: 328 try:
332 output = run_test_in_browser(browser, html_out, timeout, mode) 329 output = run_test_in_browser(browser, html_out, timeout, mode)
333 return report_results(mode, output) 330 return report_results(mode, output)
334 finally: 331 finally:
335 close_browser(browser) 332 close_browser(browser)
336 333
337 if __name__ == "__main__": 334 if __name__ == "__main__":
338 sys.exit(main(sys.argv)) 335 sys.exit(main(sys.argv))
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