| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 import os | 5 import os |
| 6 from telemetry import benchmark | 6 from telemetry import benchmark |
| 7 from core import perf_benchmark | 7 from core import perf_benchmark |
| 8 from core import path_util | 8 from core import path_util |
| 9 from telemetry.timeline import chrome_trace_category_filter | 9 from telemetry.timeline import chrome_trace_category_filter |
| 10 from telemetry.web_perf import timeline_based_measurement | 10 from telemetry.web_perf import timeline_based_measurement |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 | 73 |
| 74 @classmethod | 74 @classmethod |
| 75 def ValueCanBeAddedPredicate(cls, value, is_first_result): | 75 def ValueCanBeAddedPredicate(cls, value, is_first_result): |
| 76 """Only drops the first result.""" | 76 """Only drops the first result.""" |
| 77 return not is_first_result | 77 return not is_first_result |
| 78 | 78 |
| 79 | 79 |
| 80 class CPUMemoryCastBenckmark(_BaseCastBenchmark): | 80 class CPUMemoryCastBenckmark(_BaseCastBenchmark): |
| 81 """Benchmark for CPU and memory usage with Media Router.""" | 81 """Benchmark for CPU and memory usage with Media Router.""" |
| 82 | 82 |
| 83 options = {'page_repeat': 1} | 83 options = {'pageset_repeat': 1} |
| 84 | 84 |
| 85 page_set = media_router_perf_pages.MediaRouterCPUMemoryPageSet | 85 page_set = media_router_perf_pages.MediaRouterCPUMemoryPageSet |
| 86 | 86 |
| 87 def CreatePageTest(self, options): | 87 def CreatePageTest(self, options): |
| 88 return media_router_measurements.MediaRouterCPUMemoryTest() | 88 return media_router_measurements.MediaRouterCPUMemoryTest() |
| 89 | 89 |
| 90 @classmethod | 90 @classmethod |
| 91 def Name(cls): | 91 def Name(cls): |
| 92 return 'media_router.cpu_memory' | 92 return 'media_router.cpu_memory' |
| 93 | 93 |
| 94 | 94 |
| 95 class CPUMemoryBenckmark(perf_benchmark.PerfBenchmark): | 95 class CPUMemoryBenckmark(perf_benchmark.PerfBenchmark): |
| 96 """Benchmark for CPU and memory usage without Media Router.""" | 96 """Benchmark for CPU and memory usage without Media Router.""" |
| 97 | 97 |
| 98 options = {'page_repeat': 1} | 98 options = {'pageset_repeat': 1} |
| 99 | 99 |
| 100 page_set = media_router_perf_pages.CPUMemoryPageSet | 100 page_set = media_router_perf_pages.CPUMemoryPageSet |
| 101 | 101 |
| 102 def SetExtraBrowserOptions(self, options): | 102 def SetExtraBrowserOptions(self, options): |
| 103 options.clear_sytem_cache_for_browser_and_profile_on_start = True | 103 options.clear_sytem_cache_for_browser_and_profile_on_start = True |
| 104 # This flag is required to enable the communication between the page and | 104 # This flag is required to enable the communication between the page and |
| 105 # the test extension. | 105 # the test extension. |
| 106 options.disable_background_networking = False | 106 options.disable_background_networking = False |
| 107 options.AppendExtraBrowserArgs([ | 107 options.AppendExtraBrowserArgs([ |
| 108 '--load-extension=' + | 108 '--load-extension=' + |
| 109 os.path.join(path_util.GetChromiumSrcDir(), 'out', | 109 os.path.join(path_util.GetChromiumSrcDir(), 'out', |
| 110 'Release', 'media_router', 'test_extension'), | 110 'Release', 'media_router', 'test_extension'), |
| 111 '--media-router=0', | 111 '--media-router=0', |
| 112 '--enable-stats-collection-bindings' | 112 '--enable-stats-collection-bindings' |
| 113 ]) | 113 ]) |
| 114 | 114 |
| 115 def CreatePageTest(self, options): | 115 def CreatePageTest(self, options): |
| 116 return media_router_measurements.MediaRouterCPUMemoryTest() | 116 return media_router_measurements.MediaRouterCPUMemoryTest() |
| 117 | 117 |
| 118 @classmethod | 118 @classmethod |
| 119 def Name(cls): | 119 def Name(cls): |
| 120 return 'media_router.cpu_memory.no_media_router' | 120 return 'media_router.cpu_memory.no_media_router' |
| OLD | NEW |