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

Side by Side Diff: tools/perf/perf_tools/skpicture_printer.py

Issue 11361165: [chrome_remote_control] Rename chrome_remote_control to telemetry. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 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 import os 5 import os
6 import re 6 import re
7 7
8 from chrome_remote_control import multi_page_benchmark 8 from telemetry import multi_page_benchmark
9 9
10 _JS = 'chrome.gpuBenchmarking.printToSkPicture("{0}");' 10 _JS = 'chrome.gpuBenchmarking.printToSkPicture("{0}");'
11 11
12 class SkPicturePrinter(multi_page_benchmark.MultiPageBenchmark): 12 class SkPicturePrinter(multi_page_benchmark.MultiPageBenchmark):
13 def AddOptions(self, parser): 13 def AddOptions(self, parser):
14 parser.add_option('-o', '--outdir', help='Output directory') 14 parser.add_option('-o', '--outdir', help='Output directory')
15 15
16 def CustomizeBrowserOptions(self, options): 16 def CustomizeBrowserOptions(self, options):
17 options.extra_browser_args.extend(['--enable-gpu-benchmarking', 17 options.extra_browser_args.extend(['--enable-gpu-benchmarking',
18 '--no-sandbox']) 18 '--no-sandbox'])
19 19
20 def MeasurePage(self, page, tab, results): 20 def MeasurePage(self, page, tab, results):
21 # Derive output path from the URL. The pattern just replaces all special 21 # Derive output path from the URL. The pattern just replaces all special
22 # characters in the url with underscore. 22 # characters in the url with underscore.
23 outpath = re.sub('://|[.~!*\:@&=+$,/?%#]', '_', page.url) 23 outpath = re.sub('://|[.~!*\:@&=+$,/?%#]', '_', page.url)
24 if self.options.outdir is not None: 24 if self.options.outdir is not None:
25 outpath = os.path.join(self.options.outdir, outpath) 25 outpath = os.path.join(self.options.outdir, outpath)
26 outpath = os.path.abspath(outpath) 26 outpath = os.path.abspath(outpath)
27 # Replace win32 path separator char '\' with '\\'. 27 # Replace win32 path separator char '\' with '\\'.
28 js = _JS.format(outpath.replace('\\', '\\\\')) 28 js = _JS.format(outpath.replace('\\', '\\\\'))
29 tab.runtime.Evaluate(js) 29 tab.runtime.Evaluate(js)
30 results.Add('output_path', 'path', outpath) 30 results.Add('output_path', 'path', outpath)
OLDNEW
« no previous file with comments | « tools/perf/perf_tools/scrolling_benchmark_unittest.py ('k') | tools/perf/perf_tools/skpicture_printer_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698