| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 from core import perf_benchmark | 5 from core import perf_benchmark |
| 6 | 6 |
| 7 import page_sets | 7 import page_sets |
| 8 from telemetry import benchmark | 8 from telemetry import benchmark |
| 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 |
| 11 | 11 |
| 12 | 12 |
| 13 @benchmark.Owner(emails=['qiangchen@chromium.org', # For smoothness metrics | 13 @benchmark.Owner(emails=['qiangchen@chromium.org', # For smoothness metrics |
| 14 'ehmaldonado@chromium.org', | 14 'ehmaldonado@chromium.org', |
| 15 'phoglund@chromium.org']) | 15 'phoglund@chromium.org']) |
| 16 class WebrtcPerfBenchmark(perf_benchmark.PerfBenchmark): | 16 class WebrtcPerfBenchmark(perf_benchmark.PerfBenchmark): |
| 17 """Base class for WebRTC metrics for real-time communications tests.""" | 17 """Base class for WebRTC metrics for real-time communications tests.""" |
| 18 page_set = page_sets.WebrtcPageSet | 18 page_set = page_sets.WebrtcPageSet |
| 19 | 19 |
| 20 @classmethod | 20 @classmethod |
| 21 def Name(cls): | 21 def Name(cls): |
| 22 return 'webrtc' | 22 return 'webrtc' |
| 23 | 23 |
| 24 def GetExpectations(self): | |
| 25 return page_sets.WebrtcExpectations() | |
| 26 | |
| 27 def CreateTimelineBasedMeasurementOptions(self): | 24 def CreateTimelineBasedMeasurementOptions(self): |
| 28 categories = [ | 25 categories = [ |
| 29 # Disable all categories by default. | 26 # Disable all categories by default. |
| 30 '-*', | 27 '-*', |
| 31 'toplevel', | 28 'toplevel', |
| 32 # WebRTC | 29 # WebRTC |
| 33 'webrtc', | 30 'webrtc', |
| 34 ] | 31 ] |
| 35 | 32 |
| 36 category_filter = chrome_trace_category_filter.ChromeTraceCategoryFilter( | 33 category_filter = chrome_trace_category_filter.ChromeTraceCategoryFilter( |
| 37 filter_string=','.join(categories)) | 34 filter_string=','.join(categories)) |
| 38 options = timeline_based_measurement.Options(category_filter) | 35 options = timeline_based_measurement.Options(category_filter) |
| 39 options.SetTimelineBasedMetrics([ | 36 options.SetTimelineBasedMetrics([ |
| 40 'cpuTimeMetric', | 37 'cpuTimeMetric', |
| 41 'webrtcRenderingMetric', | 38 'webrtcRenderingMetric', |
| 42 ]) | 39 ]) |
| 43 return options | 40 return options |
| 44 | 41 |
| 45 def SetExtraBrowserOptions(self, options): | 42 def SetExtraBrowserOptions(self, options): |
| 46 options.AppendExtraBrowserArgs('--use-fake-device-for-media-stream') | 43 options.AppendExtraBrowserArgs('--use-fake-device-for-media-stream') |
| 47 options.AppendExtraBrowserArgs('--use-fake-ui-for-media-stream') | 44 options.AppendExtraBrowserArgs('--use-fake-ui-for-media-stream') |
| OLD | NEW |