Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 import sys | 4 import sys |
| 5 | 5 |
| 6 from measurements import smoothness | 6 from measurements import smoothness |
| 7 from metrics import power | 7 from metrics import power |
| 8 from telemetry import decorators | 8 from telemetry import decorators |
| 9 from telemetry.core import exceptions | 9 from telemetry.core import exceptions |
| 10 from telemetry.core import wpr_modes | 10 from telemetry.core import wpr_modes |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 135 results = self.RunMeasurement(measurement, ps, options=self._options) | 135 results = self.RunMeasurement(measurement, ps, options=self._options) |
| 136 self.assertEquals(0, len(results.failures)) | 136 self.assertEquals(0, len(results.failures)) |
| 137 | 137 |
| 138 avg_surface_fps = results.FindAllPageSpecificValuesNamed('avg_surface_fps') | 138 avg_surface_fps = results.FindAllPageSpecificValuesNamed('avg_surface_fps') |
| 139 self.assertEquals(1, len(avg_surface_fps)) | 139 self.assertEquals(1, len(avg_surface_fps)) |
| 140 self.assertGreater(avg_surface_fps[0].GetRepresentativeNumber, 0) | 140 self.assertGreater(avg_surface_fps[0].GetRepresentativeNumber, 0) |
| 141 | 141 |
| 142 jank_count = results.FindAllPageSpecificValuesNamed('jank_count') | 142 jank_count = results.FindAllPageSpecificValuesNamed('jank_count') |
| 143 self.assertEquals(1, len(jank_count)) | 143 self.assertEquals(1, len(jank_count)) |
| 144 self.assertGreater(jank_count[0].GetRepresentativeNumber(), -1) | 144 self.assertGreater(jank_count[0].GetRepresentativeNumber(), -1) |
| 145 | 145 |
|
nednguyen
2014/12/23 15:39:11
Wouldn't these only work for android?
sullivan
2014/12/23 15:42:59
Yep, they only work for Android. The code review t
| |
| 146 max_frame_delay = results.FindAllPageSpecificValuesNamed('max_frame_delay') | |
| 147 self.assertEquals(1, len(max_frame_delay)) | |
| 148 self.assertGreater(max_frame_delay[0].GetRepresentativeNumber, 0) | |
| 149 | |
| 150 frame_lengths = results.FindAllPageSpecificValuesNamed('frame_lengths') | |
| 151 self.assertEquals(1, len(frame_lengths)) | |
| 152 self.assertGreater(frame_lengths[0].GetRepresentativeNumber, 0) | |
| 153 | |
| 146 @decorators.Disabled('mac', 'chromeos') # http://crbug.com/403903 | 154 @decorators.Disabled('mac', 'chromeos') # http://crbug.com/403903 |
| 147 def testSmoothnessForPageWithNoGesture(self): | 155 def testSmoothnessForPageWithNoGesture(self): |
| 148 ps = self.CreateEmptyPageSet() | 156 ps = self.CreateEmptyPageSet() |
| 149 ps.AddUserStory(AnimatedPage(ps)) | 157 ps.AddUserStory(AnimatedPage(ps)) |
| 150 | 158 |
| 151 measurement = smoothness.Smoothness() | 159 measurement = smoothness.Smoothness() |
| 152 results = self.RunMeasurement(measurement, ps, options=self._options) | 160 results = self.RunMeasurement(measurement, ps, options=self._options) |
| 153 self.assertEquals(0, len(results.failures)) | 161 self.assertEquals(0, len(results.failures)) |
| 154 | 162 |
| 155 percentage_smooth = results.FindAllPageSpecificValuesNamed( | 163 percentage_smooth = results.FindAllPageSpecificValuesNamed( |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 188 self.fake_power = self._power_metric = FakePowerMetric(platform) | 196 self.fake_power = self._power_metric = FakePowerMetric(platform) |
| 189 | 197 |
| 190 measurement = BuggyMeasurement() | 198 measurement = BuggyMeasurement() |
| 191 try: | 199 try: |
| 192 self.RunMeasurement(measurement, ps) | 200 self.RunMeasurement(measurement, ps) |
| 193 except exceptions.IntentionalException: | 201 except exceptions.IntentionalException: |
| 194 pass | 202 pass |
| 195 | 203 |
| 196 self.assertTrue(measurement.fake_power.start_called) | 204 self.assertTrue(measurement.fake_power.start_called) |
| 197 self.assertTrue(measurement.fake_power.stop_called) | 205 self.assertTrue(measurement.fake_power.stop_called) |
| OLD | NEW |