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

Side by Side Diff: tools/perf/measurements/timeline_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
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 from measurements import smooth_gesture_util 4 from measurements import smooth_gesture_util
5 5
6 from telemetry.core.backends.chrome import tracing_backend 6 from telemetry.core.backends.chrome import tracing_backend
7 from telemetry.core.timeline.model import TimelineModel 7 from telemetry.core.timeline.model import TimelineModel
8 from telemetry.page.actions import action_runner 8 from telemetry.page.actions import action_runner
9 from telemetry.web_perf import timeline_interaction_record as tir_module 9 from telemetry.web_perf import timeline_interaction_record as tir_module
10 10
(...skipping 18 matching lines...) Expand all
29 self._renderer_process = None 29 self._renderer_process = None
30 if not tab.browser.supports_tracing: 30 if not tab.browser.supports_tracing:
31 raise Exception('Not supported') 31 raise Exception('Not supported')
32 if self.trace_categories: 32 if self.trace_categories:
33 categories = [self.trace_categories] + \ 33 categories = [self.trace_categories] + \
34 page.GetSyntheticDelayCategories() 34 page.GetSyntheticDelayCategories()
35 else: 35 else:
36 categories = page.GetSyntheticDelayCategories() 36 categories = page.GetSyntheticDelayCategories()
37 tab.browser.StartTracing(','.join(categories)) 37 tab.browser.StartTracing(','.join(categories))
38 # Start the smooth marker for all actions. 38 # Start the smooth marker for all actions.
39 runner = action_runner.ActionRunner(None, tab) 39 runner = action_runner.ActionRunner(tab)
40 runner.BeginInteraction(RUN_SMOOTH_ACTIONS, [tir_module.IS_SMOOTH]) 40 runner.BeginInteraction(RUN_SMOOTH_ACTIONS, [tir_module.IS_SMOOTH])
41 41
42 def Stop(self, tab): 42 def Stop(self, tab):
43 # End the smooth marker for all actions. 43 # End the smooth marker for all actions.
44 runner = action_runner.ActionRunner(None, tab) 44 runner = action_runner.ActionRunner(tab)
45 runner.EndInteraction(RUN_SMOOTH_ACTIONS, [tir_module.IS_SMOOTH]) 45 runner.EndInteraction(RUN_SMOOTH_ACTIONS, [tir_module.IS_SMOOTH])
46 # Stop tracing. 46 # Stop tracing.
47 timeline_data = tab.browser.StopTracing() 47 timeline_data = tab.browser.StopTracing()
48 self._model = TimelineModel(timeline_data) 48 self._model = TimelineModel(timeline_data)
49 self._renderer_process = self._model.GetRendererProcessFromTab(tab) 49 self._renderer_process = self._model.GetRendererProcessFromTab(tab)
50 renderer_thread = self.model.GetRendererThreadFromTab(tab) 50 renderer_thread = self.model.GetRendererThreadFromTab(tab)
51 51
52 run_smooth_actions_record = None 52 run_smooth_actions_record = None
53 self._smooth_records = [] 53 self._smooth_records = []
54 for event in renderer_thread.async_slices: 54 for event in renderer_thread.async_slices:
(...skipping 26 matching lines...) Expand all
81 def model(self): 81 def model(self):
82 return self._model 82 return self._model
83 83
84 @property 84 @property
85 def renderer_process(self): 85 def renderer_process(self):
86 return self._renderer_process 86 return self._renderer_process
87 87
88 @property 88 @property
89 def smooth_records(self): 89 def smooth_records(self):
90 return self._smooth_records 90 return self._smooth_records
OLDNEW
« no previous file with comments | « tools/perf/measurements/smoothness_controller.py ('k') | tools/perf/page_sets/browser_control_click.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698