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 from metrics import loading | 4 from metrics import loading |
5 from metrics import timeline | 5 from metrics import timeline |
6 from telemetry.page import page_measurement | 6 from telemetry.page import page_measurement |
7 | 7 |
8 class LoadingTrace(page_measurement.PageMeasurement): | 8 class LoadingTrace(page_measurement.PageMeasurement): |
9 def __init__(self, *args, **kwargs): | 9 def __init__(self, *args, **kwargs): |
10 super(LoadingTrace, self).__init__(*args, **kwargs) | 10 super(LoadingTrace, self).__init__(*args, **kwargs) |
(...skipping 10 matching lines...) Expand all Loading... |
21 # In current telemetry tests, all tests wait for DocumentComplete state, | 21 # In current telemetry tests, all tests wait for DocumentComplete state, |
22 # but we need to wait for the load event. | 22 # but we need to wait for the load event. |
23 tab.WaitForJavaScriptExpression('performance.timing.loadEventStart', 300) | 23 tab.WaitForJavaScriptExpression('performance.timing.loadEventStart', 300) |
24 | 24 |
25 # TODO(nduca): when crbug.com/168431 is fixed, modify the page sets to | 25 # TODO(nduca): when crbug.com/168431 is fixed, modify the page sets to |
26 # recognize loading as a toplevel action. | 26 # recognize loading as a toplevel action. |
27 self._timeline_metric.Stop(page, tab) | 27 self._timeline_metric.Stop(page, tab) |
28 | 28 |
29 loading.LoadingMetric().AddResults(tab, results) | 29 loading.LoadingMetric().AddResults(tab, results) |
30 self._timeline_metric.AddResults(tab, results) | 30 self._timeline_metric.AddResults(tab, results) |
| 31 |
| 32 def CleanUpAfterPage(self, _, tab): |
| 33 self._timeline_metric.CleanUp(tab) |
OLD | NEW |