| OLD | NEW |
| 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 import unittest |
| 6 |
| 5 from telemetry import decorators | 7 from telemetry import decorators |
| 6 from telemetry.page import page as page_module | 8 from telemetry.page import page as page_module |
| 7 from telemetry.testing import options_for_unittests | 9 from telemetry.testing import options_for_unittests |
| 8 from telemetry.testing import page_test_test_case | 10 from telemetry.testing import page_test_test_case |
| 9 from telemetry.util import wpr_modes | 11 from telemetry.util import wpr_modes |
| 10 | 12 |
| 11 from measurements import smoothness | 13 from measurements import smoothness |
| 12 from page_sets import repaint_helpers | 14 from page_sets import repaint_helpers |
| 13 | 15 |
| 14 | 16 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 27 | 29 |
| 28 Runs repaint measurement on a simple page and verifies | 30 Runs repaint measurement on a simple page and verifies |
| 29 that all metrics were added to the results. The test is purely functional, | 31 that all metrics were added to the results. The test is purely functional, |
| 30 i.e. it only checks if the metrics are present and non-zero. | 32 i.e. it only checks if the metrics are present and non-zero. |
| 31 """ | 33 """ |
| 32 | 34 |
| 33 def setUp(self): | 35 def setUp(self): |
| 34 self._options = options_for_unittests.GetCopy() | 36 self._options = options_for_unittests.GetCopy() |
| 35 self._options.browser_options.wpr_mode = wpr_modes.WPR_OFF | 37 self._options.browser_options.wpr_mode = wpr_modes.WPR_OFF |
| 36 | 38 |
| 37 @decorators.Disabled('chromeos') # crbug.com/483212 | 39 # Previously this test was disabled on chromeos, see crbug.com/483212. |
| 40 @unittest.skip("flaky") # crbug.com/715962 |
| 38 def testRepaint(self): | 41 def testRepaint(self): |
| 39 ps = self.CreateEmptyPageSet() | 42 ps = self.CreateEmptyPageSet() |
| 40 ps.AddStory(TestRepaintPage(ps, ps.base_dir)) | 43 ps.AddStory(TestRepaintPage(ps, ps.base_dir)) |
| 41 measurement = smoothness.Repaint() | 44 measurement = smoothness.Repaint() |
| 42 results = self.RunMeasurement(measurement, ps, options=self._options) | 45 results = self.RunMeasurement(measurement, ps, options=self._options) |
| 43 self.assertEquals(0, len(results.failures)) | 46 self.assertEquals(0, len(results.failures)) |
| 44 | 47 |
| 45 frame_times = results.FindAllPageSpecificValuesNamed('frame_times') | 48 frame_times = results.FindAllPageSpecificValuesNamed('frame_times') |
| 46 self.assertEquals(len(frame_times), 1) | 49 self.assertEquals(len(frame_times), 1) |
| 47 self.assertGreater(frame_times[0].GetRepresentativeNumber(), 0) | 50 self.assertGreater(frame_times[0].GetRepresentativeNumber(), 0) |
| (...skipping 14 matching lines...) Expand all Loading... |
| 62 | 65 |
| 63 # Make sure that we don't have extra timeline based metrics that are not | 66 # Make sure that we don't have extra timeline based metrics that are not |
| 64 # related to smoothness. | 67 # related to smoothness. |
| 65 mainthread_jank = results.FindAllPageSpecificValuesNamed( | 68 mainthread_jank = results.FindAllPageSpecificValuesNamed( |
| 66 'responsive-total_big_jank_thread_time') | 69 'responsive-total_big_jank_thread_time') |
| 67 self.assertEquals(len(mainthread_jank), 0) | 70 self.assertEquals(len(mainthread_jank), 0) |
| 68 | 71 |
| 69 @decorators.Disabled('android') | 72 @decorators.Disabled('android') |
| 70 def testCleanUpTrace(self): | 73 def testCleanUpTrace(self): |
| 71 self.TestTracingCleanedUp(smoothness.Repaint, self._options) | 74 self.TestTracingCleanedUp(smoothness.Repaint, self._options) |
| OLD | NEW |