| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright 2016 Google Inc. | 3 # Copyright 2016 Google Inc. |
| 4 # | 4 # |
| 5 # Use of this source code is governed by a BSD-style license that can be | 5 # Use of this source code is governed by a BSD-style license that can be |
| 6 # found in the LICENSE file. | 6 # found in the LICENSE file. |
| 7 | 7 |
| 8 | 8 |
| 9 """Create the SKP asset.""" | 9 """Create the SKP asset.""" |
| 10 | 10 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 webpages_playback_cmd = [ | 43 webpages_playback_cmd = [ |
| 44 'python', os.path.join(SKIA_TOOLS, 'skp', 'webpages_playback.py'), | 44 'python', os.path.join(SKIA_TOOLS, 'skp', 'webpages_playback.py'), |
| 45 '--page_sets', 'all', | 45 '--page_sets', 'all', |
| 46 '--browser_executable', browser_executable, | 46 '--browser_executable', browser_executable, |
| 47 '--non-interactive', | 47 '--non-interactive', |
| 48 '--output_dir', os.getcwd(), | 48 '--output_dir', os.getcwd(), |
| 49 '--chrome_src_path', chrome_src_path, | 49 '--chrome_src_path', chrome_src_path, |
| 50 ] | 50 ] |
| 51 if upload_to_partner_bucket: | 51 if upload_to_partner_bucket: |
| 52 webpages_playback_cmd.append('--upload_to_partner_bucket') | 52 webpages_playback_cmd.append('--upload_to_partner_bucket') |
| 53 print 'Running webpages_playback command:\n$ %s' % ( |
| 54 ' '.join(webpages_playback_cmd)) |
| 53 try: | 55 try: |
| 54 subprocess.check_call(webpages_playback_cmd) | 56 subprocess.check_call(webpages_playback_cmd) |
| 55 finally: | 57 finally: |
| 56 # Clean up any leftover browser instances. This can happen if there are | 58 # Clean up any leftover browser instances. This can happen if there are |
| 57 # telemetry crashes, processes are not always cleaned up appropriately by | 59 # telemetry crashes, processes are not always cleaned up appropriately by |
| 58 # the webpagereplay and telemetry frameworks. | 60 # the webpagereplay and telemetry frameworks. |
| 59 procs = subprocess.check_output(['ps', 'ax']) | 61 procs = subprocess.check_output(['ps', 'ax']) |
| 60 for line in procs.splitlines(): | 62 for line in procs.splitlines(): |
| 61 if browser_executable in line: | 63 if browser_executable in line: |
| 62 pid = line.strip().split(' ')[0] | 64 pid = line.strip().split(' ')[0] |
| (...skipping 16 matching lines...) Expand all Loading... |
| 79 parser.add_argument('--chrome_src_path', '-c', required=True) | 81 parser.add_argument('--chrome_src_path', '-c', required=True) |
| 80 parser.add_argument('--browser_executable', '-e', required=True) | 82 parser.add_argument('--browser_executable', '-e', required=True) |
| 81 parser.add_argument('--upload_to_partner_bucket', action='store_true') | 83 parser.add_argument('--upload_to_partner_bucket', action='store_true') |
| 82 args = parser.parse_args() | 84 args = parser.parse_args() |
| 83 create_asset(args.chrome_src_path, args.browser_executable, args.target_dir, | 85 create_asset(args.chrome_src_path, args.browser_executable, args.target_dir, |
| 84 args.upload_to_partner_bucket) | 86 args.upload_to_partner_bucket) |
| 85 | 87 |
| 86 | 88 |
| 87 if __name__ == '__main__': | 89 if __name__ == '__main__': |
| 88 main() | 90 main() |
| OLD | NEW |