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.core import exceptions | 8 from telemetry.core import exceptions |
9 from telemetry.core import wpr_modes | 9 from telemetry.core import wpr_modes |
10 from telemetry.page import page | 10 from telemetry.page import page |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 self.assertEquals(len(mostly_smooth), 1) | 120 self.assertEquals(len(mostly_smooth), 1) |
121 self.assertGreaterEqual(mostly_smooth[0].GetRepresentativeNumber(), 0) | 121 self.assertGreaterEqual(mostly_smooth[0].GetRepresentativeNumber(), 0) |
122 | 122 |
123 mean_input_event_latency = results.FindAllPageSpecificValuesNamed( | 123 mean_input_event_latency = results.FindAllPageSpecificValuesNamed( |
124 'mean_input_event_latency') | 124 'mean_input_event_latency') |
125 if mean_input_event_latency: | 125 if mean_input_event_latency: |
126 self.assertEquals(len(mean_input_event_latency), 1) | 126 self.assertEquals(len(mean_input_event_latency), 1) |
127 self.assertGreater( | 127 self.assertGreater( |
128 mean_input_event_latency[0].GetRepresentativeNumber(), 0) | 128 mean_input_event_latency[0].GetRepresentativeNumber(), 0) |
129 | 129 |
130 @test.Disabled('mac') # http://crbug.com/403903 | 130 @test.Disabled('mac', 'chromeos') # http://crbug.com/403903 |
131 def testSmoothnessForPageWithNoGesture(self): | 131 def testSmoothnessForPageWithNoGesture(self): |
132 ps = self.CreateEmptyPageSet() | 132 ps = self.CreateEmptyPageSet() |
133 ps.AddPage(AnimatedPage(ps)) | 133 ps.AddPage(AnimatedPage(ps)) |
134 | 134 |
135 measurement = smoothness.Smoothness() | 135 measurement = smoothness.Smoothness() |
136 results = self.RunMeasurement(measurement, ps, options=self._options) | 136 results = self.RunMeasurement(measurement, ps, options=self._options) |
137 self.assertEquals(0, len(results.failures)) | 137 self.assertEquals(0, len(results.failures)) |
138 | 138 |
139 mostly_smooth = results.FindAllPageSpecificValuesNamed('mostly_smooth') | 139 mostly_smooth = results.FindAllPageSpecificValuesNamed('mostly_smooth') |
140 self.assertEquals(len(mostly_smooth), 1) | 140 self.assertEquals(len(mostly_smooth), 1) |
(...skipping 29 matching lines...) Expand all Loading... |
170 self.fake_power = self._power_metric = FakePowerMetric(browser) | 170 self.fake_power = self._power_metric = FakePowerMetric(browser) |
171 | 171 |
172 measurement = BuggyMeasurement() | 172 measurement = BuggyMeasurement() |
173 try: | 173 try: |
174 self.RunMeasurement(measurement, ps) | 174 self.RunMeasurement(measurement, ps) |
175 except page_test.TestNotSupportedOnPlatformFailure: | 175 except page_test.TestNotSupportedOnPlatformFailure: |
176 pass | 176 pass |
177 | 177 |
178 self.assertTrue(measurement.fake_power.start_called) | 178 self.assertTrue(measurement.fake_power.start_called) |
179 self.assertTrue(measurement.fake_power.stop_called) | 179 self.assertTrue(measurement.fake_power.stop_called) |
OLD | NEW |