| 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 tracing_category_filter | 9 from telemetry.timeline import tracing_category_filter |
| 10 from telemetry.web_perf import timeline_based_measurement | 10 from telemetry.web_perf import timeline_based_measurement |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 options = {'page_repeat': 1} | 79 options = {'page_repeat': 1} |
| 80 | 80 |
| 81 page_set = media_router_perf_pages.MediaRouterCPUMemoryPageSet | 81 page_set = media_router_perf_pages.MediaRouterCPUMemoryPageSet |
| 82 | 82 |
| 83 def CreatePageTest(self, options): | 83 def CreatePageTest(self, options): |
| 84 return media_router_measurements.MediaRouterCPUMemoryTest() | 84 return media_router_measurements.MediaRouterCPUMemoryTest() |
| 85 | 85 |
| 86 @classmethod | 86 @classmethod |
| 87 def Name(cls): | 87 def Name(cls): |
| 88 return 'media_router.cpu_memory' | 88 return 'media_router.cpu_memory' |
| 89 |
| 90 |
| 91 class CPUMemoryBenckmark(perf_benchmark.PerfBenchmark): |
| 92 options = {'page_repeat': 1} |
| 93 |
| 94 page_set = media_router_perf_pages.CPUMemoryPageSet |
| 95 |
| 96 def SetExtraBrowserOptions(self, options): |
| 97 options.clear_sytem_cache_for_browser_and_profile_on_start = True |
| 98 # This flag is required to enable the communication between the page and |
| 99 # the test extension. |
| 100 options.disable_background_networking = False |
| 101 |
| 102 # TODO: find a better way to find extension location. |
| 103 options.AppendExtraBrowserArgs([ |
| 104 '--load-extension=' + |
| 105 os.path.join(path_util.GetChromiumSrcDir(), 'out', |
| 106 'Release', 'media_router', 'test_extension'), |
| 107 '--enable-stats-collection-bindings' |
| 108 ]) |
| 109 |
| 110 def CreatePageTest(self, options): |
| 111 return media_router_measurements.MediaRouterCPUMemoryTest() |
| 112 |
| 113 @classmethod |
| 114 def Name(cls): |
| 115 return 'media_router.cpu_memory.no_media_router' |
| OLD | NEW |