Commit 13721124 authored by Zhenyao Mo's avatar Zhenyao Mo Committed by Commit Bot

Use GPU list test groups in gpu_process Telemetry tests.

BUG=801331
TEST=GPU bots
R=kbr@chromium.org

Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I1eb337e5b41aa7b74d0aaa27c0d064f1fed7ba78
Reviewed-on: https://chromium-review.googlesource.com/865814Reviewed-by: default avatarKenneth Russell <kbr@chromium.org>
Commit-Queue: Zhenyao Mo <zmo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#529154}
parent 1f0a2122
......@@ -157,6 +157,8 @@ static const char* const kSwitchNames[] = {
#if defined(USE_X11)
switches::kX11Display,
#endif
switches::kGpuBlacklistTestGroup,
switches::kGpuDriverBugListTestGroup,
switches::kGpuTestingGLVendor,
switches::kGpuTestingGLRenderer,
switches::kGpuTestingGLVersion,
......
......@@ -252,31 +252,22 @@ class GpuProcessIntegrationTest(gpu_integration_test.GpuIntegrationTest):
'use_gpu_driver_workaround_for_testing', None)
def _GpuProcess_readback_webgl_gpu_process(self, test_path):
# This test was designed to only run on desktop Linux.
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 kSoftwareRenderingListEntries.
self.RestartBrowserIfNecessaryWithArgs([
'--gpu-testing-vendor-id=0x10de',
'--gpu-testing-device-id=0x0de1',
'--gpu-testing-gl-vendor=VMware',
'--gpu-testing-gl-renderer=Gallium 0.4 ' \
'on llvmpipe (LLVM 3.4, 256 bits)',
'--gpu-testing-gl-version="3.0 Mesa 11.2"'])
self._Navigate(test_path)
feature_status_list = self.tab.EvaluateJavaScript(
'browserBridge.gpuInfo.featureStatus.featureStatus')
result = True
for name, status in feature_status_list.items():
if name == 'webgl':
result = result and status == 'enabled_readback'
elif name == 'webgl2':
result = result and status == 'unavailable_off'
else:
pass
if not result:
self.fail('WebGL readback setup failed: %s' % feature_status_list)
# Hit test group 1 with entry 152 from kSoftwareRenderingListEntries.
self.RestartBrowserIfNecessaryWithArgs([
'--gpu-blacklist-test-group=1'])
self._Navigate(test_path)
feature_status_list = self.tab.EvaluateJavaScript(
'browserBridge.gpuInfo.featureStatus.featureStatus')
result = True
for name, status in feature_status_list.items():
if name == 'webgl':
result = result and status == 'enabled_readback'
elif name == 'webgl2':
result = result and status == 'unavailable_off'
else:
pass
if not result:
self.fail('WebGL readback setup failed: %s' % feature_status_list)
def _GpuProcess_driver_bug_workarounds_upon_gl_renderer(self, test_path):
is_platform_android = self._RunningOnAndroid()
......@@ -326,25 +317,14 @@ class GpuProcessIntegrationTest(gpu_integration_test.GpuIntegrationTest):
self._VerifyGpuProcessPresent()
recorded_workarounds, recorded_disabled_gl_extensions = (
self._CompareAndCaptureDriverBugWorkarounds())
# Add the testing workaround to the recorded workarounds.
recorded_workarounds.append('use_gpu_driver_workaround_for_testing')
# Relaunch the browser with OS-specific command line arguments.
browser_args = ['--use_gpu_driver_workaround_for_testing',
'--disable-gpu-driver-bug-workarounds']
# Inject some info to make sure the flags above are effective.
if sys.platform == 'darwin':
# Hit id 33 from kGpuDriverBugListEntries.
browser_args.extend(['--gpu-testing-gl-vendor=Imagination'])
else:
# Hit id 5 from kGpuDriverBugListEntries.
browser_args.extend(['--gpu-testing-vendor-id=0x10de',
'--gpu-testing-device-id=0x0001'])
# no multi gpu on Android.
if not self._RunningOnAndroid():
browser_args.extend(['--gpu-testing-secondary-vendor-ids=',
'--gpu-testing-secondary-device-ids='])
# Trigger test group 1 with entry 215, where only
# use_gpu_driver_workaround_for_testing is enabled.
browser_args = ['--gpu-driver-bug-list-test-group=1']
for workaround in recorded_workarounds:
browser_args.append('--' + workaround)
# Add the testing workaround to the recorded workarounds.
recorded_workarounds.append('use_gpu_driver_workaround_for_testing')
browser_args.append('--disable-gl-extensions=' +
recorded_disabled_gl_extensions)
self.RestartBrowserIfNecessaryWithArgs(browser_args)
......@@ -439,12 +419,7 @@ class GpuProcessIntegrationTest(gpu_integration_test.GpuIntegrationTest):
def _GpuProcess_disabling_workarounds_works(self, test_path):
# Hit exception from id 215 from kGpuDriverBugListEntries.
self.RestartBrowserIfNecessaryWithArgs([
'--gpu-testing-vendor-id=0xbad9',
'--gpu-testing-device-id=0xbad9',
'--gpu-testing-secondary-vendor-ids=',
'--gpu-testing-secondary-device-ids=',
'--gpu-testing-gl-vendor=FakeVendor',
'--gpu-testing-gl-renderer=FakeRenderer',
'--gpu-driver-bug-list-test-group=1',
'--use_gpu_driver_workaround_for_testing=0'])
self._Navigate(test_path)
workarounds, _ = (
......
......@@ -2289,8 +2289,7 @@
"id": 215,
"description": "Fake no-op GPU driver bug workaround for testing",
"cr_bugs": [682912],
"vendor_id": "0xbad9",
"device_id": ["0xbad9"],
"test_group": 1,
"features": [
"use_gpu_driver_workaround_for_testing"
]
......
......@@ -90,4 +90,12 @@ const char kGpuVendorID[] = "gpu-vendor-id";
// Ignores GPU blacklist.
const char kIgnoreGpuBlacklist[] = "ignore-gpu-blacklist";
// Select a different set of GPU blacklist entries with the specificed
// test_group ID.
const char kGpuBlacklistTestGroup[] = "gpu-blacklist-test-group";
// Select a different set of GPU driver bug list entries with the specificed
// test_group ID.
const char kGpuDriverBugListTestGroup[] = "gpu-driver-bug-list-test-group";
} // namespace switches
......@@ -35,6 +35,8 @@ GPU_EXPORT extern const char kGpuTestingGLRenderer[];
GPU_EXPORT extern const char kGpuTestingGLVersion[];
GPU_EXPORT extern const char kGpuVendorID[];
GPU_EXPORT extern const char kIgnoreGpuBlacklist[];
GPU_EXPORT extern const char kGpuBlacklistTestGroup[];
GPU_EXPORT extern const char kGpuDriverBugListTestGroup[];
} // namespace switches
......
......@@ -355,8 +355,15 @@ GpuFeatureInfo ComputeGpuFeatureInfo(const GPUInfo& gpu_info,
std::unique_ptr<GpuBlacklist> list(GpuBlacklist::Create());
if (log_gpu_control_list_decisions)
list->EnableControlListLogging("gpu_blacklist");
blacklisted_features =
list->MakeDecision(GpuControlList::kOsAny, std::string(), gpu_info);
unsigned target_test_group = 0u;
if (command_line->HasSwitch(switches::kGpuBlacklistTestGroup)) {
std::string test_group_string =
command_line->GetSwitchValueASCII(switches::kGpuBlacklistTestGroup);
if (!base::StringToUint(test_group_string, &target_test_group))
target_test_group = 0u;
}
blacklisted_features = list->MakeDecision(
GpuControlList::kOsAny, std::string(), gpu_info, target_test_group);
}
gpu_feature_info.status_values[GPU_FEATURE_TYPE_GPU_RASTERIZATION] =
......@@ -401,8 +408,15 @@ GpuFeatureInfo ComputeGpuFeatureInfo(const GPUInfo& gpu_info,
std::vector<std::string> driver_bug_disabled_extensions;
if (!disable_gpu_driver_bug_workarounds) {
std::unique_ptr<gpu::GpuDriverBugList> list(GpuDriverBugList::Create());
enabled_driver_bug_workarounds =
list->MakeDecision(GpuControlList::kOsAny, std::string(), gpu_info);
unsigned target_test_group = 0u;
if (command_line->HasSwitch(switches::kGpuDriverBugListTestGroup)) {
std::string test_group_string = command_line->GetSwitchValueASCII(
switches::kGpuDriverBugListTestGroup);
if (!base::StringToUint(test_group_string, &target_test_group))
target_test_group = 0u;
}
enabled_driver_bug_workarounds = list->MakeDecision(
GpuControlList::kOsAny, std::string(), gpu_info, target_test_group);
gpu_feature_info.applied_gpu_driver_bug_list_entries =
list->GetActiveEntries();
......
......@@ -145,10 +145,9 @@ TEST(GpuUtilTest, GetGpuFeatureInfo_WorkaroundFromCommandLine) {
{
base::CommandLine command_line(base::CommandLine::NO_PROGRAM);
command_line.AppendSwitchASCII(switches::kGpuDriverBugListTestGroup, "1");
// See gpu/config/gpu_driver_bug_list.json, test_group 1, entry 215.
GPUInfo gpu_info;
// See gpu/config/gpu_driver_bug_list.json, entry 215.
gpu_info.gpu.vendor_id = 0xbad9;
gpu_info.gpu.device_id = 0xbad9;
GpuFeatureInfo gpu_feature_info =
ComputeGpuFeatureInfo(gpu_info, false, false, false, &command_line);
EXPECT_TRUE(gpu_feature_info.IsWorkaroundEnabled(
......@@ -157,13 +156,12 @@ TEST(GpuUtilTest, GetGpuFeatureInfo_WorkaroundFromCommandLine) {
{
base::CommandLine command_line(base::CommandLine::NO_PROGRAM);
command_line.AppendSwitchASCII(switches::kGpuDriverBugListTestGroup, "1");
command_line.AppendSwitchASCII(GpuDriverBugWorkaroundTypeToString(
USE_GPU_DRIVER_WORKAROUND_FOR_TESTING),
"0");
// See gpu/config/gpu_driver_bug_list.json, test_group 1, entry 215.
GPUInfo gpu_info;
// See gpu/config/gpu_driver_bug_list.json, entry 215.
gpu_info.gpu.vendor_id = 0xbad9;
gpu_info.gpu.device_id = 0xbad9;
GpuFeatureInfo gpu_feature_info =
ComputeGpuFeatureInfo(gpu_info, false, false, false, &command_line);
EXPECT_FALSE(gpu_feature_info.IsWorkaroundEnabled(
......
......@@ -1561,6 +1561,17 @@
"accelerated_2d_canvas",
"gpu_rasterization"
]
},
{
"id": 152,
"description": "Test entry where all features except WebGL blacklisted",
"test_group": 1,
"features": [
"all",
{"exceptions": [
"accelerated_webgl"
]}
]
}
]
}
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