| 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..4224d1c626ec2764c0f4bc113595f5d1961e8956 100644
|
| --- a/content/test/gpu/page_sets/gpu_process_tests.py
|
| +++ b/content/test/gpu/page_sets/gpu_process_tests.py
|
| @@ -169,6 +169,45 @@ 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):
|
| + browser_list = tab.EvaluateJavaScript('GetDriverBugWorkarounds()')
|
| + gpu_list = tab.EvaluateJavaScript( \
|
| + 'chrome.gpuBenchmarking.getGpuDriverBugWorkarounds()')
|
| +
|
| + diff = set(browser_list).symmetric_difference(set(gpu_list))
|
| + if len(diff) > 0:
|
| + print 'Test failed. Printing page contents:'
|
| + print tab.EvaluateJavaScript('document.body.innerHTML')
|
| + raise page_test.Failure('Browser and GPU process list of driver bug' \
|
| + 'workarounds are not equal: %s != %s, diff: %s' % \
|
| + (browser_list, gpu_list, list(diff)))
|
| +
|
| + workaround = 'use_gpu_driver_workaround_for_testing'
|
| +
|
| + if not workaround in gpu_list:
|
| + print 'Test failed. Printing page contents:'
|
| + print tab.EvaluateJavaScript('document.body.innerHTML')
|
| + raise page_test.Failure('%s not present in GPU process workarounds' \
|
| + % workaround)
|
| +
|
| class GpuProcessTestsStorySet(story_set_module.StorySet):
|
|
|
| """ Tests that accelerated content triggers the creation of a GPU process """
|
| @@ -194,6 +233,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):
|
|
|