cc: Make a FakeResourceProvider and use it in tests to construct.
[chromium-blink-merge.git] / tools / perf / benchmarks / repaint.py
blob5d0b6e0e0caf073c318b3a177767eb6977b8ed55
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.
5 from core import perf_benchmark
7 from benchmarks import silk_flags
8 from measurements import smoothness
9 from telemetry import benchmark
10 import page_sets
13 class _Repaint(perf_benchmark.PerfBenchmark):
14 @classmethod
15 def AddBenchmarkCommandLineArgs(cls, parser):
16 parser.add_option('--mode', type='string',
17 default='viewport',
18 help='Invalidation mode. '
19 'Supported values: fixed_size, layer, random, viewport.')
20 parser.add_option('--width', type='int',
21 default=None,
22 help='Width of invalidations for fixed_size mode.')
23 parser.add_option('--height', type='int',
24 default=None,
25 help='Height of invalidations for fixed_size mode.')
27 @classmethod
28 def Name(cls):
29 return 'repaint'
31 def CreateUserStorySet(self, options):
32 return page_sets.KeyMobileSitesRepaintPageSet(
33 options.mode, options.width, options.height)
35 def CreatePageTest(self, options):
36 return smoothness.Repaint()
38 @benchmark.Enabled('android')
39 class RepaintKeyMobileSites(_Repaint):
40 """Measures repaint performance on the key mobile sites.
42 http://www.chromium.org/developers/design-documents/rendering-benchmarks"""
44 @classmethod
45 def Name(cls):
46 return 'repaint.key_mobile_sites_repaint'
49 @benchmark.Enabled('android')
50 class RepaintGpuRasterizationKeyMobileSites(_Repaint):
51 """Measures repaint performance on the key mobile sites with forced GPU
52 rasterization.
54 http://www.chromium.org/developers/design-documents/rendering-benchmarks"""
55 tag = 'gpu_rasterization'
56 def SetExtraBrowserOptions(self, options):
57 silk_flags.CustomizeBrowserOptionsForGpuRasterization(options)
59 @classmethod
60 def Name(cls):
61 return 'repaint.gpu_rasterization.key_mobile_sites_repaint'