| 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 gpu_test_base | 4 from gpu_tests import gpu_test_base |
| 5 from gpu_tests import trace_test_expectations |
| 5 import page_sets | 6 import page_sets |
| 6 import trace_test_expectations | |
| 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_category_filter | 10 from telemetry.timeline import tracing_category_filter |
| 11 from telemetry.timeline import tracing_options | 11 from telemetry.timeline import tracing_options |
| 12 | 12 |
| 13 TOPLEVEL_GL_CATEGORY = 'gpu_toplevel' | 13 TOPLEVEL_GL_CATEGORY = 'gpu_toplevel' |
| 14 TOPLEVEL_SERVICE_CATEGORY = 'disabled-by-default-gpu.service' | 14 TOPLEVEL_SERVICE_CATEGORY = 'disabled-by-default-gpu.service' |
| 15 TOPLEVEL_DEVICE_CATEGORY = 'disabled-by-default-gpu.device' | 15 TOPLEVEL_DEVICE_CATEGORY = 'disabled-by-default-gpu.device' |
| 16 TOPLEVEL_CATEGORIES = [TOPLEVEL_SERVICE_CATEGORY, TOPLEVEL_DEVICE_CATEGORY] | 16 TOPLEVEL_CATEGORIES = [TOPLEVEL_SERVICE_CATEGORY, TOPLEVEL_DEVICE_CATEGORY] |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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(gpu_test_base.TestBase): | 75 class TraceTestBase(gpu_test_base.TestBase): |
| 76 """Base class for the trace tests.""" | 76 """Base class for the trace tests.""" |
| 77 def CreateStorySet(self, options): | 77 def CreateStorySet(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 story_set = page_sets.PixelTestsStorySet(self.GetExpectations(), | 79 story_set = page_sets.PixelTestsStorySet(self.GetExpectations(), |
| 80 base_name=self.name) | 80 base_name=self.Name()) |
| 81 for story in story_set: | 81 for story in story_set: |
| 82 story.script_to_evaluate_on_commit = test_harness_script | 82 story.script_to_evaluate_on_commit = test_harness_script |
| 83 return story_set | 83 return story_set |
| 84 | 84 |
| 85 | 85 |
| 86 class TraceTest(TraceTestBase): | 86 class TraceTest(TraceTestBase): |
| 87 """Tests GPU traces are plumbed through properly.""" | 87 """Tests GPU traces are plumbed through properly.""" |
| 88 test = _TraceValidator | 88 test = _TraceValidator |
| 89 name = 'TraceTest' | 89 name = 'TraceTest' |
| 90 | 90 |
| 91 @classmethod | 91 @classmethod |
| 92 def Name(cls): | 92 def Name(cls): |
| 93 return 'trace_test' | 93 return 'trace_test' |
| 94 | 94 |
| 95 def _CreateExpectations(self): | 95 def _CreateExpectations(self): |
| 96 return trace_test_expectations.TraceTestExpectations() | 96 return trace_test_expectations.TraceTestExpectations() |
| 97 | 97 |
| 98 | 98 |
| 99 class DeviceTraceTest(TraceTestBase): | 99 class DeviceTraceTest(TraceTestBase): |
| 100 """Tests GPU Device traces show up on devices that support it.""" | 100 """Tests GPU Device traces show up on devices that support it.""" |
| 101 test = _DeviceTraceValidator | 101 test = _DeviceTraceValidator |
| 102 name = 'DeviceTraceTest' | 102 name = 'DeviceTraceTest' |
| 103 | 103 |
| 104 @classmethod | 104 @classmethod |
| 105 def Name(cls): | 105 def Name(cls): |
| 106 return 'device_trace_test' | 106 return 'device_trace_test' |
| 107 | 107 |
| 108 def _CreateExpectations(self): | 108 def _CreateExpectations(self): |
| 109 return trace_test_expectations.DeviceTraceTestExpectations() | 109 return trace_test_expectations.DeviceTraceTestExpectations() |
| OLD | NEW |