| 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 from measurements import thread_times | 5 from measurements import thread_times |
| 6 from measurements import smoothness_unittest | 6 from measurements import smoothness_unittest |
| 7 from metrics import timeline | 7 from metrics import timeline |
| 8 from telemetry.core import wpr_modes | 8 from telemetry.core import wpr_modes |
| 9 from telemetry.page import page_measurement_unittest_base | 9 from telemetry.testing import page_test_test_case |
| 10 | |
| 11 from telemetry.unittest import options_for_unittests | 10 from telemetry.unittest import options_for_unittests |
| 12 from telemetry.unittest import test | 11 from telemetry.unittest import test |
| 13 | 12 |
| 14 | 13 |
| 15 | 14 |
| 16 class ThreadTimesUnitTest( | 15 class ThreadTimesUnitTest(page_test_test_case.PageTestTestCase): |
| 17 page_measurement_unittest_base.PageMeasurementUnitTestBase): | |
| 18 def setUp(self): | 16 def setUp(self): |
| 19 self._options = options_for_unittests.GetCopy() | 17 self._options = options_for_unittests.GetCopy() |
| 20 self._options.browser_options.wpr_mode = wpr_modes.WPR_OFF | 18 self._options.browser_options.wpr_mode = wpr_modes.WPR_OFF |
| 21 | 19 |
| 22 @test.Disabled('android') | 20 @test.Disabled('android') |
| 23 def testBasic(self): | 21 def testBasic(self): |
| 24 ps = self.CreatePageSetFromFileInUnittestDataDir('scrollable_page.html') | 22 ps = self.CreatePageSetFromFileInUnittestDataDir('scrollable_page.html') |
| 25 measurement = thread_times.ThreadTimes() | 23 measurement = thread_times.ThreadTimes() |
| 26 timeline_options = self._options | 24 timeline_options = self._options |
| 27 results = self.RunMeasurement(measurement, ps, options = timeline_options) | 25 results = self.RunMeasurement(measurement, ps, options = timeline_options) |
| (...skipping 14 matching lines...) Expand all Loading... |
| 42 self.assertEquals(0, len(results.failures)) | 40 self.assertEquals(0, len(results.failures)) |
| 43 | 41 |
| 44 for category in timeline.TimelineThreadCategories.values(): | 42 for category in timeline.TimelineThreadCategories.values(): |
| 45 cpu_time_name = timeline.ThreadCpuTimeResultName(category) | 43 cpu_time_name = timeline.ThreadCpuTimeResultName(category) |
| 46 cpu_time = results.FindAllPageSpecificValuesNamed(cpu_time_name) | 44 cpu_time = results.FindAllPageSpecificValuesNamed(cpu_time_name) |
| 47 self.assertEquals(len(cpu_time), 1) | 45 self.assertEquals(len(cpu_time), 1) |
| 48 | 46 |
| 49 | 47 |
| 50 def testCleanUpTrace(self): | 48 def testCleanUpTrace(self): |
| 51 self.TestTracingCleanedUp(thread_times.ThreadTimes, self._options) | 49 self.TestTracingCleanedUp(thread_times.ThreadTimes, self._options) |
| OLD | NEW |