| 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 task_execution_time | 5 from measurements import task_execution_time |
| 6 from telemetry import decorators | 6 from telemetry import decorators |
| 7 from telemetry.core import wpr_modes | 7 from telemetry.core import wpr_modes |
| 8 from telemetry.page import page as page_module | 8 from telemetry.page import page as page_module |
| 9 from telemetry.results import page_test_results | 9 from telemetry.results import page_test_results |
| 10 from telemetry.timeline import model as model_module | 10 from telemetry.timeline import model as model_module |
| 11 from telemetry.timeline import slice as slice_data | 11 from telemetry.timeline import slice as slice_data |
| 12 from telemetry.unittest_util import options_for_unittests | 12 from telemetry.unittest_util import options_for_unittests |
| 13 from telemetry.unittest_util import page_test_test_case | 13 from telemetry.unittest_util import page_test_test_case |
| 14 | 14 |
| 15 | 15 |
| 16 class TestTaskExecutionTimePage(page_module.Page): | 16 class TestTaskExecutionTimePage(page_module.Page): |
| 17 | 17 |
| 18 def __init__(self, page_set, base_dir): | 18 def __init__(self, page_set, base_dir): |
| 19 super(TestTaskExecutionTimePage, self).__init__( | 19 super(TestTaskExecutionTimePage, self).__init__( |
| 20 'file://blank.html', page_set, base_dir) | 20 'file://blank.html', page_set, base_dir) |
| 21 | 21 |
| 22 def RunPageInteractions(self, action_runner): | 22 def RunPageInteractions(self, action_runner): |
| 23 interaction = action_runner.BeginGestureInteraction( | 23 interaction = action_runner.BeginGestureInteraction( |
| 24 'ScrollAction', is_smooth=True) | 24 'ScrollAction') |
| 25 action_runner.ScrollPage() | 25 action_runner.ScrollPage() |
| 26 interaction.End() | 26 interaction.End() |
| 27 | 27 |
| 28 | 28 |
| 29 class TaskExecutionTimeUnitTest(page_test_test_case.PageTestTestCase): | 29 class TaskExecutionTimeUnitTest(page_test_test_case.PageTestTestCase): |
| 30 | 30 |
| 31 def setUp(self): | 31 def setUp(self): |
| 32 self._options = options_for_unittests.GetCopy() | 32 self._options = options_for_unittests.GetCopy() |
| 33 self._options.browser_options.wpr_mode = wpr_modes.WPR_OFF | 33 self._options.browser_options.wpr_mode = wpr_modes.WPR_OFF |
| 34 self._first_thread_name = ( | 34 self._first_thread_name = ( |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 None, | 264 None, |
| 265 'category', | 265 'category', |
| 266 name, | 266 name, |
| 267 timestamp, | 267 timestamp, |
| 268 duration, | 268 duration, |
| 269 timestamp, | 269 timestamp, |
| 270 duration, | 270 duration, |
| 271 []) | 271 []) |
| 272 self._renderer_thread.all_slices.append(new_slice) | 272 self._renderer_thread.all_slices.append(new_slice) |
| 273 return new_slice | 273 return new_slice |
| OLD | NEW |