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

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

Issue 277143003: Add NavigateToPage API for action_runner. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 7 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
« no previous file with comments | « tools/perf/measurements/polymer_load.py ('k') | tools/perf/measurements/timeline_controller.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 import sys 4 import sys
5 5
6 from measurements import smooth_gesture_util 6 from measurements import smooth_gesture_util
7 from telemetry.core.timeline.model import TimelineModel 7 from telemetry.core.timeline.model import TimelineModel
8 from telemetry.page import page_measurement 8 from telemetry.page import page_measurement
9 from telemetry.page.actions import action_runner 9 from telemetry.page.actions import action_runner
10 from telemetry.web_perf import timeline_interaction_record as tir_module 10 from telemetry.web_perf import timeline_interaction_record as tir_module
(...skipping 13 matching lines...) Expand all
24 self._timeline_model = None 24 self._timeline_model = None
25 self._tracing_timeline_data = None 25 self._tracing_timeline_data = None
26 26
27 def Start(self, page, tab): 27 def Start(self, page, tab):
28 custom_categories = ['webkit.console', 'benchmark'] 28 custom_categories = ['webkit.console', 'benchmark']
29 custom_categories += page.GetSyntheticDelayCategories() 29 custom_categories += page.GetSyntheticDelayCategories()
30 tab.browser.StartTracing(','.join(custom_categories), 60) 30 tab.browser.StartTracing(','.join(custom_categories), 60)
31 if tab.browser.platform.IsRawDisplayFrameRateSupported(): 31 if tab.browser.platform.IsRawDisplayFrameRateSupported():
32 tab.browser.platform.StartRawDisplayFrameRateMeasurement() 32 tab.browser.platform.StartRawDisplayFrameRateMeasurement()
33 # Start the smooth marker for all smooth actions. 33 # Start the smooth marker for all smooth actions.
34 runner = action_runner.ActionRunner(None, tab) 34 runner = action_runner.ActionRunner(tab)
35 runner.BeginInteraction(RUN_SMOOTH_ACTIONS, [tir_module.IS_SMOOTH]) 35 runner.BeginInteraction(RUN_SMOOTH_ACTIONS, [tir_module.IS_SMOOTH])
36 36
37 def Stop(self, tab): 37 def Stop(self, tab):
38 # End the smooth marker for all smooth actions. 38 # End the smooth marker for all smooth actions.
39 runner = action_runner.ActionRunner(None, tab) 39 runner = action_runner.ActionRunner(tab)
40 runner.EndInteraction(RUN_SMOOTH_ACTIONS, [tir_module.IS_SMOOTH]) 40 runner.EndInteraction(RUN_SMOOTH_ACTIONS, [tir_module.IS_SMOOTH])
41 # Stop tracing for smoothness metric. 41 # Stop tracing for smoothness metric.
42 if tab.browser.platform.IsRawDisplayFrameRateSupported(): 42 if tab.browser.platform.IsRawDisplayFrameRateSupported():
43 tab.browser.platform.StopRawDisplayFrameRateMeasurement() 43 tab.browser.platform.StopRawDisplayFrameRateMeasurement()
44 self._tracing_timeline_data = tab.browser.StopTracing() 44 self._tracing_timeline_data = tab.browser.StopTracing()
45 self._timeline_model = TimelineModel( 45 self._timeline_model = TimelineModel(
46 timeline_data=self._tracing_timeline_data) 46 timeline_data=self._tracing_timeline_data)
47 47
48 def AddResults(self, tab, results): 48 def AddResults(self, tab, results):
49 # Add results of smoothness metric. This computes the smoothness metric for 49 # Add results of smoothness metric. This computes the smoothness metric for
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 for r in tab.browser.platform.GetRawDisplayFrameRateMeasurements(): 91 for r in tab.browser.platform.GetRawDisplayFrameRateMeasurements():
92 if r.value is None: 92 if r.value is None:
93 raise MissingDisplayFrameRateError(r.name) 93 raise MissingDisplayFrameRateError(r.name)
94 results.Add(r.name, r.unit, r.value) 94 results.Add(r.name, r.unit, r.value)
95 95
96 def CleanUp(self, tab): 96 def CleanUp(self, tab):
97 if tab.browser.platform.IsRawDisplayFrameRateSupported(): 97 if tab.browser.platform.IsRawDisplayFrameRateSupported():
98 tab.browser.platform.StopRawDisplayFrameRateMeasurement() 98 tab.browser.platform.StopRawDisplayFrameRateMeasurement()
99 if tab.browser.is_tracing_running: 99 if tab.browser.is_tracing_running:
100 tab.browser.StopTracing() 100 tab.browser.StopTracing()
OLDNEW
« no previous file with comments | « tools/perf/measurements/polymer_load.py ('k') | tools/perf/measurements/timeline_controller.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698