| 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 telemetry.core.platform import tracing_category_filter | 5 from telemetry.core.platform import tracing_category_filter |
| 6 from telemetry.core.platform import tracing_options | 6 from telemetry.core.platform import tracing_options |
| 7 from telemetry.timeline.model import TimelineModel | 7 from telemetry.timeline.model import TimelineModel |
| 8 from telemetry.page import page_test | 8 from telemetry.page import page_test |
| 9 from telemetry.util import statistics | 9 from telemetry.util import statistics |
| 10 from telemetry.value import scalar | 10 from telemetry.value import scalar |
| 11 | 11 |
| 12 _CATEGORIES = ['webkit.console', | 12 _CATEGORIES = ['webkit.console', |
| 13 'blink.console', | 13 'blink.console', |
| 14 'benchmark', | 14 'benchmark', |
| 15 'toplevel', | 15 'toplevel', |
| 16 'blink', | 16 'blink', |
| 17 'cc', | 17 'cc', |
| 18 'v8'] | 18 'v8'] |
| 19 | 19 |
| 20 class TaskExecutionTime(page_test.PageTest): | 20 class TaskExecutionTime(page_test.PageTest): |
| 21 | 21 |
| 22 _TIME_OUT_IN_SECONDS = 60 | 22 _TIME_OUT_IN_SECONDS = 60 |
| 23 _NUMBER_OF_RESULTS_TO_DISPLAY = 10 | 23 _NUMBER_OF_RESULTS_TO_DISPLAY = 10 |
| 24 | 24 |
| 25 def __init__(self): | 25 def __init__(self): |
| 26 super(TaskExecutionTime, self).__init__('RunTaskExecutionTime') | 26 super(TaskExecutionTime, self).__init__('RunSmoothness') |
| 27 self._renderer_thread = None | 27 self._renderer_thread = None |
| 28 | 28 |
| 29 def WillNavigateToPage(self, page, tab): | 29 def WillNavigateToPage(self, page, tab): |
| 30 category_filter = tracing_category_filter.TracingCategoryFilter() | 30 category_filter = tracing_category_filter.TracingCategoryFilter() |
| 31 | 31 |
| 32 for category in _CATEGORIES: | 32 for category in _CATEGORIES: |
| 33 category_filter.AddIncludedCategory(category) | 33 category_filter.AddIncludedCategory(category) |
| 34 | 34 |
| 35 options = tracing_options.TracingOptions() | 35 options = tracing_options.TracingOptions() |
| 36 options.enable_chrome_trace = True | 36 options.enable_chrome_trace = True |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 if key in dictionary: | 116 if key in dictionary: |
| 117 dictionary[key].Update( | 117 dictionary[key].Update( |
| 118 self_duration, total_duration, depth, parent) | 118 self_duration, total_duration, depth, parent) |
| 119 else: | 119 else: |
| 120 dictionary[key] = SliceData( | 120 dictionary[key] = SliceData( |
| 121 key, self_duration, total_duration, depth, parent) | 121 key, self_duration, total_duration, depth, parent) |
| 122 | 122 |
| 123 # Process sub slices recursively | 123 # Process sub slices recursively |
| 124 for sub_slice in task_slice.sub_slices: | 124 for sub_slice in task_slice.sub_slices: |
| 125 ProcessTasksForSlice(dictionary, sub_slice, depth + 1, parent) | 125 ProcessTasksForSlice(dictionary, sub_slice, depth + 1, parent) |
| OLD | NEW |