Chromium Code Reviews| Index: content/test/gpu/gpu_tests/gpu_process_integration_test.py |
| diff --git a/content/test/gpu/gpu_tests/gpu_process_integration_test.py b/content/test/gpu/gpu_tests/gpu_process_integration_test.py |
| index 207bbadc009075a1fbb34b106b934f38eeb8d5f7..ccc6cea1e416fb1d92947e1b6dbaa66e5cac9318 100644 |
| --- a/content/test/gpu/gpu_tests/gpu_process_integration_test.py |
| +++ b/content/test/gpu/gpu_tests/gpu_process_integration_test.py |
| @@ -299,12 +299,12 @@ class GpuProcessIntegrationTest(gpu_integration_test.GpuIntegrationTest): |
| # browser into a state where it won't launch. |
| return |
| elif sys.platform in ('cygwin', 'win32'): |
| - # Hit id 34 from kSoftwareRenderingListJson. |
| + # Hit id 34 from kSoftwareRenderingListEntries. |
| self.RestartBrowserIfNecessaryWithArgs([ |
| '--gpu-testing-vendor-id=0x5333', |
| '--gpu-testing-device-id=0x8811']) |
| elif sys.platform.startswith('linux'): |
| - # Hit id 50 from kSoftwareRenderingListJson. |
| + # Hit id 50 from kSoftwareRenderingListEntries. |
| self.RestartBrowserIfNecessaryWithArgs([ |
| '--gpu-no-complete-info-collection', |
| '--gpu-testing-vendor-id=0x10de', |
| @@ -313,7 +313,7 @@ class GpuProcessIntegrationTest(gpu_integration_test.GpuIntegrationTest): |
| '--gpu-testing-gl-renderer=softpipe', |
| '--gpu-testing-gl-version="2.1 Mesa 10.1"']) |
| elif sys.platform == 'darwin': |
| - # Hit id 112 from kSoftwareRenderingListJson. |
| + # Hit id 112 from kSoftwareRenderingListEntries. |
| self.RestartBrowserIfNecessaryWithArgs([ |
| '--gpu-testing-vendor-id=0x8086', |
| '--gpu-testing-device-id=0x0116']) |
| @@ -333,7 +333,7 @@ class GpuProcessIntegrationTest(gpu_integration_test.GpuIntegrationTest): |
| options = self.__class__._original_finder_options.browser_options |
| is_platform_android = options.browser_type.startswith('android') |
| if sys.platform.startswith('linux') and not is_platform_android: |
| - # Hit id 110 from kSoftwareRenderingListJson. |
| + # Hit id 110 from kSoftwareRenderingListEntries. |
| self.RestartBrowserIfNecessaryWithArgs([ |
| '--gpu-testing-vendor-id=0x10de', |
| '--gpu-testing-device-id=0x0de1', |
| @@ -362,13 +362,13 @@ class GpuProcessIntegrationTest(gpu_integration_test.GpuIntegrationTest): |
| def _GpuProcess_driver_bug_workarounds_upon_gl_renderer(self, test_path): |
| is_platform_android = self._RunningOnAndroid() |
| if is_platform_android: |
| - # Hit id 108 from kGpuDriverBugListJson. |
| + # Hit id 108 from kGpuDriverBugListEntries. |
| self.RestartBrowserIfNecessaryWithArgs([ |
| '--gpu-testing-gl-vendor=NVIDIA Corporation', |
| '--gpu-testing-gl-renderer=NVIDIA Tegra', |
| '--gpu-testing-gl-version=OpenGL ES 3.1 NVIDIA 343.00']) |
| elif sys.platform in ('cygwin', 'win32'): |
| - # Hit id 51 and 87 from kGpuDriverBugListJson. |
| + # Hit id 51 and 87 from kGpuDriverBugListEntries. |
| self.RestartBrowserIfNecessaryWithArgs([ |
| '--gpu-testing-vendor-id=0x1002', |
| '--gpu-testing-device-id=0x6779', |
| @@ -378,7 +378,7 @@ class GpuProcessIntegrationTest(gpu_integration_test.GpuIntegrationTest): |
| '(AMD Radeon HD 6450 Direct3D11 vs_5_0 ps_5_0)', |
| '--gpu-testing-gl-version=OpenGL ES 2.0 (ANGLE 2.1.0.0c0d8006a9dd)']) |
| elif sys.platform.startswith('linux'): |
| - # Hit id 40 from kGpuDriverBugListJson. |
| + # Hit id 40 from kGpuDriverBugListEntries. |
| self.RestartBrowserIfNecessaryWithArgs([ |
| '--gpu-testing-vendor-id=0x0101', |
| '--gpu-testing-device-id=0x0102', |
| @@ -414,10 +414,10 @@ class GpuProcessIntegrationTest(gpu_integration_test.GpuIntegrationTest): |
| '--disable-gpu-driver-bug-workarounds'] |
| # Inject some info to make sure the flags above are effective. |
| if sys.platform == 'darwin': |
| - # Hit id 33 from kGpuDriverBugListJson. |
| + # Hit id 33 from kGpuDriverBugListEntries. |
| browser_args.extend(['--gpu-testing-gl-vendor=Imagination']) |
| else: |
| - # Hit id 5 from kGpuDriverBugListJson. |
| + # Hit id 5 from kGpuDriverBugListEntries. |
| browser_args.extend(['--gpu-testing-vendor-id=0x10de', |
| '--gpu-testing-device-id=0x0001']) |
| # no multi gpu on Android. |
| @@ -518,7 +518,7 @@ class GpuProcessIntegrationTest(gpu_integration_test.GpuIntegrationTest): |
| []) |
| def _GpuProcess_disabling_workarounds_works(self, test_path): |
| - # Hit exception from id 215 from kGpuDriverBugListJson. |
| + # Hit exception from id 215 from kGpuDriverBugListEntries. |
| self.RestartBrowserIfNecessaryWithArgs([ |
| '--gpu-testing-vendor-id=0xbad9', |
| '--gpu-testing-device-id=0xbad9', |
| @@ -539,32 +539,38 @@ class GpuProcessIntegrationTest(gpu_integration_test.GpuIntegrationTest): |
| # process. On Windows, and eventually on other platforms where |
| # SwiftShader is used, this test should pass. |
| # |
| - # TODO(kbr): figure out a better way than --disable-gpu to |
| - # reliably trigger SwiftShader. |
| - self.RestartBrowserIfNecessaryWithArgs(['--disable-gpu']) |
| - self._NavigateAndWait(test_path) |
| - # It looks like when SwiftShader is in use (via --disable-gpu), |
| - # that GPU information collection doesn't yet contain what's |
| - # expected (the system_info.gpu.aux_attributes['gl_renderer'] |
| - # looks like it'll be null). Verified locally that we can fetch |
| - # the desired information via WebGL. |
| - renderer = self.tab.EvaluateJavaScript('gl_renderer') |
| - if not renderer: |
| - self.fail('getParameter(UNMASKED_RENDERER_WEBGL) was null') |
| - if 'SwiftShader' not in renderer: |
| - self.fail('Expected SwiftShader renderer; instead got ' + renderer) |
| - if not self.browser.supports_system_info: |
| - self.fail("Browser doesn't support GetSystemInfo") |
| - gpu = self.browser.GetSystemInfo().gpu |
| - if not gpu: |
| - self.fail('Target machine must have a GPU') |
| - if not gpu.aux_attributes: |
| - self.fail('Browser must support GPU aux attributes') |
| - if not gpu.aux_attributes['software_rendering']: |
| - self.fail("Software rendering was disabled") |
| - device = gpu.devices[0] |
| - if not device: |
| - self.fail("System Info doesn't have a device") |
| + args_list = ([ |
| + # Hit id 4 from kSoftwareRenderingListEntries. |
| + '--gpu-testing-vendor-id=0x8086', |
| + '--gpu-testing-device-id=0x27A2'], |
|
Ken Russell (switch to Gerrit)
2017/04/14 22:11:07
We should start adding some fake entries to the so
|
| + # Explicitly disable GPU access. |
| + ['--disable-gpu']) |
| + for args in args_list: |
| + self.RestartBrowserIfNecessaryWithArgs(args) |
| + self._NavigateAndWait(test_path) |
| + # Validate the WebGL unmasked renderer string. |
| + renderer = self.tab.EvaluateJavaScript('gl_renderer') |
| + if not renderer: |
| + self.fail('getParameter(UNMASKED_RENDERER_WEBGL) was null') |
| + if 'SwiftShader' not in renderer: |
| + self.fail('Expected SwiftShader renderer; instead got ' + renderer) |
| + # Validate GPU info. |
| + if not self.browser.supports_system_info: |
| + self.fail("Browser doesn't support GetSystemInfo") |
| + gpu = self.browser.GetSystemInfo().gpu |
| + if not gpu: |
| + self.fail('Target machine must have a GPU') |
| + if not gpu.aux_attributes: |
| + self.fail('Browser must support GPU aux attributes') |
| + if not gpu.aux_attributes['software_rendering']: |
| + self.fail("Software rendering was disabled") |
| + if 'SwiftShader' not in gpu.aux_attributes['gl_renderer']: |
| + self.fail("Expected 'SwiftShader' in GPU info GL renderer string") |
| + if 'Google' not in gpu.aux_attributes['gl_vendor']: |
| + self.fail("Expected 'Google' in GPU info GL vendor string") |
| + device = gpu.devices[0] |
| + if not device: |
| + self.fail("System Info doesn't have a device") |
| def load_tests(loader, tests, pattern): |
| del loader, tests, pattern # Unused. |