Commit 52f0c623 authored by kylechar's avatar kylechar Committed by Commit Bot

Reland "Fix GPU integration test tags"

This is a reland of 40eb3bd7. Don't
change use-vulkan tag to be vulkan since that's already used by ANGLE.

Original change's description:
> Fix GPU integration test tags
>
> Both [no-]skia-renderer and [no-]use-vulkan tags in GPU integration
> tests were based on the command line. Code assumed that if there was
> nothing on the command line then the feature was disabled which was
> incorrect.
>
> Change the tags to be based on if the feature is enabled or not. Also
> change use-vulkan to just be vulkan for brevity.
>
> Bug: 1069551, 1084569
> Change-Id: I33fdbfb4d8078127f066f4a86a267477e4e9e020
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2209348
> Reviewed-by: Zhenyao Mo <zmo@chromium.org>
> Commit-Queue: kylechar <kylechar@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#770579}

Bug: 1069551, 1084569
Change-Id: Ia9a816e18b0de283185ccda7c14e6e412fdf1eaf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2210627Reviewed-by: default avatarZhenyao Mo <zmo@chromium.org>
Reviewed-by: default avatarYuly Novikov <ynovikov@chromium.org>
Commit-Queue: kylechar <kylechar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#770801}
parent 9a489c4a
...@@ -133,24 +133,22 @@ def GetCommandDecoder(gpu_info): ...@@ -133,24 +133,22 @@ def GetCommandDecoder(gpu_info):
return 'no_passthrough' return 'no_passthrough'
# Used to parse additional options sent to the browser instance via # Used to check GPU feature status to see if SkiaRenderer is enabled.
# '--extra-browser-args', looking for '--enable-features=UseSkiaRenderer' which def GetSkiaRenderer(gpu_feature_status):
# may be merged with additional feature flags. if gpu_feature_status and 'skia_renderer' in gpu_feature_status:
def GetSkiaRenderer(extra_browser_args): if gpu_feature_status['skia_renderer'] == 'enabled_on':
if extra_browser_args: return 'skia-renderer'
for o in extra_browser_args:
if o.startswith('--enable-features') and "UseSkiaRenderer" in o:
return 'skia-renderer'
if o.startswith('--disable-features') and "UseSkiaRenderer" in o:
return 'no-skia-renderer'
if "--disable-vulkan-fallback-to-gl-for-testing" in o:
return 'skia-renderer'
# TODO(kylechar): The feature is enabled/disabled differently depending on
# platform and official build status. Find out if SkiaRenderer is enabled
# through GPU info instead.
return 'no-skia-renderer' return 'no-skia-renderer'
# Used to check GPU feature status to see if Vulkan is enabled.
def GetVulkan(gpu_feature_status):
if gpu_feature_status and 'vulkan' in gpu_feature_status:
if gpu_feature_status['vulkan'] == 'enabled_on':
return 'use-vulkan'
return 'no-use-vulkan'
# Used to parse additional options sent to the browser instance via # Used to parse additional options sent to the browser instance via
# '--extra-browser-args', looking for '--use-gl='. # '--extra-browser-args', looking for '--use-gl='.
def GetGL(extra_browser_args): def GetGL(extra_browser_args):
...@@ -161,19 +159,10 @@ def GetGL(extra_browser_args): ...@@ -161,19 +159,10 @@ def GetGL(extra_browser_args):
return 'no-use-gl' return 'no-use-gl'
# Used to parse additional options sent to the browser instance via
# '--extra-browser-args', looking for '--use-vulkan='.
def GetVulkan(extra_browser_args):
if extra_browser_args:
for o in extra_browser_args:
if "--use-vulkan=" in o:
return 'use-vulkan'
return 'no-use-vulkan'
# Used to parse additional options sent to the browser instance via # Used to parse additional options sent to the browser instance via
# '--extra-browser-args', looking for '--enable-features=SkiaDawn' which # '--extra-browser-args', looking for '--enable-features=SkiaDawn' which
# may be merged with additional feature flags. # may be merged with additional feature flags.
# TODO(sgilhuly): Use GPU feature status for Dawn instead of command line.
def GetSkiaDawn(extra_browser_args): def GetSkiaDawn(extra_browser_args):
if extra_browser_args: if extra_browser_args:
for o in extra_browser_args: for o in extra_browser_args:
......
...@@ -445,16 +445,19 @@ class GpuIntegrationTest( ...@@ -445,16 +445,19 @@ class GpuIntegrationTest(
gpu_tags.extend([gpu_vendor, gpu_device_tag]) gpu_tags.extend([gpu_vendor, gpu_device_tag])
# all spaces and underscores in the tag will be replaced by dashes # all spaces and underscores in the tag will be replaced by dashes
tags.extend([re.sub('[ _]', '-', tag) for tag in gpu_tags]) tags.extend([re.sub('[ _]', '-', tag) for tag in gpu_tags])
# Add tags based on GPU feature status.
skia_renderer = gpu_helper.GetSkiaRenderer(gpu_info.feature_status)
tags.append(skia_renderer)
use_vulkan = gpu_helper.GetVulkan(gpu_info.feature_status)
tags.append(use_vulkan)
# If additional options have been set via '--extra-browser-args' check for # If additional options have been set via '--extra-browser-args' check for
# those which map to expectation tags. The '_browser_backend' attribute may # those which map to expectation tags. The '_browser_backend' attribute may
# not exist in unit tests. # not exist in unit tests.
if hasattr(browser, 'startup_args'): if hasattr(browser, 'startup_args'):
skia_renderer = gpu_helper.GetSkiaRenderer(browser.startup_args)
tags.append(skia_renderer)
use_gl = gpu_helper.GetGL(browser.startup_args) use_gl = gpu_helper.GetGL(browser.startup_args)
tags.append(use_gl) tags.append(use_gl)
use_vulkan = gpu_helper.GetVulkan(browser.startup_args)
tags.append(use_vulkan)
use_skia_dawn = gpu_helper.GetSkiaDawn(browser.startup_args) use_skia_dawn = gpu_helper.GetSkiaDawn(browser.startup_args)
tags.append(use_skia_dawn) tags.append(use_skia_dawn)
return tags return tags
......
...@@ -190,7 +190,8 @@ class GpuIntegrationTestUnittest(unittest.TestCase): ...@@ -190,7 +190,8 @@ class GpuIntegrationTestUnittest(unittest.TestCase):
_GetTagsToTest(browser), _GetTagsToTest(browser),
set([ set([
'win', 'win10', 'release', 'nvidia', 'nvidia-0x1cb3', 'd3d9', 'win', 'win10', 'release', 'nvidia', 'nvidia-0x1cb3', 'd3d9',
'no-passthrough', 'no-swiftshader-gl' 'no-passthrough', 'no-swiftshader-gl', 'no-use-vulkan',
'no-skia-renderer'
])) ]))
def testGenerateVendorTagUsingVendorString(self): def testGenerateVendorTagUsingVendorString(self):
...@@ -206,7 +207,7 @@ class GpuIntegrationTestUnittest(unittest.TestCase): ...@@ -206,7 +207,7 @@ class GpuIntegrationTestUnittest(unittest.TestCase):
set([ set([
'mac', 'mojave', 'release', 'imagination', 'mac', 'mojave', 'release', 'imagination',
'imagination-PowerVR-SGX-554', 'opengles', 'passthrough', 'imagination-PowerVR-SGX-554', 'opengles', 'passthrough',
'no-swiftshader-gl' 'no-swiftshader-gl', 'no-use-vulkan', 'no-skia-renderer'
])) ]))
def testGenerateVendorTagUsingDeviceString(self): def testGenerateVendorTagUsingDeviceString(self):
...@@ -220,7 +221,7 @@ class GpuIntegrationTestUnittest(unittest.TestCase): ...@@ -220,7 +221,7 @@ class GpuIntegrationTestUnittest(unittest.TestCase):
set([ set([
'mac', 'mojave', 'release', 'imagination', 'mac', 'mojave', 'release', 'imagination',
'imagination-Triangle-Monster-3000', 'no-angle', 'no-passthrough', 'imagination-Triangle-Monster-3000', 'no-angle', 'no-passthrough',
'no-swiftshader-gl' 'no-swiftshader-gl', 'no-use-vulkan', 'no-skia-renderer'
])) ]))
def testSimpleIntegrationTest(self): def testSimpleIntegrationTest(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment