Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(184)

Side by Side Diff: tools/skp/recreate_skps.py

Issue 1115003002: Handpick 16 Skia page sets to create SP enabled SKPs from (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Cleanup Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
68 # 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( 69 skia_page_sets_path = os.path.join(
70 chrome_src_path, 'tools', 'perf', 'page_sets') 70 os.path.dirname(os.path.realpath(__file__)), 'page_sets')
71 sp_skia_page_sets = [
72 os.path.join(skia_page_sets_path, 'skia_carsvg_desktop.py'),
73 os.path.join(skia_page_sets_path, 'skia_chalkboard_desktop.py'),
74 os.path.join(skia_page_sets_path, 'skia_css3gradients_desktop.py'),
75 os.path.join(skia_page_sets_path, 'skia_espn_desktop.py'),
76 os.path.join(skia_page_sets_path, 'skia_gmailthread_desktop.py'),
77 os.path.join(skia_page_sets_path, 'skia_googlehome_desktop.py'),
78 os.path.join(skia_page_sets_path, 'skia_googlespreadsheet_desktop.py'),
79 os.path.join(skia_page_sets_path, 'skia_jsfiddlebigcar_desktop.py'),
80 os.path.join(skia_page_sets_path, 'skia_mapsvg_desktop.py'),
81 os.path.join(skia_page_sets_path, 'skia_nytimes_desktop.py'),
82 os.path.join(skia_page_sets_path, 'skia_samoasvg_desktop.py'),
83 os.path.join(skia_page_sets_path, 'skia_tigersvg_desktop.py'),
84 os.path.join(skia_page_sets_path, 'skia_ugamsolutions_desktop.py'),
85 os.path.join(skia_page_sets_path, 'skia_digg_nexus10.py'),
86 os.path.join(skia_page_sets_path, 'skia_gmail_nexus10.py'),
87 os.path.join(skia_page_sets_path, 'skia_pravda_nexus10.py'),
88 ]
71 webpages_playback_cmd.extend([ 89 webpages_playback_cmd.extend([
72 '--skp_prefix', 'sp_', 90 '--skp_prefix', 'sp_',
73 '--browser_extra_args', '--enable-slimming-paint', 91 '--browser_extra_args', '--enable-slimming-paint',
74 '--page_sets', '%s' % ( 92 '--page_sets', '%s' % ','.join(sp_skia_page_sets),
75 os.path.join(chromium_page_sets_path, 'top_25_smooth.py'))
76 ]) 93 ])
77 shell_utils.run(webpages_playback_cmd) 94 shell_utils.run(webpages_playback_cmd)
78 finally: 95 finally:
79 # Clean up any leftover browser instances. This can happen if there are 96 # Clean up any leftover browser instances. This can happen if there are
80 # telemetry crashes, processes are not always cleaned up appropriately by 97 # telemetry crashes, processes are not always cleaned up appropriately by
81 # the webpagereplay and telemetry frameworks. 98 # the webpagereplay and telemetry frameworks.
82 procs = subprocess.check_output(['ps', 'ax']) 99 procs = subprocess.check_output(['ps', 'ax'])
83 for line in procs.splitlines(): 100 for line in procs.splitlines():
84 if browser_executable in line: 101 if browser_executable in line:
85 pid = line.strip().split(' ')[0] 102 pid = line.strip().split(' ')[0]
86 if pid != str(os.getpid()) and not 'python' in line: 103 if pid != str(os.getpid()) and not 'python' in line:
87 try: 104 try:
88 shell_utils.run(['kill', '-9', pid]) 105 shell_utils.run(['kill', '-9', pid])
89 except shell_utils.CommandFailedException as e: 106 except shell_utils.CommandFailedException as e:
90 print e 107 print e
91 else: 108 else:
92 print 'Refusing to kill self.' 109 print 'Refusing to kill self.'
93 110
94 print 'writing %s: %s' % (SKP_VERSION_FILE, skp_version) 111 print 'writing %s: %s' % (SKP_VERSION_FILE, skp_version)
95 with open(SKP_VERSION_FILE, 'w') as f: 112 with open(SKP_VERSION_FILE, 'w') as f:
96 f.write(str(skp_version)) 113 f.write(str(skp_version))
97 114
98 115
99 if '__main__' == __name__: 116 if '__main__' == __name__:
100 if len(sys.argv) != 3: 117 if len(sys.argv) != 3:
101 print >> sys.stderr, 'USAGE: %s <chrome src path> <browser executable>' 118 print >> sys.stderr, 'USAGE: %s <chrome src path> <browser executable>'
102 sys.exit(1) 119 sys.exit(1)
103 main(*sys.argv[1:]) 120 main(*sys.argv[1:])
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698