Chromium Code Reviews| Index: tools/perf/benchmarks/power.py |
| diff --git a/tools/perf/benchmarks/power.py b/tools/perf/benchmarks/power.py |
| index 1d84778b1a01546ed5a3a4c42cefcc69284e8c59..30524d7bfc2b5f637e9570466173b4faad0bda68 100644 |
| --- a/tools/perf/benchmarks/power.py |
| +++ b/tools/perf/benchmarks/power.py |
| @@ -147,17 +147,27 @@ class PowerTop25(perf_benchmark.PerfBenchmark): |
| return 'power.top_25' |
| def CreateStorySet(self, _): |
| - # Exclude techcrunch.com. It is not suitable for this benchmark because it |
| - # does not consistently become quiescent within 60 seconds. |
| stories = self.page_set() |
| - found = next((x for x in stories if 'techcrunch.com' in x.url), None) |
| - if found: |
| - stories.RemoveStory(found) |
| + to_remove = [x for x in stories if self.IsPageNotQuiescent(x.url)] |
| + for story in to_remove: |
| + stories.RemoveStory(story) |
| return stories |
| + @staticmethod |
| + def IsPageNotQuiescent(page_url): |
| + # Exclude sites not suitable for this benchmark because they do not |
| + # consistently become quiescent within 60 seconds. |
| + non_quiescent_urls = [ |
| + 'techcrunch.com', |
|
petrcermak
2016/10/03 08:07:51
nit: this should be indented only 2 spaces (-2)
ericrk
2016/10/03 17:47:27
Done.
|
| + 'docs.google.com', |
| + 'plus.google.com' |
| + ] |
| + |
| + return any(url in page_url for url in non_quiescent_urls) |
| + |
| @benchmark.Enabled('mac') |
| -class PowerGpuRasterizationTop25(perf_benchmark.PerfBenchmark): |
| +class PowerGpuRasterizationTop25(PowerTop25): |
| """Top 25 quiescent power test with GPU rasterization enabled.""" |
| tag = 'gpu_rasterization' |
| test = power.QuiescentPower |
|
petrcermak
2016/10/03 08:07:51
you don't need the 'test' and 'page_set' fields he
ericrk
2016/10/03 17:47:27
Done.
|
| @@ -171,15 +181,6 @@ class PowerGpuRasterizationTop25(perf_benchmark.PerfBenchmark): |
| def Name(cls): |
| return 'power.gpu_rasterization.top_25' |
| - def CreateStorySet(self, _): |
| - # Exclude techcrunch.com. It is not suitable for this benchmark because it |
| - # does not consistently become quiescent within 60 seconds. |
| - stories = self.page_set() |
| - found = next((x for x in stories if 'techcrunch.com' in x.url), None) |
| - if found: |
| - stories.RemoveStory(found) |
| - return stories |
| - |
| @benchmark.Enabled('mac') |
| class PowerScrollingTrivialPage(perf_benchmark.PerfBenchmark): |