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