Chromium Code Reviews| Index: run_jstests.py |
| diff --git a/run_jstests.py b/run_jstests.py |
| index 8530ec10d9f22e23bd18c1fdc3b614255e186178..b4ca23e269c5a2b79716a379cf727ee175909844 100755 |
| --- a/run_jstests.py |
| +++ b/run_jstests.py |
| @@ -49,7 +49,8 @@ def main(argv): |
| if options.shuffle: |
| params['shuffle'] = options.shuffle |
| - test_runner = "return org.chromium.distiller.JsTestEntry.run()"; |
| + image_loaded = "return window.image_loaded" |
| + test_runner = "return org.chromium.distiller.JsTestEntry.run()" |
| test_html = os.path.abspath(os.path.join(os.path.dirname(__file__), "war", "test.html")) |
| test_html += "?" + urllib.urlencode(params) |
| @@ -64,12 +65,16 @@ def main(argv): |
| chrome_options.add_argument("--no-sandbox") |
| driver = webdriver.Chrome(chrome_options=chrome_options) |
| - driver.get("file://" + test_html) |
| for i in range(options.repeat): |
| + driver.get("file://" + test_html) |
| + while not driver.execute_script(image_loaded): |
|
mdjones
2017/03/22 17:35:04
I'd check to see if there is a execute-and-wait ve
wychen
2017/04/11 00:22:55
I gave selenium.webdriver.support.expected_conditi
|
| + print "Wait for image loading..." |
| + time.sleep(0.1) |
| + |
| start = time.time() |
| result = driver.execute_script(test_runner) |
| - |
| end = time.time() |
| + |
| if not result['success'] or options.repeat == i+1: |
| print result['log'].encode('utf-8') |
| print 'Tests run: %d, Failures: %d, Skipped: %d, Time elapsed: %0.3f sec' % (result['numTests'], |