| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 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 | 4 |
| 5 import logging | 5 import logging |
| 6 | 6 |
| 7 from telemetry import benchmark as benchmark_module | 7 from telemetry import benchmark as benchmark_module |
| 8 from telemetry.page import page as page_module | 8 from telemetry.page import page as page_module |
| 9 from telemetry.page import page_test | 9 from telemetry.page import legacy_page_test |
| 10 from telemetry.page import shared_page_state as shared_page_state_module | 10 from telemetry.page import shared_page_state as shared_page_state_module |
| 11 from telemetry.testing import fakes | 11 from telemetry.testing import fakes |
| 12 | 12 |
| 13 from gpu_tests import exception_formatter | 13 from gpu_tests import exception_formatter |
| 14 from gpu_tests import gpu_test_expectations | 14 from gpu_tests import gpu_test_expectations |
| 15 | 15 |
| 16 class TestBase(benchmark_module.Benchmark): | 16 class TestBase(benchmark_module.Benchmark): |
| 17 """Base classes for all GPU tests in this directory. Implements | 17 """Base classes for all GPU tests in this directory. Implements |
| 18 support for per-page test expectations.""" | 18 support for per-page test expectations.""" |
| 19 | 19 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 34 # By default, creates an empty GpuTestExpectations object. Override | 34 # By default, creates an empty GpuTestExpectations object. Override |
| 35 # this in subclasses to set up test-specific expectations. Must | 35 # this in subclasses to set up test-specific expectations. Must |
| 36 # return an instance of GpuTestExpectations or a subclass. | 36 # return an instance of GpuTestExpectations or a subclass. |
| 37 # | 37 # |
| 38 # Do not call this directly. Call GetExpectations where necessary. | 38 # Do not call this directly. Call GetExpectations where necessary. |
| 39 return gpu_test_expectations.GpuTestExpectations() | 39 return gpu_test_expectations.GpuTestExpectations() |
| 40 | 40 |
| 41 | 41 |
| 42 # Provides a single subclass of PageTest in case it's useful in the | 42 # Provides a single subclass of PageTest in case it's useful in the |
| 43 # future. | 43 # future. |
| 44 class ValidatorBase(page_test.PageTest): | 44 class ValidatorBase(legacy_page_test.LegacyPageTest): |
| 45 def __init__(self, | 45 def __init__(self, |
| 46 needs_browser_restart_after_each_page=False, | 46 needs_browser_restart_after_each_page=False, |
| 47 clear_cache_before_each_run=False): | 47 clear_cache_before_each_run=False): |
| 48 super(ValidatorBase, self).__init__( | 48 super(ValidatorBase, self).__init__( |
| 49 needs_browser_restart_after_each_page=\ | 49 needs_browser_restart_after_each_page=\ |
| 50 needs_browser_restart_after_each_page, | 50 needs_browser_restart_after_each_page, |
| 51 clear_cache_before_each_run=clear_cache_before_each_run) | 51 clear_cache_before_each_run=clear_cache_before_each_run) |
| 52 | 52 |
| 53 def ValidateAndMeasurePage(self, page, tab, result): | 53 def ValidateAndMeasurePage(self, page, tab, result): |
| 54 pass | 54 pass |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 | 156 |
| 157 | 157 |
| 158 # TODO(kbr): this is fragile -- if someone changes the | 158 # TODO(kbr): this is fragile -- if someone changes the |
| 159 # shared_page_state_class to something that doesn't handle skip | 159 # shared_page_state_class to something that doesn't handle skip |
| 160 # expectations, then they'll hit the exception in | 160 # expectations, then they'll hit the exception in |
| 161 # RunStoryWithRetries, above. Need to rethink. | 161 # RunStoryWithRetries, above. Need to rethink. |
| 162 self._expectations = expectations | 162 self._expectations = expectations |
| 163 | 163 |
| 164 def GetExpectations(self): | 164 def GetExpectations(self): |
| 165 return self._expectations | 165 return self._expectations |
| OLD | NEW |