Chromium Code Reviews| Index: content/test/gpu/gpu_tests/gpu_process.py |
| diff --git a/content/test/gpu/gpu_tests/gpu_process.py b/content/test/gpu/gpu_tests/gpu_process.py |
| index a27c701594c178945284891d18268a2c76b82880..4201703cb8e5f35ed4debd0fa9b0b370aecf6493 100644 |
| --- a/content/test/gpu/gpu_tests/gpu_process.py |
| +++ b/content/test/gpu/gpu_tests/gpu_process.py |
| @@ -6,6 +6,7 @@ from gpu_tests import gpu_test_base |
| import page_sets |
| from telemetry.page import page_test |
| +from telemetry.story import story_set as story_set_module |
| test_harness_script = r""" |
| var domAutomationController = {}; |
| @@ -51,3 +52,42 @@ class GpuProcess(gpu_test_base.TestBase): |
| for page in story_set: |
| page.script_to_evaluate_on_commit = test_harness_script |
| return story_set |
| + |
| +class NoGpuProcessValidator(gpu_test_base.ValidatorBase): |
|
Ken Russell (switch to Gerrit)
2016/01/13 00:27:30
You'll need to factor this differently. It has to
|
| + def __init__(self): |
| + super(NoGpuProcessValidator, self).__init__( |
| + needs_browser_restart_after_each_page=True) |
| + |
| + def ValidateAndMeasurePage(self, page, tab, results): |
| + has_gpu_process_js = 'chrome.gpuBenchmarking.hasGpuProcess()' |
| + has_gpu_process = tab.EvaluateJavaScript(has_gpu_process_js) |
| + if has_gpu_process: |
| + raise page_test.Failure('GPU process detected') |
| + |
| +class NoGpuProcess(gpu_test_base.TestBase): |
| + """Tests that accelerated content does not trigger the creation of a GPU |
| + process if the card is black listed""" |
| + test = NoGpuProcessValidator |
| + |
| + @classmethod |
| + def Name(cls): |
| + return 'no_gpu_process' |
| + |
| + def _CreateExpectations(self): |
| + return expectations.GpuProcessExpectations() |
| + |
| + def CreateStorySet(self, options): |
| + options.AppendExtraBrowserArgs('--enable-gpu-benchmarking') |
| + options.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x10de') |
| + options.AppendExtraBrowserArgs('--gpu-testing-device-id=0x0de1') |
| + options.AppendExtraBrowserArgs('--gpu-testing-gl-vendor=VMware') |
| + options.AppendExtraBrowserArgs('--gpu-testing-gl-renderer=softpipe') |
| + options.AppendExtraBrowserArgs('--gpu-testing-gl-version="2.1 Mesa 11.2.0-devel"') |
| + |
| + story_set = story_set_module.StorySet() |
| + story_set.AddStory(gpu_test_base.PageBase( |
| + url='about:blank', name='GpuProcess.no_gpu_process', |
| + page_set=story_set, expectations=self.GetExpectations())) |
| + for page in story_set: |
| + page.script_to_evaluate_on_commit = test_harness_script |
| + return story_set |