Sort the imports of files in perf/benchmarks.
[chromium-blink-merge.git] / tools / perf / benchmarks / tab_switching.py
blob52a2196d37fa224200939a0d6adcea26cb99690a
1 # Copyright 2013 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 measurements import tab_switching
8 import page_sets
9 from telemetry import benchmark
12 @benchmark.Enabled('has tabs')
13 @benchmark.Disabled('android') # http://crbug.com/460084
14 class TabSwitchingTop10(perf_benchmark.PerfBenchmark):
15 """This test records the MPArch.RWH_TabSwitchPaintDuration histogram.
17 The histogram is a measure of the time between when a tab was requested to be
18 shown, and when first paint occurred. The script opens 10 pages in different
19 tabs, waits for them to load, and then switches to each tab and records the
20 metric. The pages were chosen from Alexa top ranking sites.
21 """
22 test = tab_switching.TabSwitching
23 page_set = page_sets.Top10PageSet
25 @classmethod
26 def Name(cls):
27 return 'tab_switching.top_10'
30 @benchmark.Enabled('has tabs')
31 @benchmark.Disabled('android') # http://crbug.com/460084
32 class TabSwitchingTypical25(perf_benchmark.PerfBenchmark):
33 """This test records the MPArch.RWH_TabSwitchPaintDuration histogram.
35 The histogram is a measure of the time between when a tab was requested to be
36 shown, and when first paint occurred. The script opens 25 pages in different
37 tabs, waits for them to load, and then switches to each tab and records the
38 metric. The pages were chosen from Alexa top ranking sites.
39 """
40 test = tab_switching.TabSwitching
42 def CreateStorySet(self, options):
43 return page_sets.Typical25PageSet(run_no_page_interactions=True)
45 @classmethod
46 def Name(cls):
47 return 'tab_switching.typical_25'
50 @benchmark.Disabled('android') # http://crbug.com/460084
51 @benchmark.Enabled('has tabs')
52 class TabSwitchingFiveBlankTabs(perf_benchmark.PerfBenchmark):
53 """This test records the MPArch.RWH_TabSwitchPaintDuration histogram.
55 The histogram is a measure of the time between when a tab was requested to be
56 shown, and when first paint occurred. The script opens 5 blank pages in
57 different tabs, waits for them to load, and then switches to each tab and
58 records the metric. Blank pages are use to detect unnecessary idle wakeups.
59 """
60 test = tab_switching.TabSwitching
61 page_set = page_sets.FiveBlankPagesPageSet
62 options = {'pageset_repeat': 10}
64 @classmethod
65 def Name(cls):
66 return 'tab_switching.five_blank_pages'
69 @benchmark.Enabled('has tabs')
70 # http://crbug.com/460084, http://crbug.com/488067
71 @benchmark.Disabled('android', 'linux')
72 class TabSwitchingToughEnergyCases(perf_benchmark.PerfBenchmark):
73 """This test records the MPArch.RWH_TabSwitchPaintDuration histogram.
75 The histogram is a measure of the time between when a tab was requested to be
76 shown, and when first paint occurred. The script opens each page in a
77 different tab, waits for them to load, and then switches to each tab and
78 records the metric. The pages were written by hand to stress energy usage.
79 """
80 test = tab_switching.TabSwitching
81 page_set = page_sets.ToughEnergyCasesPageSet
82 options = {'pageset_repeat': 10}
84 @classmethod
85 def Name(cls):
86 return 'tab_switching.tough_energy_cases'
89 @benchmark.Enabled('has tabs')
90 @benchmark.Disabled('android') # http://crbug.com/460084
91 class TabSwitchingToughImageCases(perf_benchmark.PerfBenchmark):
92 """This test records the MPArch.RWH_TabSwitchPaintDuration histogram.
94 The histogram is a measure of the time between when a tab was requested to be
95 shown, and when first paint occurred. The script opens each page in different
96 tabs, waits for them to load, and then switches to each tab and records the
97 metric. The pages were chosen by hand to stress the image decoding system.
98 """
99 test = tab_switching.TabSwitching
100 page_set = page_sets.ToughImageCasesPageSet
102 @classmethod
103 def Name(cls):
104 return 'tab_switching.tough_image_cases'
107 @benchmark.Disabled
108 class TabSwitchingFlashEnergyCases(perf_benchmark.PerfBenchmark):
109 test = tab_switching.TabSwitching
110 page_set = page_sets.FlashEnergyCasesPageSet
111 options = {'pageset_repeat': 10}
113 @classmethod
114 def Name(cls):
115 return 'tab_switching.flash_energy_cases'
118 @benchmark.Disabled
119 class TabSwitchingPluginPowerSaver(perf_benchmark.PerfBenchmark):
120 test = tab_switching.TabSwitching
121 page_set = page_sets.FlashEnergyCasesPageSet
122 options = {'pageset_repeat': 10}
124 def SetExtraBrowserOptions(self, options):
125 options.AppendExtraBrowserArgs(['--enable-plugin-power-saver'])
127 @classmethod
128 def Name(cls):
129 return 'tab_switching.plugin_power_saver'