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 telemetry
import benchmark
7 from measurements
import tab_switching
11 @benchmark.Enabled('has tabs')
12 @benchmark.Disabled('android') # http://crbug.com/460084
13 class TabSwitchingTop10(benchmark
.Benchmark
):
14 """This test records the MPArch.RWH_TabSwitchPaintDuration histogram.
16 The histogram is a measure of the time between when a tab was requested to be
17 shown, and when first paint occurred. The script opens 10 pages in different
18 tabs, waits for them to load, and then switches to each tab and records the
19 metric. The pages were chosen from Alexa top ranking sites.
21 test
= tab_switching
.TabSwitching
22 page_set
= page_sets
.Top10PageSet
26 return 'tab_switching.top_10'
29 @benchmark.Enabled('has tabs')
30 @benchmark.Disabled('android') # http://crbug.com/460084
31 class TabSwitchingTypical25(benchmark
.Benchmark
):
32 """This test records the MPArch.RWH_TabSwitchPaintDuration histogram.
34 The histogram is a measure of the time between when a tab was requested to be
35 shown, and when first paint occurred. The script opens 25 pages in different
36 tabs, waits for them to load, and then switches to each tab and records the
37 metric. The pages were chosen from Alexa top ranking sites.
39 test
= tab_switching
.TabSwitching
41 def CreatePageSet(self
, options
):
42 return page_sets
.Typical25PageSet(run_no_page_interactions
=True)
46 return 'tab_switching.typical_25'
49 @benchmark.Disabled('android') # http://crbug.com/460084
50 @benchmark.Enabled('has tabs')
51 class TabSwitchingFiveBlankTabs(benchmark
.Benchmark
):
52 """This test records the MPArch.RWH_TabSwitchPaintDuration histogram.
54 The histogram is a measure of the time between when a tab was requested to be
55 shown, and when first paint occurred. The script opens 5 blank pages in
56 different tabs, waits for them to load, and then switches to each tab and
57 records the metric. Blank pages are use to detect unnecessary idle wakeups.
59 test
= tab_switching
.TabSwitching
60 page_set
= page_sets
.FiveBlankPagesPageSet
61 options
= {'pageset_repeat': 10}
65 return 'tab_switching.five_blank_pages'
68 @benchmark.Enabled('has tabs')
69 @benchmark.Disabled('android') # http://crbug.com/460084
70 class TabSwitchingToughEnergyCases(benchmark
.Benchmark
):
71 """This test records the MPArch.RWH_TabSwitchPaintDuration histogram.
73 The histogram is a measure of the time between when a tab was requested to be
74 shown, and when first paint occurred. The script opens each page in a
75 different tab, waits for them to load, and then switches to each tab and
76 records the metric. The pages were written by hand to stress energy usage.
78 test
= tab_switching
.TabSwitching
79 page_set
= page_sets
.ToughEnergyCasesPageSet
80 options
= {'pageset_repeat': 10}
84 return 'tab_switching.tough_energy_cases'
87 @benchmark.Enabled('has tabs')
88 @benchmark.Disabled('android') # http://crbug.com/460084
89 class TabSwitchingToughImageCases(benchmark
.Benchmark
):
90 """This test records the MPArch.RWH_TabSwitchPaintDuration histogram.
92 The histogram is a measure of the time between when a tab was requested to be
93 shown, and when first paint occurred. The script opens each page in different
94 tabs, waits for them to load, and then switches to each tab and records the
95 metric. The pages were chosen by hand to stress the image decoding system.
97 test
= tab_switching
.TabSwitching
98 page_set
= page_sets
.ToughImageCasesPageSet
102 return 'tab_switching.tough_image_cases'
105 @benchmark.Disabled
# Just for local testing, not on waterfall.
106 class TabSwitchingFlashEnergyCases(benchmark
.Benchmark
):
107 test
= tab_switching
.TabSwitching
108 page_set
= page_sets
.FlashEnergyCasesPageSet
109 options
= {'pageset_repeat': 10}
112 return 'tab_switching.flash_energy_cases'