| 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 import page_sets | 4 import page_sets |
| 5 import trace_test_expectations | 5 import trace_test_expectations |
| 6 | 6 |
| 7 from telemetry import benchmark | 7 from telemetry import benchmark |
| 8 from telemetry.core.platform import tracing_category_filter | 8 from telemetry.core.platform import tracing_category_filter |
| 9 from telemetry.core.platform import tracing_options | 9 from telemetry.core.platform import tracing_options |
| 10 from telemetry.page import page_test | 10 from telemetry.page import page_test |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 return TOPLEVEL_SERVICE_CATEGORY | 67 return TOPLEVEL_SERVICE_CATEGORY |
| 68 | 68 |
| 69 | 69 |
| 70 class _DeviceTraceValidator(_TraceValidatorBase): | 70 class _DeviceTraceValidator(_TraceValidatorBase): |
| 71 def GetCategoryName(self): | 71 def GetCategoryName(self): |
| 72 return TOPLEVEL_DEVICE_CATEGORY | 72 return TOPLEVEL_DEVICE_CATEGORY |
| 73 | 73 |
| 74 | 74 |
| 75 class _TraceTestBase(benchmark.Benchmark): | 75 class _TraceTestBase(benchmark.Benchmark): |
| 76 """Base class for the trace tests.""" | 76 """Base class for the trace tests.""" |
| 77 def CreateStorySet(self, options): | 77 def CreatePageSet(self, options): |
| 78 # Utilize pixel tests page set as a set of simple pages to load. | 78 # Utilize pixel tests page set as a set of simple pages to load. |
| 79 page_set = page_sets.PixelTestsPageSet(base_name=self.name) | 79 page_set = page_sets.PixelTestsPageSet(base_name=self.name) |
| 80 for page in page_set.pages: | 80 for page in page_set.pages: |
| 81 page.script_to_evaluate_on_commit = test_harness_script | 81 page.script_to_evaluate_on_commit = test_harness_script |
| 82 return page_set | 82 return page_set |
| 83 | 83 |
| 84 | 84 |
| 85 class TraceTest(_TraceTestBase): | 85 class TraceTest(_TraceTestBase): |
| 86 """Tests GPU traces are plumbed through properly.""" | 86 """Tests GPU traces are plumbed through properly.""" |
| 87 test = _TraceValidator | 87 test = _TraceValidator |
| (...skipping 11 matching lines...) Expand all Loading... |
| 99 """Tests GPU Device traces show up on devices that support it.""" | 99 """Tests GPU Device traces show up on devices that support it.""" |
| 100 test = _DeviceTraceValidator | 100 test = _DeviceTraceValidator |
| 101 name = 'DeviceTraceTest' | 101 name = 'DeviceTraceTest' |
| 102 | 102 |
| 103 @classmethod | 103 @classmethod |
| 104 def Name(cls): | 104 def Name(cls): |
| 105 return 'device_trace_test' | 105 return 'device_trace_test' |
| 106 | 106 |
| 107 def CreateExpectations(self): | 107 def CreateExpectations(self): |
| 108 return trace_test_expectations.DeviceTraceTestExpectations() | 108 return trace_test_expectations.DeviceTraceTestExpectations() |
| OLD | NEW |