| 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 84207c628e64105a0beab6d408cd356c1d1163ef..211ca86a55b35b001140065680d129a83edee757 100644
|
| --- a/content/test/gpu/page_sets/gpu_process_tests.py
|
| +++ b/content/test/gpu/page_sets/gpu_process_tests.py
|
| @@ -15,6 +15,7 @@ class GpuProcessSharedPageState(gpu_test_base.GpuSharedPageState):
|
| '--gpu-testing-device-id',
|
| '--gpu-testing-secondary-vendor-ids',
|
| '--gpu-testing-secondary-device-ids',
|
| + '--gpu-testing-driver-date',
|
| '--gpu-testing-gl-vendor',
|
| '--gpu-testing-gl-renderer',
|
| '--gpu-testing-gl-version']
|
| @@ -68,6 +69,57 @@ class IdentifyActiveGpuPageBase(gpu_test_base.PageBase):
|
| raise page_test.Failure('Inactive GPU field is wrong %s' % inactive_gpus)
|
|
|
|
|
| +class DriverBugWorkaroundsTestsPage(gpu_test_base.PageBase):
|
| + def __init__(self, page_set=None, name='',
|
| + shared_page_state_class=None,
|
| + expectations=None,
|
| + expected_workaround=None,
|
| + unexpected_workaround=None):
|
| + super(DriverBugWorkaroundsTestsPage, self).__init__(
|
| + url='chrome:gpu',
|
| + page_set=page_set,
|
| + name=name,
|
| + shared_page_state_class=shared_page_state_class,
|
| + expectations=expectations)
|
| + self.expected_workaround = expected_workaround
|
| + self.unexpected_workaround = unexpected_workaround
|
| +
|
| + def _Validate(self, tab, process_kind, is_expected, workaround_name):
|
| + if process_kind == "browser_process":
|
| + gpu_driver_bug_workarounds = tab.EvaluateJavaScript( \
|
| + 'GetDriverBugWorkarounds()')
|
| + elif process_kind == "gpu_process":
|
| + gpu_driver_bug_workarounds = tab.EvaluateJavaScript( \
|
| + 'chrome.gpuBenchmarking.getGpuDriverBugWorkarounds()')
|
| +
|
| + is_present = workaround_name in gpu_driver_bug_workarounds
|
| +
|
| + failure = False
|
| + if is_expected and not is_present:
|
| + failure = True
|
| + error_message = "is missing"
|
| + elif not is_expected and is_present:
|
| + failure = True
|
| + error_message = "is not expected"
|
| +
|
| + if failure:
|
| + print 'Test failed. Printing page contents:'
|
| + print tab.EvaluateJavaScript('document.body.innerHTML')
|
| + raise page_test.Failure('%s %s in Browser process workarounds: %s' \
|
| + % (workaround_name, error_message, gpu_driver_bug_workarounds))
|
| +
|
| + def Validate(self, tab, results):
|
| + if not self.expected_workaround and not self.unexpected_workaround:
|
| + return
|
| +
|
| + if self.expected_workaround:
|
| + self._Validate(tab, "browser_process", True, self.expected_workaround)
|
| + self._Validate(tab, "gpu_process", True, self.expected_workaround)
|
| +
|
| + if self.unexpected_workaround:
|
| + self._Validate(tab, "browser_process", False, self.unexpected_workaround)
|
| + self._Validate(tab, "gpu_process", False, self.unexpected_workaround)
|
| +
|
| class GpuProcessTestsPage(gpu_test_base.PageBase):
|
| def __init__(self, url, name, story_set, expectations):
|
| super(GpuProcessTestsPage, self).__init__(url=url,
|
| @@ -208,40 +260,76 @@ class SkipGpuProcessPage(gpu_test_base.PageBase):
|
| raise page_test.Failure('GPU process detected')
|
|
|
|
|
| -class DriverBugWorkaroundsSharedPageState(GpuProcessSharedPageState):
|
| +class DriverBugWorkaroundsShared(GpuProcessSharedPageState):
|
| def __init__(self, test, finder_options, story_set):
|
| - super(DriverBugWorkaroundsSharedPageState, self).__init__(
|
| + super(DriverBugWorkaroundsShared, 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):
|
| +class DriverBugWorkaroundsInGpuProcessPage(DriverBugWorkaroundsTestsPage):
|
| 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)
|
| + shared_page_state_class=DriverBugWorkaroundsShared,
|
| + expectations=expectations,
|
| + expected_workaround='use_gpu_driver_workaround_for_testing')
|
|
|
| def Validate(self, tab, results):
|
| - workaround = 'use_gpu_driver_workaround_for_testing'
|
| + super(DriverBugWorkaroundsInGpuProcessPage, self).Validate(tab, results)
|
|
|
| - 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 DriverBugWorkaroundsUponGLRendererShared(GpuProcessSharedPageState):
|
| + def __init__(self, test, finder_options, story_set):
|
| + super(DriverBugWorkaroundsUponGLRendererShared, self).__init__(
|
| + test, finder_options, story_set)
|
| + options = finder_options.browser_options
|
| + if sys.platform in ('cygwin', 'win32'):
|
| + # Hit id 51 and 87 from kGpuDriverBugListJson.
|
| + options.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x1002')
|
| + options.AppendExtraBrowserArgs('--gpu-testing-device-id=0x6779')
|
| + options.AppendExtraBrowserArgs('--gpu-testing-driver-date=11-20-2014')
|
| + options.AppendExtraBrowserArgs('--gpu-testing-gl-vendor=Google Inc.')
|
| + options.AppendExtraBrowserArgs('--gpu-testing-gl-renderer=ANGLE ' \
|
| + '(AMD Radeon HD 6450 Direct3D11 vs_5_0 ps_5_0)')
|
| + options.AppendExtraBrowserArgs('--gpu-testing-gl-version=OpenGL ES 2.0 ' \
|
| + '(ANGLE 2.1.0.0c0d8006a9dd)')
|
| + elif sys.platform.startswith('linux'):
|
| + # Hit id 153 from kGpuDriverBugListJson.
|
| + options.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x0101')
|
| + options.AppendExtraBrowserArgs('--gpu-testing-device-id=0x0102')
|
| + options.AppendExtraBrowserArgs('--gpu-testing-gl-vendor=Vivante ' \
|
| + 'Corporation')
|
| + options.AppendExtraBrowserArgs('--gpu-testing-gl-renderer=Vivante GC1000')
|
| + elif sys.platform == 'darwin':
|
| + # Currently on osx no workaround relies on gl-renderer.
|
| + pass
|
| +
|
| +
|
| +class DriverBugWorkaroundsUponGLRendererPage(DriverBugWorkaroundsTestsPage):
|
| + def __init__(self, story_set, expectations):
|
| + self.expected_workaround = None
|
| + self.unexpected_workaround = None
|
| +
|
| + if sys.platform in ('cygwin', 'win32'):
|
| + self.expected_workaround = "texsubimage_faster_than_teximage"
|
| + self.unexpected_workaround = "disable_d3d11"
|
| + elif sys.platform.startswith('linux'):
|
| + self.expected_workaround = "disable_multisampled_render_to_texture"
|
| + elif sys.platform == 'darwin':
|
| + pass
|
| + super(DriverBugWorkaroundsUponGLRendererPage, self).__init__(
|
| + name='GpuProcess.driver_bug_workarounds_upon_gl_renderer',
|
| + page_set=story_set,
|
| + shared_page_state_class=DriverBugWorkaroundsUponGLRendererShared,
|
| + expectations=expectations,
|
| + expected_workaround=self.expected_workaround,
|
| + unexpected_workaround=self.unexpected_workaround)
|
| +
|
| + def Validate(self, tab, results):
|
| + super(DriverBugWorkaroundsUponGLRendererPage, self).Validate(tab, results)
|
|
|
|
|
| class IdentifyActiveGpuSharedPageState1(GpuProcessSharedPageState):
|
| @@ -441,6 +529,7 @@ class GpuProcessTestsStorySet(story_set_module.StorySet):
|
| self.AddStory(IdentifyActiveGpuPage3(self, expectations))
|
| self.AddStory(IdentifyActiveGpuPage4(self, expectations))
|
| self.AddStory(ReadbackWebGLGpuProcessPage(self, expectations))
|
| + self.AddStory(DriverBugWorkaroundsUponGLRendererPage(self, expectations))
|
|
|
| @property
|
| def allow_mixed_story_states(self):
|
|
|