| 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 metrics import timeline as timeline_module | 5 from metrics import timeline as timeline_module |
| 6 from metrics import timeline_interaction_record as tir_module | 6 from metrics import timeline_interaction_record as tir_module |
| 7 from metrics import smoothness | 7 from metrics import smoothness |
| 8 from telemetry.page import page_measurement | 8 from telemetry.page import page_measurement |
| 9 from telemetry.core.timeline import model as model_module | 9 from telemetry.core.timeline import model as model_module |
| 10 | 10 |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 categories = ','.join([categories] + page.GetSyntheticDelayCategories()) | 116 categories = ','.join([categories] + page.GetSyntheticDelayCategories()) |
| 117 tab.browser.StartTracing(categories) | 117 tab.browser.StartTracing(categories) |
| 118 | 118 |
| 119 def MeasurePage(self, page, tab, results): | 119 def MeasurePage(self, page, tab, results): |
| 120 """ Collect all possible metrics and added them to results. """ | 120 """ Collect all possible metrics and added them to results. """ |
| 121 trace_result = tab.browser.StopTracing() | 121 trace_result = tab.browser.StopTracing() |
| 122 model = model_module.TimelineModel(trace_result) | 122 model = model_module.TimelineModel(trace_result) |
| 123 renderer_thread = model.GetRendererThreadFromTab(tab) | 123 renderer_thread = model.GetRendererThreadFromTab(tab) |
| 124 meta_metrics = _TimelineBasedMetrics(model, renderer_thread) | 124 meta_metrics = _TimelineBasedMetrics(model, renderer_thread) |
| 125 meta_metrics.AddResults(results) | 125 meta_metrics.AddResults(results) |
| 126 |
| 127 def CleanUpAfterPage(self, page, tab): |
| 128 if tab.browser.is_tracing_running: |
| 129 tab.browser.StopTracing() |
| OLD | NEW |