| Index: content/test/gpu/page_sets/gpu_process_tests.py
|
| diff --git a/content/test/gpu/page_sets/gpu_process_tests.py b/content/test/gpu/page_sets/gpu_process_tests.py
|
| index f1ce3eb42ce98128a251ba75fffe86d8440d864f..04fd7cc43f1e5b31b12d91f8ebec0ca2ddc01fdb 100644
|
| --- a/content/test/gpu/page_sets/gpu_process_tests.py
|
| +++ b/content/test/gpu/page_sets/gpu_process_tests.py
|
| @@ -169,6 +169,42 @@ class SkipGpuProcessPage(gpu_test_base.PageBase):
|
| if has_gpu_process:
|
| raise page_test.Failure('GPU process detected')
|
|
|
| +
|
| +class DriverBugWorkaroundsSharedPageState(GpuProcessSharedPageState):
|
| + def __init__(self, test, finder_options, story_set):
|
| + super(DriverBugWorkaroundsSharedPageState, self).__init__(
|
| + test, finder_options, story_set)
|
| + options = finder_options.browser_options
|
| + options.AppendExtraBrowserArgs('--use_gpu_driver_workaround_for_testing')
|
| +
|
| +
|
| +class DriverBugWorkaroundsInGpuProcessPage(gpu_test_base.PageBase):
|
| + def __init__(self, story_set, expectations):
|
| + super(DriverBugWorkaroundsInGpuProcessPage, self).__init__(
|
| + url='chrome:gpu',
|
| + name='GpuProcess.driver_bug_workarounds_in_gpu_process',
|
| + page_set=story_set,
|
| + shared_page_state_class=DriverBugWorkaroundsSharedPageState,
|
| + expectations=expectations)
|
| +
|
| + def Validate(self, tab, results):
|
| + workaround = 'use_gpu_driver_workaround_for_testing'
|
| +
|
| + browser_list = tab.EvaluateJavaScript('GetDriverBugWorkarounds()')
|
| + if not workaround in browser_list:
|
| + print 'Test failed. Printing page contents:'
|
| + print tab.EvaluateJavaScript('document.body.innerHTML')
|
| + raise page_test.Failure('%s missing in Browser process workarounds: %s' \
|
| + % (workaround, browser_list))
|
| +
|
| + gpu_list = tab.EvaluateJavaScript( \
|
| + 'chrome.gpuBenchmarking.getGpuDriverBugWorkarounds()')
|
| + if not workaround in gpu_list:
|
| + print 'Test failed. Printing page contents:'
|
| + print tab.EvaluateJavaScript('document.body.innerHTML')
|
| + raise page_test.Failure('%s missing in GPU process workarounds: %s' \
|
| + % (workaround, gpu_list))
|
| +
|
| class GpuProcessTestsStorySet(story_set_module.StorySet):
|
|
|
| """ Tests that accelerated content triggers the creation of a GPU process """
|
| @@ -194,6 +230,7 @@ class GpuProcessTestsStorySet(story_set_module.StorySet):
|
| self.AddStory(NoGpuProcessPage(self, expectations))
|
| self.AddStory(SoftwareGpuProcessPage(self, expectations))
|
| self.AddStory(SkipGpuProcessPage(self, expectations))
|
| + self.AddStory(DriverBugWorkaroundsInGpuProcessPage(self, expectations))
|
|
|
| @property
|
| def allow_mixed_story_states(self):
|
|
|