Chromium Code Reviews| Index: tools/testing/run_selenium.py |
| =================================================================== |
| --- tools/testing/run_selenium.py (revision 13306) |
| +++ tools/testing/run_selenium.py (working copy) |
| @@ -164,11 +164,14 @@ |
| options.binary_location = os.path.join(dartium_dir, 'chrome') |
| return selenium.webdriver.Chrome(chrome_options=options) |
| elif browser == 'ff': |
| + script_dir = os.path.dirname(os.path.abspath(__file__)) |
| profile = selenium.webdriver.firefox.firefox_profile.FirefoxProfile() |
| profile.set_preference('dom.max_script_run_time', 0) |
| profile.set_preference('dom.max_chrome_script_run_time', 0) |
| profile.set_preference('app.update.auto', True) |
| profile.set_preference('app.update.enabled', True) |
| + xpi = os.path.join(script_dir, 'extensions', 'firefox', 'ConsoleCollector.xpi') |
| + profile.add_extension(xpi); |
| return selenium.webdriver.Firefox(firefox_profile=profile) |
| elif browser == 'ie' and platform.system() == 'Windows': |
| return selenium.webdriver.Ie() |
| @@ -220,7 +223,7 @@ |
| # TODO(efortuna): Figure out why this crashes.... and avoid? |
| pass |
| -def report_results(mode, source): |
| +def report_results(mode, source, browser_name, browser): |
| # TODO(vsm): Add a failure check for Dromaeo. |
| if mode != 'correctness': |
| # We're running a performance test. |
| @@ -244,6 +247,12 @@ |
| index += len('<body>') |
| end_index = source.find('</body') |
| print unicode(source[index : end_index]).encode("utf-8") |
| + if browser_name == 'ff': |
|
Emily Fortuna
2012/10/05 18:41:41
if type(browser) is selenium.webdriver.firefox.web
gram
2012/10/05 19:59:08
Done.
|
| + logs = browser.execute_script("return window.ConsoleCollector.read()"); |
| + for msg in logs: |
| + print('%s:%s:%s:%s %s' %( |
| + msg['source'], msg['line'], msg['column'], |
| + msg['category'], msg['message'])) |
| return 1 |
| @@ -306,7 +315,7 @@ |
| # print one of: |
| # >>> TEST {PASS, FAIL, OK, CRASH, FAIL, TIMEOUT} |
| - status = report_results(mode, source) |
| + status = report_results(mode, source, browser_name, browser) |
| if status == 0: |
| print '>>> TEST PASS' |
| elif source == TIMEOUT_ERROR_MSG: |
| @@ -330,7 +339,7 @@ |
| try: |
| output = run_test_in_browser(browser, html_out, timeout, mode) |
| - return report_results(mode, output) |
| + return report_results(mode, output, browser_name, browser) |
| finally: |
| close_browser(browser) |