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

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

Issue 1917393002: [tools/perf] Reference legacy_page_test module instead of page_test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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/skpicture_printer.py ('k') | tools/perf/measurements/startup.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 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 4
5 from telemetry.page import page_test 5 from telemetry.page import legacy_page_test
6 from telemetry.timeline import tracing_category_filter 6 from telemetry.timeline import tracing_category_filter
7 from telemetry.web_perf import timeline_based_measurement 7 from telemetry.web_perf import timeline_based_measurement
8 from telemetry.web_perf.metrics import smoothness 8 from telemetry.web_perf.metrics import smoothness
9 9
10 10
11 class _CustomResultsWrapper(timeline_based_measurement.ResultsWrapperInterface): 11 class _CustomResultsWrapper(timeline_based_measurement.ResultsWrapperInterface):
12 12
13 def __init__(self): 13 def __init__(self):
14 super(_CustomResultsWrapper, self).__init__() 14 super(_CustomResultsWrapper, self).__init__()
15 self._pages_to_tir_labels = {} 15 self._pages_to_tir_labels = {}
16 16
17 def _AssertNewValueHasSameInteractionLabel(self, new_value): 17 def _AssertNewValueHasSameInteractionLabel(self, new_value):
18 tir_label = self._pages_to_tir_labels.get(new_value.page) 18 tir_label = self._pages_to_tir_labels.get(new_value.page)
19 if tir_label: 19 if tir_label:
20 assert tir_label == self._tir_label, ( 20 assert tir_label == self._tir_label, (
21 'Smoothness measurement do not support multiple interaction record ' 21 'Smoothness measurement do not support multiple interaction record '
22 'labels per page yet. See crbug.com/453109 for more information.') 22 'labels per page yet. See crbug.com/453109 for more information.')
23 else: 23 else:
24 self._pages_to_tir_labels[new_value.page] = self._tir_label 24 self._pages_to_tir_labels[new_value.page] = self._tir_label
25 25
26 def AddValue(self, value): 26 def AddValue(self, value):
27 self._AssertNewValueHasSameInteractionLabel(value) 27 self._AssertNewValueHasSameInteractionLabel(value)
28 self._results.AddValue(value) 28 self._results.AddValue(value)
29 29
30 30
31 class Smoothness(page_test.PageTest): 31 class Smoothness(legacy_page_test.LegacyPageTest):
32 32
33 def __init__(self, needs_browser_restart_after_each_page=False): 33 def __init__(self, needs_browser_restart_after_each_page=False):
34 super(Smoothness, self).__init__(needs_browser_restart_after_each_page) 34 super(Smoothness, self).__init__(needs_browser_restart_after_each_page)
35 self._results_wrapper = _CustomResultsWrapper() 35 self._results_wrapper = _CustomResultsWrapper()
36 self._tbm = None 36 self._tbm = None
37 37
38 @classmethod 38 @classmethod
39 def CustomizeBrowserOptions(cls, options): 39 def CustomizeBrowserOptions(cls, options):
40 options.AppendExtraBrowserArgs('--enable-gpu-benchmarking') 40 options.AppendExtraBrowserArgs('--enable-gpu-benchmarking')
41 options.AppendExtraBrowserArgs('--touch-events=enabled') 41 options.AppendExtraBrowserArgs('--touch-events=enabled')
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 '--enable-threaded-compositing', 74 '--enable-threaded-compositing',
75 '--enable-gpu-benchmarking' 75 '--enable-gpu-benchmarking'
76 ]) 76 ])
77 77
78 78
79 class SmoothnessWithRestart(Smoothness): 79 class SmoothnessWithRestart(Smoothness):
80 80
81 def __init__(self): 81 def __init__(self):
82 super(SmoothnessWithRestart, self).__init__( 82 super(SmoothnessWithRestart, self).__init__(
83 needs_browser_restart_after_each_page=True) 83 needs_browser_restart_after_each_page=True)
OLDNEW
« no previous file with comments | « tools/perf/measurements/skpicture_printer.py ('k') | tools/perf/measurements/startup.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698