diff options
author | skyostil@chromium.org <skyostil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-14 11:50:36 +0000 |
---|---|---|
committer | skyostil@chromium.org <skyostil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-14 11:50:36 +0000 |
commit | 53d6c604a5129e4ebb460726aa1eb926da69ca95 (patch) | |
tree | 7e1d6e0e511f3b84eed72063083231d35c2268ba /tools | |
parent | 2051d4b6dfb844647204c3f2e69876e90c0719cf (diff) | |
download | chromium_src-53d6c604a5129e4ebb460726aa1eb926da69ca95.zip chromium_src-53d6c604a5129e4ebb460726aa1eb926da69ca95.tar.gz chromium_src-53d6c604a5129e4ebb460726aa1eb926da69ca95.tar.bz2 |
telemetry: Enable GPU-specific test expectations on Android
Make it possible to specify on a GPU vendor/device basis whether a
telemetry test is expected to pass on Android. On desktop and CrOS we
use the PCI device identifiers for this purpose, but they are not
available on Android. Instead, this patch makes lets us match
expectations against the GL_VENDOR and GL_RENDERER strings.
BUG=306462
Review URL: https://codereview.chromium.org/27009002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@228446 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools')
-rw-r--r-- | tools/telemetry/telemetry/page/test_expectations.py | 9 | ||||
-rw-r--r-- | tools/telemetry/telemetry/page/test_expectations_unittest.py | 43 |
2 files changed, 44 insertions, 8 deletions
diff --git a/tools/telemetry/telemetry/page/test_expectations.py b/tools/telemetry/telemetry/page/test_expectations.py index bd99e71..2c2f2c6 100644 --- a/tools/telemetry/telemetry/page/test_expectations.py +++ b/tools/telemetry/telemetry/page/test_expectations.py @@ -7,7 +7,8 @@ import fnmatch OS_MODIFIERS = ['win', 'xp', 'vista', 'win7', 'mac', 'leopard', 'snowleopard', 'lion', 'mountainlion', 'linux', 'chromeos', 'android'] -GPU_MODIFIERS = ['nvidia', 'amd', 'intel'] +GPU_MODIFIERS = ['amd', 'arm', 'broadcom', 'hisilicon', 'intel', 'imagination', + 'nvidia', 'qualcomm', 'vivante'] CONFIG_MODIFIERS = ['debug', 'release'] class Expectation(object): @@ -31,6 +32,8 @@ class Expectation(object): c0 = c[0].lower() if c0 in GPU_MODIFIERS: self.device_id_conditions.append((c0, c[1])) + else: + raise ValueError('Unknown expectation condition: "%s"' % c0) else: condition = c.lower() if condition in OS_MODIFIERS: @@ -82,7 +85,7 @@ class TestExpectations(object): vendor_string = primary_gpu.vendor_string.lower() vendor_id = primary_gpu.vendor_id if vendor_string: - return vendor_string + return vendor_string.split(' ')[0] elif vendor_id == 0x10DE: return 'nvidia' elif vendor_id == 0x1002: @@ -96,7 +99,7 @@ class TestExpectations(object): if gpu_info: primary_gpu = gpu_info.devices[0] if primary_gpu: - return primary_gpu.device_id + return primary_gpu.device_id or primary_gpu.device_string return 0 diff --git a/tools/telemetry/telemetry/page/test_expectations_unittest.py b/tools/telemetry/telemetry/page/test_expectations_unittest.py index cf0d6a5..20ffcb3 100644 --- a/tools/telemetry/telemetry/page/test_expectations_unittest.py +++ b/tools/telemetry/telemetry/page/test_expectations_unittest.py @@ -12,6 +12,9 @@ VENDOR_NVIDIA = 0x10DE VENDOR_AMD = 0x1002 VENDOR_INTEL = 0x8086 +VENDOR_STRING_IMAGINATION = 'Imagination Technologies' +DEVICE_STRING_SGX = 'PowerVR SGX 554' + class StubPlatform(object): def __init__(self, os_name, os_version_name=None): self.os_name = os_name @@ -24,14 +27,14 @@ class StubPlatform(object): return self.os_version_name class StubBrowser(object): - def __init__(self, platform, gpu, device): + def __init__(self, platform, gpu, device, vendor_string, device_string): self.platform = platform self.system_info = system_info.SystemInfo.FromDict({ 'model_name': '', 'gpu': { 'devices': [ { 'vendor_id': gpu, 'device_id': device, - 'vendor_string': '', 'device_string': '' }, + 'vendor_string': vendor_string, 'device_string': device_string }, ] } }) @@ -53,15 +56,17 @@ class SampleTestExpectations(test_expectations.TestExpectations): self.Fail('page6.html', ['nvidia', 'intel'], bug=123) self.Fail('page7.html', [('nvidia', 0x1001), ('nvidia', 0x1002)], bug=123) self.Fail('page8.html', ['win', 'intel', ('amd', 0x1001)], bug=123) + self.Fail('page9.html', ['imagination']) + self.Fail('page10.html', [('imagination', 'PowerVR SGX 554')]) class TestExpectationsTest(unittest.TestCase): def setUp(self): self.expectations = SampleTestExpectations() - def assertExpectationEquals(self, expected, page, platform='', gpu='', - device=0): + def assertExpectationEquals(self, expected, page, platform='', gpu=0, + device=0, vendor_string='', device_string=''): result = self.expectations.GetExpectationForPage(StubBrowser(platform, gpu, - device), page) + device, vendor_string, device_string), page) self.assertEquals(expected, result) # Pages with no expectations should always return 'pass' @@ -148,3 +153,31 @@ class TestExpectationsTest(unittest.TestCase): StubPlatform('mac'), VENDOR_AMD, 0x1001) self.assertExpectationEquals('pass', page, StubPlatform('win'), VENDOR_AMD, 0x1002) + + # Pages with expectations based on GPU vendor string. + def testGpuVendorStringExpectations(self): + ps = page_set.PageSet() + page = page_module.Page('http://test.com/page9.html', ps) + self.assertExpectationEquals('fail', page, + vendor_string=VENDOR_STRING_IMAGINATION, + device_string=DEVICE_STRING_SGX) + self.assertExpectationEquals('fail', page, + vendor_string=VENDOR_STRING_IMAGINATION, + device_string='Triangle Monster 3000') + self.assertExpectationEquals('pass', page, + vendor_string='Acme', + device_string=DEVICE_STRING_SGX) + + # Pages with expectations based on GPU vendor and renderer string pairs. + def testGpuDeviceStringExpectations(self): + ps = page_set.PageSet() + page = page_module.Page('http://test.com/page10.html', ps) + self.assertExpectationEquals('fail', page, + vendor_string=VENDOR_STRING_IMAGINATION, + device_string=DEVICE_STRING_SGX) + self.assertExpectationEquals('pass', page, + vendor_string=VENDOR_STRING_IMAGINATION, + device_string='Triangle Monster 3000') + self.assertExpectationEquals('pass', page, + vendor_string='Acme', + device_string=DEVICE_STRING_SGX) |