| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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 measurements import tab_switching | 7 from measurements import tab_switching |
| 8 import page_sets | 8 import page_sets |
| 9 from telemetry import benchmark | 9 from telemetry import benchmark |
| 10 | 10 |
| 11 | 11 |
| 12 @benchmark.Enabled('has tabs') | 12 @benchmark.Enabled('has tabs') |
| 13 @benchmark.Disabled('android') # http://crbug.com/460084 | |
| 14 @benchmark.Disabled('mac-reference') # http://crbug.com/634378 | |
| 15 class TabSwitchingTop10(perf_benchmark.PerfBenchmark): | |
| 16 """This test records the MPArch.RWH_TabSwitchPaintDuration histogram. | |
| 17 | |
| 18 The histogram is a measure of the time between when a tab was requested to be | |
| 19 shown, and when first paint occurred. The script opens 10 pages in different | |
| 20 tabs, waits for them to load, and then switches to each tab and records the | |
| 21 metric. The pages were chosen from Alexa top ranking sites. | |
| 22 """ | |
| 23 test = tab_switching.TabSwitching | |
| 24 page_set = page_sets.Top10PageSet | |
| 25 | |
| 26 @classmethod | |
| 27 def Name(cls): | |
| 28 return 'tab_switching.top_10' | |
| 29 | |
| 30 @classmethod | |
| 31 def ShouldTearDownStateAfterEachStoryRun(cls): | |
| 32 return False | |
| 33 | |
| 34 | |
| 35 @benchmark.Enabled('has tabs') | |
| 36 @benchmark.Disabled('mac-reference') # http://crbug.com/612774 | 13 @benchmark.Disabled('mac-reference') # http://crbug.com/612774 |
| 37 @benchmark.Disabled('android') # http://crbug.com/460084 | 14 @benchmark.Disabled('android') # http://crbug.com/460084 |
| 38 class TabSwitchingTypical25(perf_benchmark.PerfBenchmark): | 15 class TabSwitchingTypical25(perf_benchmark.PerfBenchmark): |
| 39 """This test records the MPArch.RWH_TabSwitchPaintDuration histogram. | 16 """This test records the MPArch.RWH_TabSwitchPaintDuration histogram. |
| 40 | 17 |
| 41 The histogram is a measure of the time between when a tab was requested to be | 18 The histogram is a measure of the time between when a tab was requested to be |
| 42 shown, and when first paint occurred. The script opens 25 pages in different | 19 shown, and when first paint occurred. The script opens 25 pages in different |
| 43 tabs, waits for them to load, and then switches to each tab and records the | 20 tabs, waits for them to load, and then switches to each tab and records the |
| 44 metric. The pages were chosen from Alexa top ranking sites. | 21 metric. The pages were chosen from Alexa top ranking sites. |
| 45 """ | 22 """ |
| 46 test = tab_switching.TabSwitching | 23 test = tab_switching.TabSwitching |
| 47 | 24 |
| 48 def CreateStorySet(self, options): | 25 def CreateStorySet(self, options): |
| 49 return page_sets.Typical25PageSet(run_no_page_interactions=True) | 26 return page_sets.Typical25PageSet(run_no_page_interactions=True) |
| 50 | 27 |
| 51 @classmethod | 28 @classmethod |
| 52 def Name(cls): | 29 def Name(cls): |
| 53 return 'tab_switching.typical_25' | 30 return 'tab_switching.typical_25' |
| 54 | 31 |
| 55 @classmethod | 32 @classmethod |
| 56 def ShouldTearDownStateAfterEachStoryRun(cls): | 33 def ShouldTearDownStateAfterEachStoryRun(cls): |
| 57 return False | 34 return False |
| 58 | |
| 59 | |
| 60 @benchmark.Disabled('android') # http://crbug.com/460084 | |
| 61 @benchmark.Disabled('mac-reference') # http://crbug.com/634360 | |
| 62 @benchmark.Enabled('has tabs') | |
| 63 class TabSwitchingFiveBlankTabs(perf_benchmark.PerfBenchmark): | |
| 64 """This test records the MPArch.RWH_TabSwitchPaintDuration histogram. | |
| 65 | |
| 66 The histogram is a measure of the time between when a tab was requested to be | |
| 67 shown, and when first paint occurred. The script opens 5 blank pages in | |
| 68 different tabs, waits for them to load, and then switches to each tab and | |
| 69 records the metric. Blank pages are use to detect unnecessary idle wakeups. | |
| 70 """ | |
| 71 test = tab_switching.TabSwitching | |
| 72 page_set = page_sets.FiveBlankPagesPageSet | |
| 73 options = {'pageset_repeat': 10} | |
| 74 | |
| 75 @classmethod | |
| 76 def Name(cls): | |
| 77 return 'tab_switching.five_blank_pages' | |
| 78 | |
| 79 @classmethod | |
| 80 def ShouldTearDownStateAfterEachStoryRun(cls): | |
| 81 return False | |
| 82 | |
| 83 | |
| 84 @benchmark.Enabled('has tabs') | |
| 85 # http://crbug.com/460084, http://crbug.com/488067, http://crbug.com/634347 | |
| 86 # win: http://crbug.com/677311 | |
| 87 @benchmark.Disabled('android', 'linux', 'mac-reference', 'win') | |
| 88 class TabSwitchingToughEnergyCases(perf_benchmark.PerfBenchmark): | |
| 89 """This test records the MPArch.RWH_TabSwitchPaintDuration histogram. | |
| 90 | |
| 91 The histogram is a measure of the time between when a tab was requested to be | |
| 92 shown, and when first paint occurred. The script opens each page in a | |
| 93 different tab, waits for them to load, and then switches to each tab and | |
| 94 records the metric. The pages were written by hand to stress energy usage. | |
| 95 """ | |
| 96 test = tab_switching.TabSwitching | |
| 97 page_set = page_sets.ToughEnergyCasesPageSet | |
| 98 options = {'pageset_repeat': 10} | |
| 99 | |
| 100 @classmethod | |
| 101 def Name(cls): | |
| 102 return 'tab_switching.tough_energy_cases' | |
| 103 | |
| 104 @classmethod | |
| 105 def ShouldTearDownStateAfterEachStoryRun(cls): | |
| 106 return False | |
| 107 | |
| 108 | |
| 109 @benchmark.Enabled('has tabs') | |
| 110 @benchmark.Disabled('android') # http://crbug.com/460084 | |
| 111 class TabSwitchingToughImageCases(perf_benchmark.PerfBenchmark): | |
| 112 """This test records the MPArch.RWH_TabSwitchPaintDuration histogram. | |
| 113 | |
| 114 The histogram is a measure of the time between when a tab was requested to be | |
| 115 shown, and when first paint occurred. The script opens each page in different | |
| 116 tabs, waits for them to load, and then switches to each tab and records the | |
| 117 metric. The pages were chosen by hand to stress the image decoding system. | |
| 118 """ | |
| 119 test = tab_switching.TabSwitching | |
| 120 page_set = page_sets.ToughImageCasesPageSet | |
| 121 | |
| 122 @classmethod | |
| 123 def Name(cls): | |
| 124 return 'tab_switching.tough_image_cases' | |
| 125 | |
| 126 @classmethod | |
| 127 def ShouldTearDownStateAfterEachStoryRun(cls): | |
| 128 return False | |
| OLD | NEW |