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

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

Issue 12278015: [Telemetry] Reorganize everything. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Re-add shebangs. Created 7 years, 10 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 | Annotate | Revision Log
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 import os 4 import os
5 5
6 from telemetry import multi_page_benchmark 6 from telemetry.page import multi_page_benchmark
7 7
8 _JS = 'chrome.gpuBenchmarking.printToSkPicture("{0}");' 8 _JS = 'chrome.gpuBenchmarking.printToSkPicture("{0}");'
9 9
10 class SkPicturePrinter(multi_page_benchmark.MultiPageBenchmark): 10 class SkPicturePrinter(multi_page_benchmark.MultiPageBenchmark):
11 def AddCommandLineOptions(self, parser): 11 def AddCommandLineOptions(self, parser):
12 parser.add_option('-o', '--outdir', help='Output directory') 12 parser.add_option('-o', '--outdir', help='Output directory')
13 13
14 def CustomizeBrowserOptions(self, options): 14 def CustomizeBrowserOptions(self, options):
15 options.extra_browser_args.extend(['--enable-gpu-benchmarking', 15 options.extra_browser_args.extend(['--enable-gpu-benchmarking',
16 '--no-sandbox']) 16 '--no-sandbox'])
17 17
18 def MeasurePage(self, page, tab, results): 18 def MeasurePage(self, page, tab, results):
19 if self.options.outdir is not None: 19 if self.options.outdir is not None:
20 outpath = os.path.join(self.options.outdir, page.url_as_file_safe_name) 20 outpath = os.path.join(self.options.outdir, page.url_as_file_safe_name)
21 outpath = os.path.abspath(outpath) 21 outpath = os.path.abspath(outpath)
22 # Replace win32 path separator char '\' with '\\'. 22 # Replace win32 path separator char '\' with '\\'.
23 js = _JS.format(outpath.replace('\\', '\\\\')) 23 js = _JS.format(outpath.replace('\\', '\\\\'))
24 tab.EvaluateJavaScript(js) 24 tab.EvaluateJavaScript(js)
25 results.Add('output_path', 'path', outpath) 25 results.Add('output_path', 'path', outpath)
OLDNEW
« no previous file with comments | « tools/perf/perf_tools/robohornetpro.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