Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 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 smoothness | 5 from metrics import smoothness |
| 6 from metrics.gpu_rendering_stats import GpuRenderingStats | 6 from metrics.gpu_rendering_stats import GpuRenderingStats |
| 7 from telemetry.page import page_measurement | 7 from telemetry.page import page_measurement |
| 8 | 8 |
| 9 | 9 |
| 10 class DidNotScrollException(page_measurement.MeasurementFailure): | 10 class DidNotScrollException(page_measurement.MeasurementFailure): |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 37 | 37 |
| 38 def CustomizeBrowserOptions(self, options): | 38 def CustomizeBrowserOptions(self, options): |
| 39 smoothness.SmoothnessMetrics.CustomizeBrowserOptions(options) | 39 smoothness.SmoothnessMetrics.CustomizeBrowserOptions(options) |
| 40 if self.force_enable_threaded_compositing: | 40 if self.force_enable_threaded_compositing: |
| 41 options.AppendExtraBrowserArgs('--enable-threaded-compositing') | 41 options.AppendExtraBrowserArgs('--enable-threaded-compositing') |
| 42 | 42 |
| 43 def CanRunForPage(self, page): | 43 def CanRunForPage(self, page): |
| 44 return hasattr(page, 'smoothness') | 44 return hasattr(page, 'smoothness') |
| 45 | 45 |
| 46 def WillRunAction(self, page, tab, action): | 46 def WillRunAction(self, page, tab, action): |
| 47 tab.browser.StartTracing('webkit.console,benchmark', 60) | 47 tab.browser.StartTracing('webkit,webkit.console,benchmark', 60) |
|
tonyg
2013/09/16 20:43:49
You might consider a:
TODO(ernstm): Remove "webki
ernstm
2013/09/16 20:54:00
Done.
| |
| 48 if tab.browser.platform.IsRawDisplayFrameRateSupported(): | 48 if tab.browser.platform.IsRawDisplayFrameRateSupported(): |
| 49 tab.browser.platform.StartRawDisplayFrameRateMeasurement() | 49 tab.browser.platform.StartRawDisplayFrameRateMeasurement() |
| 50 self._metrics = smoothness.SmoothnessMetrics(tab) | 50 self._metrics = smoothness.SmoothnessMetrics(tab) |
| 51 if action.CanBeBound(): | 51 if action.CanBeBound(): |
| 52 self._metrics.BindToAction(action) | 52 self._metrics.BindToAction(action) |
| 53 else: | 53 else: |
| 54 self._metrics.Start() | 54 self._metrics.Start() |
| 55 | 55 |
| 56 def DidRunAction(self, page, tab, action): | 56 def DidRunAction(self, page, tab, action): |
| 57 if tab.browser.platform.IsRawDisplayFrameRateSupported(): | 57 if tab.browser.platform.IsRawDisplayFrameRateSupported(): |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 88 | 88 |
| 89 if self.options.report_all_results: | 89 if self.options.report_all_results: |
| 90 for k, v in rendering_stats_deltas.iteritems(): | 90 for k, v in rendering_stats_deltas.iteritems(): |
| 91 results.Add(k, '', v) | 91 results.Add(k, '', v) |
| 92 | 92 |
| 93 if tab.browser.platform.IsRawDisplayFrameRateSupported(): | 93 if tab.browser.platform.IsRawDisplayFrameRateSupported(): |
| 94 for r in tab.browser.platform.GetRawDisplayFrameRateMeasurements(): | 94 for r in tab.browser.platform.GetRawDisplayFrameRateMeasurements(): |
| 95 if r.value is None: | 95 if r.value is None: |
| 96 raise MissingDisplayFrameRate(r.name) | 96 raise MissingDisplayFrameRate(r.name) |
| 97 results.Add(r.name, r.unit, r.value) | 97 results.Add(r.name, r.unit, r.value) |
| OLD | NEW |