OLD | NEW |
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 chrome_remote_control import multi_page_benchmark |
9 | 9 |
10 _JS = 'chrome.gpuBenchmarking.printToSkPicture("{0}");' | 10 _JS = 'chrome.gpuBenchmarking.printToSkPicture("{0}");' |
(...skipping 10 matching lines...) Expand all Loading... |
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) |
31 | |
32 def Main(): | |
33 return multi_page_benchmark.Main(SkPicturePrinter()) | |
OLD | NEW |