OLD | NEW |
1 # Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2015 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 from gpu_tests import gpu_test_base | 4 from gpu_tests import gpu_test_base |
5 from gpu_tests import trace_test_expectations | 5 from gpu_tests import trace_test_expectations |
6 import page_sets | 6 import page_sets |
7 | 7 |
8 from telemetry.page import page_test | 8 from telemetry.page import page_test |
9 from telemetry.timeline import model as model_module | 9 from telemetry.timeline import model as model_module |
10 from telemetry.timeline import tracing_config | 10 from telemetry.timeline import tracing_config |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 event.category == category_name): | 60 event.category == category_name): |
61 break | 61 break |
62 else: | 62 else: |
63 raise page_test.Failure(self._FormatException(category_name)) | 63 raise page_test.Failure(self._FormatException(category_name)) |
64 | 64 |
65 def CustomizeBrowserOptions(self, options): | 65 def CustomizeBrowserOptions(self, options): |
66 options.AppendExtraBrowserArgs('--enable-logging') | 66 options.AppendExtraBrowserArgs('--enable-logging') |
67 | 67 |
68 def WillNavigateToPage(self, page, tab): | 68 def WillNavigateToPage(self, page, tab): |
69 config = tracing_config.TracingConfig() | 69 config = tracing_config.TracingConfig() |
| 70 config.chrome_trace_config.category_filter.AddExcludedCategory('*') |
70 for cat in TOPLEVEL_CATEGORIES: | 71 for cat in TOPLEVEL_CATEGORIES: |
71 config.chrome_trace_config.category_filter.AddDisabledByDefault( | 72 config.chrome_trace_config.category_filter.AddDisabledByDefault( |
72 cat) | 73 cat) |
73 config.enable_chrome_trace = True | 74 config.enable_chrome_trace = True |
74 tab.browser.platform.tracing_controller.StartTracing(config, 60) | 75 tab.browser.platform.tracing_controller.StartTracing(config, 60) |
75 | 76 |
76 def _FormatException(self, category): | 77 def _FormatException(self, category): |
77 return 'Trace markers for GPU category was not found: %s' % category | 78 return 'Trace markers for GPU category was not found: %s' % category |
78 | 79 |
79 | 80 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 """Tests GPU Device traces show up on devices that support it.""" | 119 """Tests GPU Device traces show up on devices that support it.""" |
119 test = _DeviceTraceValidator | 120 test = _DeviceTraceValidator |
120 name = 'DeviceTraceTest' | 121 name = 'DeviceTraceTest' |
121 | 122 |
122 @classmethod | 123 @classmethod |
123 def Name(cls): | 124 def Name(cls): |
124 return 'device_trace_test' | 125 return 'device_trace_test' |
125 | 126 |
126 def _CreateExpectations(self): | 127 def _CreateExpectations(self): |
127 return trace_test_expectations.DeviceTraceTestExpectations() | 128 return trace_test_expectations.DeviceTraceTestExpectations() |
OLD | NEW |