| Index: dart/tools/testing/run_selenium.py
|
| diff --git a/dart/tools/testing/run_selenium.py b/dart/tools/testing/run_selenium.py
|
| index 322f560617d00a66b8a171881c08e2ed8acb32ba..001c088a3b9293101defa824369f16a2c5bc6074 100755
|
| --- a/dart/tools/testing/run_selenium.py
|
| +++ b/dart/tools/testing/run_selenium.py
|
| @@ -40,6 +40,7 @@ import socket
|
| import sys
|
| import time
|
| import urllib2
|
| +import threading
|
|
|
| TIMEOUT_ERROR_MSG = 'FAIL (timeout)'
|
|
|
| @@ -315,9 +316,27 @@ def run_batch_tests():
|
| print '>>> TEST FAIL'
|
| sys.stdout.flush()
|
| finally:
|
| + sys.stdin.close()
|
| print("Closing browser");
|
| - close_browser(browser)
|
|
|
| + def close_output_streams:
|
| + sys.stdout.flush()
|
| + sys.stdout.close()
|
| + sys.stderr.flush()
|
| + sys.stderr.close()
|
| +
|
| + def close_and_exit:
|
| + print("Timed out waiting for browser to close")
|
| + close_output_streams()
|
| + exit(1)
|
| +
|
| + timer = threading.Timer(5.0, close_and_exit)
|
| + timer.start()
|
| + try:
|
| + close_browser(browser)
|
| + timer.cancel()
|
| + finally:
|
| + close_output_streams()
|
|
|
| def main(args):
|
| # Run in batch mode if the --batch flag is passed.
|
|
|