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