Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: tools/perf/measurements/loading_trace.py

Issue 208643007: Add cleanup for measurements that use tracing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698