| 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 'blink_gc', | 17 'blink_gc', |
| 18 'cc', | 18 'cc', |
| 19 'v8'] | 19 'v8'] |
| 20 | 20 |
| 21 class TaskExecutionTime(page_test.PageTest): | 21 class TaskExecutionTime(page_test.PageTest): |
| 22 | 22 |
| 23 _TIME_OUT_IN_SECONDS = 60 | 23 _TIME_OUT_IN_SECONDS = 60 |
| 24 _NUMBER_OF_RESULTS_TO_DISPLAY = 10 | 24 _NUMBER_OF_RESULTS_TO_DISPLAY = 10 |
| 25 | 25 |
| 26 def __init__(self): | 26 def __init__(self): |
| 27 super(TaskExecutionTime, self).__init__('RunSmoothness') | 27 super(TaskExecutionTime, self).__init__('RunPageInteractions') |
| 28 self._renderer_thread = None | 28 self._renderer_thread = None |
| 29 | 29 |
| 30 def WillNavigateToPage(self, page, tab): | 30 def WillNavigateToPage(self, page, tab): |
| 31 category_filter = tracing_category_filter.TracingCategoryFilter() | 31 category_filter = tracing_category_filter.TracingCategoryFilter() |
| 32 | 32 |
| 33 for category in _CATEGORIES: | 33 for category in _CATEGORIES: |
| 34 category_filter.AddIncludedCategory(category) | 34 category_filter.AddIncludedCategory(category) |
| 35 | 35 |
| 36 options = tracing_options.TracingOptions() | 36 options = tracing_options.TracingOptions() |
| 37 options.enable_chrome_trace = True | 37 options.enable_chrome_trace = True |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 if key in dictionary: | 117 if key in dictionary: |
| 118 dictionary[key].Update( | 118 dictionary[key].Update( |
| 119 self_duration, total_duration, depth, parent) | 119 self_duration, total_duration, depth, parent) |
| 120 else: | 120 else: |
| 121 dictionary[key] = SliceData( | 121 dictionary[key] = SliceData( |
| 122 key, self_duration, total_duration, depth, parent) | 122 key, self_duration, total_duration, depth, parent) |
| 123 | 123 |
| 124 # Process sub slices recursively | 124 # Process sub slices recursively |
| 125 for sub_slice in task_slice.sub_slices: | 125 for sub_slice in task_slice.sub_slices: |
| 126 ProcessTasksForSlice(dictionary, sub_slice, depth + 1, parent) | 126 ProcessTasksForSlice(dictionary, sub_slice, depth + 1, parent) |
| OLD | NEW |