| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import logging | 5 import logging |
| 6 import os | 6 import os |
| 7 | 7 |
| 8 from gpu_tests import gpu_integration_test | 8 from gpu_tests import gpu_integration_test |
| 9 from gpu_tests import path_util | 9 from gpu_tests import path_util |
| 10 from gpu_tests import webgl_conformance_expectations | 10 from gpu_tests import webgl_conformance_expectations |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 def _CompareVersion(version1, version2): | 83 def _CompareVersion(version1, version2): |
| 84 ver_num1 = [int(x) for x in version1.split('.')] | 84 ver_num1 = [int(x) for x in version1.split('.')] |
| 85 ver_num2 = [int(x) for x in version2.split('.')] | 85 ver_num2 = [int(x) for x in version2.split('.')] |
| 86 size = min(len(ver_num1), len(ver_num2)) | 86 size = min(len(ver_num1), len(ver_num2)) |
| 87 return cmp(ver_num1[0:size], ver_num2[0:size]) | 87 return cmp(ver_num1[0:size], ver_num2[0:size]) |
| 88 | 88 |
| 89 | 89 |
| 90 class WebGLConformanceIntegrationTest(gpu_integration_test.GpuIntegrationTest): | 90 class WebGLConformanceIntegrationTest(gpu_integration_test.GpuIntegrationTest): |
| 91 | 91 |
| 92 _webgl_version = None | 92 _webgl_version = None |
| 93 _is_asan = False |
| 93 | 94 |
| 94 @classmethod | 95 @classmethod |
| 95 def Name(cls): | 96 def Name(cls): |
| 96 return 'webgl_conformance' | 97 return 'webgl_conformance' |
| 97 | 98 |
| 98 @classmethod | 99 @classmethod |
| 99 def AddCommandlineArgs(cls, parser): | 100 def AddCommandlineArgs(cls, parser): |
| 100 parser.add_option('--webgl-conformance-version', | 101 parser.add_option('--webgl-conformance-version', |
| 101 help='Version of the WebGL conformance tests to run.', | 102 help='Version of the WebGL conformance tests to run.', |
| 102 default='1.0.4') | 103 default='1.0.4') |
| 103 parser.add_option('--webgl2-only', | 104 parser.add_option('--webgl2-only', |
| 104 help='Whether we include webgl 1 tests if version is 2.0.0 or above.', | 105 help='Whether we include webgl 1 tests if version is 2.0.0 or above.', |
| 105 default='false') | 106 default='false') |
| 107 parser.add_option('--is-asan', |
| 108 help='Indicates whether currently running an ASAN build', |
| 109 action='store_true') |
| 106 | 110 |
| 107 @classmethod | 111 @classmethod |
| 108 def GenerateGpuTests(cls, options): | 112 def GenerateGpuTests(cls, options): |
| 109 # | 113 # |
| 110 # Conformance tests | 114 # Conformance tests |
| 111 # | 115 # |
| 112 test_paths = cls._ParseTests( | 116 test_paths = cls._ParseTests( |
| 113 '00_test_list.txt', | 117 '00_test_list.txt', |
| 114 options.webgl_conformance_version, | 118 options.webgl_conformance_version, |
| 115 (options.webgl2_only == 'true'), | 119 (options.webgl2_only == 'true'), |
| 116 None) | 120 None) |
| 117 cls._webgl_version = [ | 121 cls._webgl_version = [ |
| 118 int(x) for x in options.webgl_conformance_version.split('.')][0] | 122 int(x) for x in options.webgl_conformance_version.split('.')][0] |
| 123 cls._is_asan = options.is_asan |
| 119 for test_path in test_paths: | 124 for test_path in test_paths: |
| 120 # generated test name cannot contain '.' | 125 # generated test name cannot contain '.' |
| 121 name = _GenerateTestNameFromTestPath(test_path).replace( | 126 name = _GenerateTestNameFromTestPath(test_path).replace( |
| 122 '.', '_') | 127 '.', '_') |
| 123 yield (name, | 128 yield (name, |
| 124 os.path.join(conformance_relpath, test_path), | 129 os.path.join(conformance_relpath, test_path), |
| 125 ('_RunConformanceTest')) | 130 ('_RunConformanceTest')) |
| 126 | 131 |
| 127 # | 132 # |
| 128 # Extension tests | 133 # Extension tests |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 browser_options.AppendExtraBrowserArgs([ | 296 browser_options.AppendExtraBrowserArgs([ |
| 292 '--disable-gl-extensions=GL_EXT_disjoint_timer_query', | 297 '--disable-gl-extensions=GL_EXT_disjoint_timer_query', |
| 293 '--ignore_egl_sync_failures', | 298 '--ignore_egl_sync_failures', |
| 294 ]) | 299 ]) |
| 295 | 300 |
| 296 @classmethod | 301 @classmethod |
| 297 def _CreateExpectations(cls): | 302 def _CreateExpectations(cls): |
| 298 assert cls._webgl_version == 1 or cls._webgl_version == 2 | 303 assert cls._webgl_version == 1 or cls._webgl_version == 2 |
| 299 if cls._webgl_version == 1: | 304 if cls._webgl_version == 1: |
| 300 return webgl_conformance_expectations.WebGLConformanceExpectations( | 305 return webgl_conformance_expectations.WebGLConformanceExpectations( |
| 301 conformance_path, url_prefixes=url_prefixes_to_trim) | 306 conformance_path, url_prefixes=url_prefixes_to_trim, |
| 307 is_asan=cls._is_asan) |
| 302 else: | 308 else: |
| 303 return webgl2_conformance_expectations.WebGL2ConformanceExpectations( | 309 return webgl2_conformance_expectations.WebGL2ConformanceExpectations( |
| 304 conformance_path, url_prefixes=url_prefixes_to_trim) | 310 conformance_path, url_prefixes=url_prefixes_to_trim, |
| 311 is_asan=cls._is_asan) |
| 305 | 312 |
| 306 @classmethod | 313 @classmethod |
| 307 def setUpClass(cls): | 314 def setUpClass(cls): |
| 308 super(cls, WebGLConformanceIntegrationTest).setUpClass() | 315 super(WebGLConformanceIntegrationTest, cls).setUpClass() |
| 309 cls.CustomizeOptions() | 316 cls.CustomizeOptions() |
| 310 cls.SetBrowserOptions(cls._finder_options) | 317 cls.SetBrowserOptions(cls._finder_options) |
| 311 cls.StartBrowser() | 318 cls.StartBrowser() |
| 312 # By setting multiple server directories, the root of the server | 319 # By setting multiple server directories, the root of the server |
| 313 # implicitly becomes the common base directory, i.e., the Chromium | 320 # implicitly becomes the common base directory, i.e., the Chromium |
| 314 # src dir, and all URLs have to be specified relative to that. | 321 # src dir, and all URLs have to be specified relative to that. |
| 315 cls.SetStaticServerDirs([ | 322 cls.SetStaticServerDirs([ |
| 316 os.path.join(path_util.GetChromiumSrcDir(), conformance_relpath), | 323 os.path.join(path_util.GetChromiumSrcDir(), conformance_relpath), |
| 317 os.path.join(path_util.GetChromiumSrcDir(), extensions_relpath)]) | 324 os.path.join(path_util.GetChromiumSrcDir(), extensions_relpath)]) |
| 318 | 325 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 # We only check min-version >= 2.0.0 for the top level list. | 389 # We only check min-version >= 2.0.0 for the top level list. |
| 383 test_paths += cls._ParseTests( | 390 test_paths += cls._ParseTests( |
| 384 include_path, version, webgl2_only, min_version_to_compare) | 391 include_path, version, webgl2_only, min_version_to_compare) |
| 385 else: | 392 else: |
| 386 test = os.path.join(current_dir, test_name) | 393 test = os.path.join(current_dir, test_name) |
| 387 if webgl_version > 1: | 394 if webgl_version > 1: |
| 388 test += '?webglVersion=' + str(webgl_version) | 395 test += '?webglVersion=' + str(webgl_version) |
| 389 test_paths.append(test) | 396 test_paths.append(test) |
| 390 | 397 |
| 391 return test_paths | 398 return test_paths |
| OLD | NEW |