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 power
9 from telemetry
import benchmark
13 @benchmark.Enabled('android')
14 class PowerAndroidAcceptance(perf_benchmark
.PerfBenchmark
):
15 """Android power acceptance test."""
17 page_set
= page_sets
.AndroidAcceptancePageSet
20 return 'power.android_acceptance'
23 @benchmark.Enabled('android')
24 class PowerTypical10Mobile(perf_benchmark
.PerfBenchmark
):
25 """Android typical 10 mobile power test."""
27 page_set
= page_sets
.Typical10MobilePageSet
30 return 'power.typical_10_mobile'
32 @benchmark.Enabled('android')
33 class PowerGpuRasterizationTypical10Mobile(perf_benchmark
.PerfBenchmark
):
34 """Measures power on key mobile sites with GPU rasterization."""
35 tag
= 'gpu_rasterization'
37 page_set
= page_sets
.Typical10MobilePageSet
39 def SetExtraBrowserOptions(self
, options
):
40 silk_flags
.CustomizeBrowserOptionsForGpuRasterization(options
)
44 return 'power.gpu_rasterization.typical_10_mobile'
46 @benchmark.Enabled('mac')
47 class PowerTop10(perf_benchmark
.PerfBenchmark
):
48 """Top 10 quiescent power test."""
49 test
= power
.QuiescentPower
50 page_set
= page_sets
.Top10PageSet
56 @benchmark.Enabled('mac')
57 class PowerTop25(perf_benchmark
.PerfBenchmark
):
58 """Top 25 quiescent power test."""
59 test
= power
.QuiescentPower
60 page_set
= page_sets
.Top25PageSet
65 def CreateUserStorySet(self
, _
):
66 # Exclude techcrunch.com. It is not suitable for this benchmark because it
67 # does not consistently become quiescent within 60 seconds.
68 user_stories
= self
.page_set()
69 found
= next((x
for x
in user_stories
if 'techcrunch.com' in x
.url
), None)
71 user_stories
.RemoveUserStory(found
)