Commit cdb1fbf9 authored by Annie Sullivan's avatar Annie Sullivan Committed by Commit Bot

Add support for --extra-chrome-categories to blink_perf.

Change-Id: I83c61b1f4f7fe33a47568779041d4a70fcefd401
Reviewed-on: https://chromium-review.googlesource.com/600833Reviewed-by: default avatarNed Nguyen <nednguyen@google.com>
Commit-Queue: Annie Sullivan <sullivan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491923}
parent 0f01d3b5
......@@ -140,6 +140,7 @@ class _BlinkPerfMeasurement(legacy_page_test.LegacyPageTest):
with open(os.path.join(os.path.dirname(__file__),
'blink_perf.js'), 'r') as f:
self._blink_perf_js = f.read()
self._extra_chrome_categories = None
def WillNavigateToPage(self, page, tab):
del tab # unused
......@@ -168,6 +169,8 @@ class _BlinkPerfMeasurement(legacy_page_test.LegacyPageTest):
browser_type = options.browser_options.browser_type
if browser_type and 'content-shell' in browser_type:
options.AppendExtraBrowserArgs('--expose-internals-for-testing')
if options.extra_chrome_categories:
self._extra_chrome_categories = options.extra_chrome_categories
def _ContinueTestRunWithTracing(self, tab):
tracing_categories = tab.EvaluateJavaScript(
......@@ -178,6 +181,9 @@ class _BlinkPerfMeasurement(legacy_page_test.LegacyPageTest):
'blink.console') # This is always required for js land trace event
config.chrome_trace_config.category_filter.AddFilterString(
tracing_categories)
if self._extra_chrome_categories:
config.chrome_trace_config.category_filter.AddFilterString(
self._extra_chrome_categories)
tab.browser.platform.tracing_controller.StartTracing(config)
tab.EvaluateJavaScript('testRunner.scheduleTestRun()')
tab.WaitForJavaScriptCondition('testRunner.isDone')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment