OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2014 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2014 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 | 6 |
7 """Run the webpages_playback automation script.""" | 7 """Run the webpages_playback automation script.""" |
8 | 8 |
9 | 9 |
10 import os | 10 import os |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 '--page_sets', 'all', | 57 '--page_sets', 'all', |
58 '--browser_executable', browser_executable, | 58 '--browser_executable', browser_executable, |
59 '--non-interactive', | 59 '--non-interactive', |
60 '--upload', | 60 '--upload', |
61 '--alternate_upload_dir', upload_dir, | 61 '--alternate_upload_dir', upload_dir, |
62 '--chrome_src_path', chrome_src_path, | 62 '--chrome_src_path', chrome_src_path, |
63 ] | 63 ] |
64 | 64 |
65 try: | 65 try: |
66 shell_utils.run(webpages_playback_cmd) | 66 shell_utils.run(webpages_playback_cmd) |
| 67 |
67 # Temporary change to enable Slimming Paint runs. See skia:3763. | 68 # Temporary change to enable Slimming Paint runs. See skia:3763. |
| 69 chromium_page_sets_path = os.path.join( |
| 70 chrome_src_path, 'tools', 'perf', 'page_sets') |
68 webpages_playback_cmd.extend([ | 71 webpages_playback_cmd.extend([ |
69 '--skp_prefix', 'sp_', | 72 '--skp_prefix', 'sp_', |
70 '--browser_extra_args', '--enable-slimming-paint', | 73 '--browser_extra_args', '--enable-slimming-paint', |
| 74 '--page_sets', '%s' % ( |
| 75 os.path.join(chromium_page_sets_path, 'top_25_smooth.py')) |
71 ]) | 76 ]) |
72 shell_utils.run(webpages_playback_cmd) | 77 shell_utils.run(webpages_playback_cmd) |
73 finally: | 78 finally: |
74 # Clean up any leftover browser instances. This can happen if there are | 79 # Clean up any leftover browser instances. This can happen if there are |
75 # telemetry crashes, processes are not always cleaned up appropriately by | 80 # telemetry crashes, processes are not always cleaned up appropriately by |
76 # the webpagereplay and telemetry frameworks. | 81 # the webpagereplay and telemetry frameworks. |
77 procs = subprocess.check_output(['ps', 'ax']) | 82 procs = subprocess.check_output(['ps', 'ax']) |
78 for line in procs.splitlines(): | 83 for line in procs.splitlines(): |
79 if browser_executable in line: | 84 if browser_executable in line: |
80 pid = line.strip().split(' ')[0] | 85 pid = line.strip().split(' ')[0] |
81 if pid != str(os.getpid()) and not 'python' in line: | 86 if pid != str(os.getpid()) and not 'python' in line: |
82 try: | 87 try: |
83 shell_utils.run(['kill', '-9', pid]) | 88 shell_utils.run(['kill', '-9', pid]) |
84 except shell_utils.CommandFailedException as e: | 89 except shell_utils.CommandFailedException as e: |
85 print e | 90 print e |
86 else: | 91 else: |
87 print 'Refusing to kill self.' | 92 print 'Refusing to kill self.' |
88 | 93 |
89 print 'writing %s: %s' % (SKP_VERSION_FILE, skp_version) | 94 print 'writing %s: %s' % (SKP_VERSION_FILE, skp_version) |
90 with open(SKP_VERSION_FILE, 'w') as f: | 95 with open(SKP_VERSION_FILE, 'w') as f: |
91 f.write(str(skp_version)) | 96 f.write(str(skp_version)) |
92 | 97 |
93 | 98 |
94 if '__main__' == __name__: | 99 if '__main__' == __name__: |
95 if len(sys.argv) != 3: | 100 if len(sys.argv) != 3: |
96 print >> sys.stderr, 'USAGE: %s <chrome src path> <browser executable>' | 101 print >> sys.stderr, 'USAGE: %s <chrome src path> <browser executable>' |
97 sys.exit(1) | 102 sys.exit(1) |
98 main(*sys.argv[1:]) | 103 main(*sys.argv[1:]) |
OLD | NEW |