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

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

Issue 170183004: Move smoothness to the new API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@submit
Patch Set: Reset actions list. Modify repaint measurement. 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
« no previous file with comments | « no previous file | tools/perf/measurements/smoothness.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 4
5 from metrics import smoothness 5 from measurements import smoothness_controller
6 from telemetry.page import page_measurement 6 from telemetry.page import page_measurement
7 7
8 8
9 class Repaint(page_measurement.PageMeasurement): 9 class Repaint(page_measurement.PageMeasurement):
10 def __init__(self): 10 def __init__(self):
11 super(Repaint, self).__init__('repaint', False) 11 super(Repaint, self).__init__('repaint', False)
12 self._smoothness_metric = None 12 self._smoothness_controller = None
13 13
14 def CanRunForPage(self, page): 14 def CanRunForPage(self, page):
15 return hasattr(page, 'repaint') 15 return hasattr(page, 'repaint')
16 16
17 def WillRunActions(self, page, tab): 17 def WillRunActions(self, page, tab):
18 tab.WaitForDocumentReadyStateToBeComplete() 18 tab.WaitForDocumentReadyStateToBeComplete()
19 self._smoothness_metric = smoothness.SmoothnessMetric() 19 self._smoothness_controller = smoothness_controller.SmoothnessController()
20 self._smoothness_metric.Start(page, tab) 20 self._smoothness_controller.Start(page, tab)
21 # Rasterize only what's visible. 21 # Rasterize only what's visible.
22 tab.ExecuteJavaScript( 22 tab.ExecuteJavaScript(
23 'chrome.gpuBenchmarking.setRasterizeOnlyVisibleContent();') 23 'chrome.gpuBenchmarking.setRasterizeOnlyVisibleContent();')
24 24
25 def DidRunAction(self, page, tab, action): 25 def DidRunAction(self, page, tab, action):
26 self._smoothness_metric.AddActionToIncludeInMetric(action) 26 self._smoothness_controller.AddActionToIncludeInMetric(action)
27 27
28 def DidRunActions(self, page, tab): 28 def DidRunActions(self, page, tab):
29 self._smoothness_metric.Stop(page, tab) 29 self._smoothness_controller.Stop(tab)
30 30
31 def MeasurePage(self, page, tab, results): 31 def MeasurePage(self, page, tab, results):
32 self._smoothness_metric.AddResults(tab, results) 32 self._smoothness_controller.AddResults(tab, results)
OLDNEW
« no previous file with comments | « no previous file | tools/perf/measurements/smoothness.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698