| 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 telemetry.core import wpr_modes | 7 from telemetry.core import wpr_modes |
| 8 from telemetry.page import page | 8 from telemetry.page import page |
| 9 from telemetry.page import page_measurement_unittest_base | 9 from telemetry.page import page_measurement_unittest_base |
| 10 # pylint: disable=W0401,W0614 | 10 # pylint: disable=W0401,W0614 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 def testSyntheticDelayConfiguration(self): | 55 def testSyntheticDelayConfiguration(self): |
| 56 test_page = page.Page('http://dummy', None) | 56 test_page = page.Page('http://dummy', None) |
| 57 test_page.synthetic_delays = { | 57 test_page.synthetic_delays = { |
| 58 'cc.BeginMainFrame': { 'target_duration': 0.012 }, | 58 'cc.BeginMainFrame': { 'target_duration': 0.012 }, |
| 59 'cc.DrawAndSwap': { 'target_duration': 0.012, 'mode': 'alternating' }, | 59 'cc.DrawAndSwap': { 'target_duration': 0.012, 'mode': 'alternating' }, |
| 60 'gpu.PresentingFrame': { 'target_duration': 0.012 } | 60 'gpu.PresentingFrame': { 'target_duration': 0.012 } |
| 61 } | 61 } |
| 62 | 62 |
| 63 tab = FakeTab() | 63 tab = FakeTab() |
| 64 measurement = smoothness.Smoothness() | 64 measurement = smoothness.Smoothness() |
| 65 measurement.WillStartBrowser(tab.browser) |
| 65 measurement.WillRunActions(test_page, tab) | 66 measurement.WillRunActions(test_page, tab) |
| 66 | 67 |
| 67 expected_category_filter = [ | 68 expected_category_filter = [ |
| 68 'DELAY(cc.BeginMainFrame;0.012000;static)', | 69 'DELAY(cc.BeginMainFrame;0.012000;static)', |
| 69 'DELAY(cc.DrawAndSwap;0.012000;alternating)', | 70 'DELAY(cc.DrawAndSwap;0.012000;alternating)', |
| 70 'DELAY(gpu.PresentingFrame;0.012000;static)', | 71 'DELAY(gpu.PresentingFrame;0.012000;static)', |
| 71 'benchmark' | 72 'benchmark' |
| 72 ] | 73 ] |
| 73 actual_category_filter = tab.browser.category_filter.split(',') | 74 actual_category_filter = tab.browser.category_filter.split(',') |
| 74 actual_category_filter.sort() | 75 actual_category_filter.sort() |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 measurement = smoothness.Smoothness() | 126 measurement = smoothness.Smoothness() |
| 126 results = self.RunMeasurement(measurement, ps, options=self._options) | 127 results = self.RunMeasurement(measurement, ps, options=self._options) |
| 127 self.assertEquals(0, len(results.failures)) | 128 self.assertEquals(0, len(results.failures)) |
| 128 | 129 |
| 129 mostly_smooth = results.FindAllPageSpecificValuesNamed('mostly_smooth') | 130 mostly_smooth = results.FindAllPageSpecificValuesNamed('mostly_smooth') |
| 130 self.assertEquals(len(mostly_smooth), 1) | 131 self.assertEquals(len(mostly_smooth), 1) |
| 131 self.assertGreaterEqual(mostly_smooth[0].GetRepresentativeNumber(), 0) | 132 self.assertGreaterEqual(mostly_smooth[0].GetRepresentativeNumber(), 0) |
| 132 | 133 |
| 133 def testCleanUpTrace(self): | 134 def testCleanUpTrace(self): |
| 134 self.TestTracingCleanedUp(smoothness.Smoothness, self._options) | 135 self.TestTracingCleanedUp(smoothness.Smoothness, self._options) |
| OLD | NEW |