| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 telemetry.page import page_test | 5 from telemetry.page import page_test |
| 6 from telemetry.timeline import tracing_category_filter | 6 from telemetry.timeline import tracing_category_filter |
| 7 from telemetry.web_perf import timeline_based_measurement | 7 from telemetry.web_perf import timeline_based_measurement |
| 8 from telemetry.web_perf.metrics import smoothness | 8 from telemetry.web_perf.metrics import smoothness |
| 9 | 9 |
| 10 | 10 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 def WillNavigateToPage(self, page, tab): | 44 def WillNavigateToPage(self, page, tab): |
| 45 # FIXME: Remove webkit.console when blink.console lands in chromium and | 45 # FIXME: Remove webkit.console when blink.console lands in chromium and |
| 46 # the ref builds are updated. crbug.com/386847 | 46 # the ref builds are updated. crbug.com/386847 |
| 47 custom_categories = [ | 47 custom_categories = [ |
| 48 'webkit.console', 'blink.console', 'benchmark', 'trace_event_overhead'] | 48 'webkit.console', 'blink.console', 'benchmark', 'trace_event_overhead'] |
| 49 category_filter = tracing_category_filter.TracingCategoryFilter( | 49 category_filter = tracing_category_filter.TracingCategoryFilter( |
| 50 ','.join(custom_categories)) | 50 ','.join(custom_categories)) |
| 51 | 51 |
| 52 options = timeline_based_measurement.Options(category_filter) | 52 options = timeline_based_measurement.Options(category_filter) |
| 53 options.config.enable_platform_display_trace = True |
| 53 options.SetLegacyTimelineBasedMetrics([smoothness.SmoothnessMetric()]) | 54 options.SetLegacyTimelineBasedMetrics([smoothness.SmoothnessMetric()]) |
| 54 for delay in page.GetSyntheticDelayCategories(): | 55 for delay in page.GetSyntheticDelayCategories(): |
| 55 options.category_filter.AddSyntheticDelay(delay) | 56 options.category_filter.AddSyntheticDelay(delay) |
| 56 self._tbm = timeline_based_measurement.TimelineBasedMeasurement( | 57 self._tbm = timeline_based_measurement.TimelineBasedMeasurement( |
| 57 options, self._results_wrapper) | 58 options, self._results_wrapper) |
| 58 self._tbm.WillRunStory(tab.browser.platform) | 59 self._tbm.WillRunStory(tab.browser.platform) |
| 59 | 60 |
| 60 def ValidateAndMeasurePage(self, _, tab, results): | 61 def ValidateAndMeasurePage(self, _, tab, results): |
| 61 self._tbm.Measure(tab.browser.platform, results) | 62 self._tbm.Measure(tab.browser.platform, results) |
| 62 | 63 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 73 '--enable-threaded-compositing', | 74 '--enable-threaded-compositing', |
| 74 '--enable-gpu-benchmarking' | 75 '--enable-gpu-benchmarking' |
| 75 ]) | 76 ]) |
| 76 | 77 |
| 77 | 78 |
| 78 class SmoothnessWithRestart(Smoothness): | 79 class SmoothnessWithRestart(Smoothness): |
| 79 | 80 |
| 80 def __init__(self): | 81 def __init__(self): |
| 81 super(SmoothnessWithRestart, self).__init__( | 82 super(SmoothnessWithRestart, self).__init__( |
| 82 needs_browser_restart_after_each_page=True) | 83 needs_browser_restart_after_each_page=True) |
| OLD | NEW |