| OLD | NEW |
| (Empty) |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 # Use of this source code is governed by a BSD-style license that can be | |
| 3 # found in the LICENSE file. | |
| 4 | |
| 5 # This file has been copied from | |
| 6 # https://chromium.googlesource.com/chromium/src/+/master/tools/perf/benchmarks/
repaint.py | |
| 7 # and modified locally to support CT pagesets. Hopefully one day this file | |
| 8 # will live in telemetry codebase instead. | |
| 9 | |
| 10 from benchmarks import silk_flags | |
| 11 from benchmarks import skpicture_printer | |
| 12 from measurements import smoothness | |
| 13 import page_sets | |
| 14 from telemetry import benchmark | |
| 15 | |
| 16 | |
| 17 class _Repaint(benchmark.Benchmark): | |
| 18 @classmethod | |
| 19 def AddBenchmarkCommandLineArgs(cls, parser): | |
| 20 parser.add_option('--mode', type='string', | |
| 21 default='viewport', | |
| 22 help='Invalidation mode. ' | |
| 23 'Supported values: fixed_size, layer, random, viewport.') | |
| 24 parser.add_option('--width', type='int', | |
| 25 default=None, | |
| 26 help='Width of invalidations for fixed_size mode.') | |
| 27 parser.add_option('--height', type='int', | |
| 28 default=None, | |
| 29 help='Height of invalidations for fixed_size mode.') | |
| 30 parser.add_option('--page-set-name', action='store', type='string') | |
| 31 parser.add_option('--page-set-base-dir', action='store', type='string') | |
| 32 | |
| 33 def CreateUserStorySet(self, options): | |
| 34 page_set_class = skpicture_printer._MatchPageSetName( | |
| 35 options.page_set_name, options.page_set_base_dir) | |
| 36 return page_set_class() | |
| 37 | |
| 38 def CreatePageTest(self, options): | |
| 39 return smoothness.Repaint() | |
| 40 | |
| 41 | |
| 42 @benchmark.Disabled | |
| 43 class RepaintCTPages(_Repaint): | |
| 44 test = smoothness.Repaint | |
| 45 | |
| 46 @classmethod | |
| 47 def ProcessCommandLineArgs(cls, parser, args): | |
| 48 if not args.page_set_name: | |
| 49 parser.error('Please specify --page-set-name') | |
| 50 if not args.page_set_base_dir: | |
| 51 parser.error('Please specify --page-set-base-dir') | |
| 52 | |
| 53 def CreateStorySet(self, options): | |
| 54 page_set_class = skpicture_printer._MatchPageSetName( | |
| 55 options.page_set_name, options.page_set_base_dir) | |
| 56 return page_set_class() | |
| OLD | NEW |