| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 | 2 |
| 3 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 3 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 4 # for details. All rights reserved. Use of this source code is governed by a | 4 # for details. All rights reserved. Use of this source code is governed by a |
| 5 # BSD-style license that can be found in the LICENSE file. | 5 # BSD-style license that can be found in the LICENSE file. |
| 6 # | 6 # |
| 7 | 7 |
| 8 """Script to actually open a browser and perform the test, and reports back with | 8 """Script to actually open a browser and perform the test, and reports back with |
| 9 the result. It uses Selenium WebDriver when possible for running the tests. It | 9 the result. It uses Selenium WebDriver when possible for running the tests. It |
| 10 uses Selenium RC for Safari. | 10 uses Selenium RC for Safari. |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 if browser == 'chrome': | 137 if browser == 'chrome': |
| 138 # Note: you need ChromeDriver *in your path* to run Chrome, in addition to | 138 # Note: you need ChromeDriver *in your path* to run Chrome, in addition to |
| 139 # installing Chrome. Also note that the build bot runs have a different path | 139 # installing Chrome. Also note that the build bot runs have a different path |
| 140 # from a normal user -- check the build logs. | 140 # from a normal user -- check the build logs. |
| 141 return selenium.webdriver.Chrome() | 141 return selenium.webdriver.Chrome() |
| 142 elif browser == 'dartium': | 142 elif browser == 'dartium': |
| 143 script_dir = os.path.dirname(os.path.abspath(__file__)) | 143 script_dir = os.path.dirname(os.path.abspath(__file__)) |
| 144 dartium_dir = os.path.join(script_dir, '..', '..', 'client', 'tests', | 144 dartium_dir = os.path.join(script_dir, '..', '..', 'client', 'tests', |
| 145 'dartium') | 145 'dartium') |
| 146 options = selenium.webdriver.chrome.options.Options() | 146 options = selenium.webdriver.chrome.options.Options() |
| 147 # enable ShadowDOM and style scoped for Dartium |
| 148 options.add_argument('--enable-shadow-dom') |
| 149 options.add_argument('--enable-style-scoped') |
| 147 if executable_path is not None: | 150 if executable_path is not None: |
| 148 options.binary_location = executable_path | 151 options.binary_location = executable_path |
| 149 elif platform.system() == 'Windows': | 152 elif platform.system() == 'Windows': |
| 150 options.binary_location = os.path.join(dartium_dir, 'chrome.exe') | 153 options.binary_location = os.path.join(dartium_dir, 'chrome.exe') |
| 151 elif platform.system() == 'Darwin': | 154 elif platform.system() == 'Darwin': |
| 152 options.binary_location = os.path.join(dartium_dir, 'Chromium.app', | 155 options.binary_location = os.path.join(dartium_dir, 'Chromium.app', |
| 153 'Contents', 'MacOS', 'Chromium') | 156 'Contents', 'MacOS', 'Chromium') |
| 154 else: | 157 else: |
| 155 options.binary_location = os.path.join(dartium_dir, 'chrome') | 158 options.binary_location = os.path.join(dartium_dir, 'chrome') |
| 156 return selenium.webdriver.Chrome(chrome_options=options) | 159 return selenium.webdriver.Chrome(chrome_options=options) |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 browser = start_browser(browser_name, executable_path, html_out) | 309 browser = start_browser(browser_name, executable_path, html_out) |
| 307 | 310 |
| 308 try: | 311 try: |
| 309 output = run_test_in_browser(browser, html_out, timeout, mode) | 312 output = run_test_in_browser(browser, html_out, timeout, mode) |
| 310 return report_results(mode, output) | 313 return report_results(mode, output) |
| 311 finally: | 314 finally: |
| 312 close_browser(browser) | 315 close_browser(browser) |
| 313 | 316 |
| 314 if __name__ == "__main__": | 317 if __name__ == "__main__": |
| 315 sys.exit(main(sys.argv)) | 318 sys.exit(main(sys.argv)) |
| OLD | NEW |