Commit e7c48029 authored by danakj@chromium.org's avatar danakj@chromium.org

Fix the image decode telemetry perf unittest on impl side painting.

This test was enabling a lot of categories that it should not have.
When using impl side painting, we can use the trace events from
blink.ImageFrameGenerator::decode to measure the time. On legacy
compositing, this doesn't exist and we have to fall back to the
"timeline.Decode Image" event still. Left FIXMEs to remove this.

BUG=405244
NOTRY=true

Review URL: https://codereview.chromium.org/480713004

Cr-Commit-Position: refs/heads/master@{#291304}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@291304 0039d316-1c4b-4281-b951-d872f2087c98
parent e15f915b
...@@ -35,15 +35,18 @@ class ImageDecoding(page_test.PageTest): ...@@ -35,15 +35,18 @@ class ImageDecoding(page_test.PageTest):
options = tracing_options.TracingOptions() options = tracing_options.TracingOptions()
options.enable_chrome_trace = True options.enable_chrome_trace = True
# FIXME: bare 'devtools' is for compatibility with older reference versions # FIXME: Remove the timeline category when impl-side painting is on
# only and may eventually be removed. # everywhere.
category_filter = tracing_category_filter.TracingCategoryFilter( category_filter = tracing_category_filter.TracingCategoryFilter(
'disabled-by-default-devtools.timeline*') 'disabled-by-default-devtools.timeline')
# FIXME: Remove webkit.console when blink.console lands in chromium and # FIXME: Remove webkit.console when blink.console lands in chromium and
# the ref builds are updated. crbug.com/386847 # the ref builds are updated. crbug.com/386847
# FIXME: Remove the devtools.timeline category when impl-side painting is
# on everywhere.
categories = [ categories = [
'devtools', 'blink',
'devtools.timeline',
'webkit.console', 'webkit.console',
'blink.console' 'blink.console'
] ]
...@@ -67,7 +70,11 @@ class ImageDecoding(page_test.PageTest): ...@@ -67,7 +70,11 @@ class ImageDecoding(page_test.PageTest):
def _IsDone(): def _IsDone():
return tab.EvaluateJavaScript('isDone') return tab.EvaluateJavaScript('isDone')
decode_image_events = timeline_model.GetAllEventsOfName('Decode Image') decode_image_events = timeline_model.GetAllEventsOfName(
'ImageFrameGenerator::decode')
# FIXME: Remove this when impl-side painting is on everywhere.
if not decode_image_events:
decode_image_events = timeline_model.GetAllEventsOfName('Decode Image')
# If it is a real image page, then store only the last-minIterations # If it is a real image page, then store only the last-minIterations
# decode tasks. # decode tasks.
...@@ -79,7 +86,7 @@ class ImageDecoding(page_test.PageTest): ...@@ -79,7 +86,7 @@ class ImageDecoding(page_test.PageTest):
decode_image_events = decode_image_events[-min_iterations:] decode_image_events = decode_image_events[-min_iterations:]
durations = [d.duration for d in decode_image_events] durations = [d.duration for d in decode_image_events]
assert durations, 'Failed to find "Decode Image" trace events.' assert durations, 'Failed to find image decode trace events.'
image_decoding_avg = sum(durations) / len(durations) image_decoding_avg = sum(durations) / len(durations)
results.AddValue(scalar.ScalarValue( results.AddValue(scalar.ScalarValue(
......
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