OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2015 The Chromium Authors. All rights reserved. | 2 # Copyright 2015 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 import argparse | 6 import argparse |
7 import logging | 7 import logging |
8 import os | 8 import os |
9 import re | 9 import re |
10 import shutil | 10 import shutil |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 path = os.path.join(tmpdir, path) | 242 path = os.path.join(tmpdir, path) |
243 os.chmod(path, os.stat(path).st_mode | stat.S_IEXEC) | 243 os.chmod(path, os.stat(path).st_mode | stat.S_IEXEC) |
244 chrome_info = version | 244 chrome_info = version |
245 chrome_command = [ | 245 chrome_command = [ |
246 chrome_path, | 246 chrome_path, |
247 '--user-data-dir=%s' % user_data_dir, | 247 '--user-data-dir=%s' % user_data_dir, |
248 '--no-sandbox', | 248 '--no-sandbox', |
249 '--no-experiments', | 249 '--no-experiments', |
250 '--no-first-run', | 250 '--no-first-run', |
251 '--noerrdialogs', | 251 '--noerrdialogs', |
| 252 '--window-size=1280,1024', |
252 ('http://localhost:%s/%s/tests.html?' % (port, args.tests)) + | 253 ('http://localhost:%s/%s/tests.html?' % (port, args.tests)) + |
253 'headless=true&testTypeToRun=all', | 254 'headless=true&testTypeToRun=all', |
254 ] | 255 ] |
255 print "Starting Chrome %s..." % chrome_info | 256 print "Starting Chrome %s..." % chrome_info |
256 chrome_process = subprocess.Popen( | 257 chrome_process = subprocess.Popen( |
257 chrome_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) | 258 chrome_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
258 print "Waiting for tests to finish..." | 259 print "Waiting for tests to finish..." |
259 server_out, server_err = server_process.communicate() | 260 server_out, server_err = server_process.communicate() |
260 print "Killing Chrome..." | 261 print "Killing Chrome..." |
261 if sys.platform == 'win32': | 262 if sys.platform == 'win32': |
(...skipping 19 matching lines...) Expand all Loading... |
281 try: | 282 try: |
282 shutil.rmtree(tmpdir) | 283 shutil.rmtree(tmpdir) |
283 shutil.rmtree(user_data_dir) | 284 shutil.rmtree(user_data_dir) |
284 except OSError as e: | 285 except OSError as e: |
285 logging.error('Error cleaning up temp dirs %s and %s: %s' % ( | 286 logging.error('Error cleaning up temp dirs %s and %s: %s' % ( |
286 tmpdir, user_data_dir, e)) | 287 tmpdir, user_data_dir, e)) |
287 if xvfb_process: | 288 if xvfb_process: |
288 xvfb_process.kill() | 289 xvfb_process.kill() |
289 | 290 |
290 sys.exit(server_process.returncode) | 291 sys.exit(server_process.returncode) |
OLD | NEW |