| Index: tools/testing/run_selenium.py
|
| diff --git a/tools/testing/run_selenium.py b/tools/testing/run_selenium.py
|
| index 8cb0a2f9c7608b4008fed123f4c3e34cc2512c40..2ce71dbcc723618b56d593a968914c6cc6fcf778 100755
|
| --- a/tools/testing/run_selenium.py
|
| +++ b/tools/testing/run_selenium.py
|
| @@ -285,45 +285,53 @@ def run_batch_tests():
|
| signal.signal(signal.SIGTERM, lambda number, frame: close_browser(browser))
|
|
|
| try:
|
| - while True:
|
| - line = sys.stdin.readline()
|
| - if line == '--terminate\n':
|
| - print("Terminating selenium driver")
|
| - break
|
| -
|
| - (html_out, browser_name, executable_path,
|
| - timeout, mode, refresh) = parse_args(line.split())
|
| -
|
| - # Sanity checks that test.dart is passing flags we can handle.
|
| - if mode != 'correctness':
|
| - print 'Batch test runner not compatible with perf testing'
|
| - return 1
|
| - if browser and current_browser_name != browser_name:
|
| - print('Batch test runner got multiple browsers: %s and %s'
|
| - % (current_browser_name, browser_name))
|
| - return 1
|
| -
|
| - # Start the browser on the first run
|
| - if browser is None:
|
| - current_browser_name = browser_name
|
| - browser = start_browser(browser_name, executable_path, html_out)
|
| -
|
| - source = run_test_in_browser(browser, html_out, timeout, mode, refresh)
|
| -
|
| - # Test is done. Write end token to stderr and flush.
|
| - sys.stderr.write('>>> EOF STDERR\n')
|
| - sys.stderr.flush()
|
| -
|
| - # print one of:
|
| - # >>> TEST {PASS, FAIL, OK, CRASH, FAIL, TIMEOUT}
|
| - status = report_results(mode, source, browser)
|
| - if status == 0:
|
| - print '>>> TEST PASS'
|
| - elif source == TIMEOUT_ERROR_MSG:
|
| - print '>>> TEST TIMEOUT'
|
| - else:
|
| - print '>>> TEST FAIL'
|
| - sys.stdout.flush()
|
| + try:
|
| + while True:
|
| + line = sys.stdin.readline()
|
| + if line == '--terminate\n':
|
| + print("Terminating selenium driver")
|
| + break
|
| +
|
| + (html_out, browser_name, executable_path,
|
| + timeout, mode, refresh) = parse_args(line.split())
|
| +
|
| + # Sanity checks that test.dart is passing flags we can handle.
|
| + if mode != 'correctness':
|
| + print 'Batch test runner not compatible with perf testing'
|
| + return 1
|
| + if browser and current_browser_name != browser_name:
|
| + print('Batch test runner got multiple browsers: %s and %s'
|
| + % (current_browser_name, browser_name))
|
| + return 1
|
| +
|
| + # Start the browser on the first run
|
| + if browser is None:
|
| + current_browser_name = browser_name
|
| + browser = start_browser(browser_name, executable_path, html_out)
|
| +
|
| + source = run_test_in_browser(browser, html_out, timeout, mode, refresh)
|
| +
|
| + # Test is done. Write end token to stderr and flush.
|
| + sys.stderr.write('>>> EOF STDERR\n')
|
| + sys.stderr.flush()
|
| +
|
| + # print one of:
|
| + # >>> TEST {PASS, FAIL, OK, CRASH, FAIL, TIMEOUT}
|
| + status = report_results(mode, source, browser)
|
| + if status == 0:
|
| + print '>>> TEST PASS'
|
| + elif source == TIMEOUT_ERROR_MSG:
|
| + print '>>> TEST TIMEOUT'
|
| + else:
|
| + print '>>> TEST FAIL'
|
| + sys.stdout.flush()
|
| + except:
|
| + type, value, traceback = sys.exc_info()
|
| + print "run_selenium.py: Unexpected exception occured: "
|
| + print " type: ", type
|
| + print " value: ", value
|
| + print " traceback: ", traceback
|
| + raise
|
| finally:
|
| sys.stdin.close()
|
| print("Closing browser");
|
|
|