OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 from core import perf_benchmark | 5 from core import perf_benchmark |
6 | 6 |
7 from benchmarks import silk_flags | 7 from benchmarks import silk_flags |
8 from measurements import power | 8 from measurements import power |
9 from telemetry import benchmark | 9 from telemetry import benchmark |
10 import page_sets | 10 import page_sets |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 return 'power.top_25' | 63 return 'power.top_25' |
64 | 64 |
65 def CreateUserStorySet(self, _): | 65 def CreateUserStorySet(self, _): |
66 # Exclude techcrunch.com. It is not suitable for this benchmark because it | 66 # Exclude techcrunch.com. It is not suitable for this benchmark because it |
67 # does not consistently become quiescent within 60 seconds. | 67 # does not consistently become quiescent within 60 seconds. |
68 user_stories = self.page_set() | 68 user_stories = self.page_set() |
69 found = next((x for x in user_stories if 'techcrunch.com' in x.url), None) | 69 found = next((x for x in user_stories if 'techcrunch.com' in x.url), None) |
70 if found: | 70 if found: |
71 user_stories.RemoveUserStory(found) | 71 user_stories.RemoveUserStory(found) |
72 return user_stories | 72 return user_stories |
| 73 |
| 74 |
| 75 @benchmark.Enabled('linux', 'mac', 'win', 'chromeos') |
| 76 class PowerPPSControlDisabled(perf_benchmark.PerfBenchmark): |
| 77 """A single page with a small-ish non-essential plugin. In this test, Plugin |
| 78 Power Saver (PPS) is disabled, so the plugin should continue animating and |
| 79 taking power.""" |
| 80 test = power.QuiescentPower |
| 81 page_set = page_sets.PluginPowerSaverPageSet |
| 82 |
| 83 def SetExtraBrowserOptions(self, options): |
| 84 options.AppendExtraBrowserArgs(['--disable-plugin-power-saver']) |
| 85 |
| 86 @classmethod |
| 87 def Name(cls): |
| 88 return 'power.pps_control_disabled' |
| 89 |
| 90 |
| 91 @benchmark.Enabled('linux', 'mac', 'win', 'chromeos') |
| 92 class PowerPPSControlEnabled(perf_benchmark.PerfBenchmark): |
| 93 """A single page with a small-ish non-essential plugin. In this test, Plugin |
| 94 Power Saver (PPS) is enabled, so the plugin should be throttled (idle with a |
| 95 "Click to play" button).""" |
| 96 test = power.QuiescentPower |
| 97 page_set = page_sets.PluginPowerSaverPageSet |
| 98 |
| 99 def SetExtraBrowserOptions(self, options): |
| 100 options.AppendExtraBrowserArgs(['--enable-plugin-power-saver']) |
| 101 |
| 102 @classmethod |
| 103 def Name(cls): |
| 104 return 'power.pps_control_enabled' |
| 105 |
| 106 |
| 107 @benchmark.Enabled('linux', 'mac', 'win', 'chromeos') |
| 108 class PowerThrottledPlugins(perf_benchmark.PerfBenchmark): |
| 109 """Tests that pages with flash ads take more power without Plugin Power Saver |
| 110 (PPS) throttling them.""" |
| 111 test = power.QuiescentPower |
| 112 page_set = page_sets.ThrottledPluginsPageSet |
| 113 |
| 114 def SetExtraBrowserOptions(self, options): |
| 115 options.AppendExtraBrowserArgs(['--disable-plugin-power-saver']) |
| 116 |
| 117 @classmethod |
| 118 def Name(cls): |
| 119 return 'power.throttled_plugins_pps_disabled' |
| 120 |
| 121 |
| 122 @benchmark.Enabled('linux', 'mac', 'win', 'chromeos') |
| 123 class PowerThrottledPluginsPPS(perf_benchmark.PerfBenchmark): |
| 124 """Tests that pages with flash ads take less power with Plugin Power Saver |
| 125 (PPS) enabled to throttle them.""" |
| 126 test = power.QuiescentPower |
| 127 page_set = page_sets.ThrottledPluginsPageSet |
| 128 |
| 129 def SetExtraBrowserOptions(self, options): |
| 130 options.AppendExtraBrowserArgs(['--enable-plugin-power-saver']) |
| 131 |
| 132 @classmethod |
| 133 def Name(cls): |
| 134 return 'power.throttled_plugins_pps_enabled' |
OLD | NEW |