Commit 169ec7e7 authored by Zhenyao Mo's avatar Zhenyao Mo Committed by Commit Bot

Add back direct composition InfoCollection test.

This test was commented out due to flakiness, but we found out
the failures are limited to two bots only where overlay cap is
DIRECT instead of SCALING. So we removed these two bots from
swarming pool so we can add back this test.

However, this time we split it into its own test.

BUG=929469
TEST=Win/Intel GPU bots
R=kbr@chromium.org

Change-Id: Ibe0402996709fbdaceee6f9431b8b58d05f59d33
Reviewed-on: https://chromium-review.googlesource.com/c/1457664Reviewed-by: default avatarKenneth Russell <kbr@chromium.org>
Commit-Queue: Zhenyao Mo <zmo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#630101}
parent 36584543
......@@ -27,7 +27,12 @@ class InfoCollectionTest(gpu_integration_test.GpuIntegrationTest):
@classmethod
def GenerateGpuTests(cls, options):
yield ('_', '_', (options.expected_vendor_id, options.expected_device_id))
yield ('InfoCollection_basic', '_',
('_RunBasicTest',
options.expected_vendor_id,
options.expected_device_id))
yield ('InfoCollection_direct_composition', '_',
('_RunDirectCompositionTest', '_', '_'))
@classmethod
def SetUpProcess(cls):
......@@ -44,19 +49,27 @@ class InfoCollectionTest(gpu_integration_test.GpuIntegrationTest):
if not system_info:
self.fail("Browser doesn't support GetSystemInfo")
gpu = system_info.gpu.devices[0]
if not gpu:
test_func = args[0]
getattr(self, test_func)(system_info.gpu, args[1], args[2])
######################################
# Helper functions for the tests below
def _RunBasicTest(self, gpu, expected_vendor_id_str,
expected_device_id_str):
device = gpu.devices[0]
if not device:
self.fail("System Info doesn't have a gpu")
detected_vendor_id = gpu.vendor_id
detected_device_id = gpu.device_id
detected_vendor_id = device.vendor_id
detected_device_id = device.device_id
# Gather the expected IDs passed on the command line
if args[0] is None or args[1] is None:
if expected_vendor_id_str is None or expected_device_id_str is None:
self.fail("Missing --expected-[vendor|device]-id command line args")
expected_vendor_id = int(args[0], 16)
expected_device_id = int(args[1], 16)
expected_vendor_id = int(expected_vendor_id_str, 16)
expected_device_id = int(expected_device_id_str, 16)
# Check expected and detected GPUs match
if detected_vendor_id != expected_vendor_id:
......@@ -67,21 +80,21 @@ class InfoCollectionTest(gpu_integration_test.GpuIntegrationTest):
self.fail('Device ID mismatch, expected %s but got %s.' %
(expected_device_id, detected_device_id))
# TODO(crbug.com/927883): uncomment / re-enable when we think the
# flakiness is resolved.
# os_name = self.browser.platform.GetOSName()
# if os_name and os_name.lower() == 'win':
# overlay_bot_config = self.GetOverlayBotConfig()
# aux_attributes = system_info.gpu.aux_attributes
# if not aux_attributes:
# self.fail('GPU info does not have aux_attributes.')
# for field, expected in overlay_bot_config.iteritems():
# detected = aux_attributes.get(field, 'NONE')
# if expected != detected:
# self.fail('%s mismatch, expected %s but got %s.' %
# (field, self._ValueToStr(expected), self._ValueToStr(detected)))
def _ValueToStr(self, value):
def _RunDirectCompositionTest(self, gpu, unused_arg_0, unused_arg_1):
os_name = self.browser.platform.GetOSName()
if os_name and os_name.lower() == 'win':
overlay_bot_config = self.GetOverlayBotConfig()
aux_attributes = gpu.aux_attributes
if not aux_attributes:
self.fail('GPU info does not have aux_attributes.')
for field, expected in overlay_bot_config.iteritems():
detected = aux_attributes.get(field, 'NONE')
if expected != detected:
self.fail('%s mismatch, expected %s but got %s.' %
(field, self._ValueToStr(expected), self._ValueToStr(detected)))
@staticmethod
def _ValueToStr(value):
if type(value) is str:
return value
if type(value) is unicode:
......
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