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

Unified Diff: run_jstests.py

Issue 2755503005: Make sure images are loaded before running tests (Closed)
Patch Set: Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | war/test.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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'],
« no previous file with comments | « no previous file | war/test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698