Chromium Code Reviews| Index: chrome/test/media_router/telemetry/benchmarks/media_router_benchmark.py |
| diff --git a/chrome/test/media_router/telemetry/benchmarks/media_router_benchmark.py b/chrome/test/media_router/telemetry/benchmarks/media_router_benchmark.py |
| index 78356cee045301c2dada7afcd6277263bc60422d..050a5fc6bc989fe22576cbe977145413f4b74a23 100644 |
| --- a/chrome/test/media_router/telemetry/benchmarks/media_router_benchmark.py |
| +++ b/chrome/test/media_router/telemetry/benchmarks/media_router_benchmark.py |
| @@ -9,7 +9,7 @@ from core import path_util |
| from telemetry.timeline import tracing_category_filter |
| from telemetry.web_perf import timeline_based_measurement |
| -from benchmarks.pagesets import media_router_pages |
| +from benchmarks.pagesets import media_router_perf_pages |
| from benchmarks import media_router_measurements |
| from benchmarks import media_router_timeline_metric |
| @@ -17,26 +17,32 @@ from benchmarks import media_router_timeline_metric |
| class _BaseCastBenchmark(perf_benchmark.PerfBenchmark): |
| options = {'page_repeat': 6} |
| - page_set = media_router_pages.MediaRouterPageSet |
| + page_set = media_router_perf_pages.MediaRouterDailogPageSet |
| def SetExtraBrowserOptions(self, options): |
| options.clear_sytem_cache_for_browser_and_profile_on_start = True |
| + # This flag is required for chrome.runtime. |
| + options.disable_component_extensions_with_background_pages = False |
|
mark a. foltz
2016/04/04 20:25:06
Will running additional background pages affect te
Lei Lei
2016/04/13 00:22:42
Yes, I removed it. I just found this flag is not r
|
| + # This flag is required to enable the communication between the page and |
| + # the test extension. |
| + options.disable_background_networking = False |
| + |
| # TODO: find a better way to find extension location. |
| options.AppendExtraBrowserArgs([ |
| - '--load-extension=' + os.path.join(path_util.GetChromiumSrcDir(), 'out', |
| - 'Release', 'mr_extension', 'release'), |
| + '--load-extension=' + ','.join([ |
| + os.path.join(path_util.GetChromiumSrcDir(), 'out', |
| + 'Release', 'mr_extension', 'release'), |
| + os.path.join(path_util.GetChromiumSrcDir(), 'out', |
| + 'Release', 'media_router', 'test_extension')]), |
| '--whitelisted-extension-id=enhhojjnijigcajfphajepfemndkmdlo', |
| '--media-router=1', |
| - '--enable-stats-collection-bindings' |
| + '--enable-stats-collection-bindings', |
| + '--show-component-extension-options', |
| + '--enable-logging=stderr' |
|
mark a. foltz
2016/04/04 20:25:06
Will logging affect the test performance?
Lei Lei
2016/04/13 00:22:42
Yes, I removed it.
|
| ]) |
| - @classmethod |
| - def ValueCanBeAddedPredicate(cls, value, is_first_result): |
| - """Only drops the first result.""" |
| - return not is_first_result |
| - |
| -class TraceEventCaseBenckmark(_BaseCastBenchmark): |
| +class TraceEventCastBenckmark(_BaseCastBenchmark): |
| def CreateTimelineBasedMeasurementOptions(self): |
| media_router_category = 'media_router' |
| @@ -52,14 +58,35 @@ class TraceEventCaseBenckmark(_BaseCastBenchmark): |
| def Name(cls): |
| return 'media_router.dialog.latency.tracing' |
| + @classmethod |
| + def ValueCanBeAddedPredicate(cls, value, is_first_result): |
| + """Only drops the first result.""" |
| + return not is_first_result |
| + |
| -class HistogramCaseBenckmark(_BaseCastBenchmark): |
| +class HistogramCastBenckmark(_BaseCastBenchmark): |
| def CreatePageTest(self, options): |
| - return media_router_measurements.MediaRouterPageTest() |
| + return media_router_measurements.MediaRouterDialogTest() |
| @classmethod |
| def Name(cls): |
| return 'media_router.dialog.latency.histogram' |
| + @classmethod |
| + def ValueCanBeAddedPredicate(cls, value, is_first_result): |
| + """Only drops the first result.""" |
| + return not is_first_result |
| + |
| + |
| +class CPUMemoryCastBenckmark(_BaseCastBenchmark): |
| + options = {'page_repeat': 1} |
| + page_set = media_router_perf_pages.MediaRouterCPUMemoryPageSet |
| + |
| + def CreatePageTest(self, options): |
| + return media_router_measurements.MediaRouterCPUMemoryTest() |
| + |
| + @classmethod |
| + def Name(cls): |
| + return 'media_router.cpu_memory' |