| 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 from gpu_tests import gpu_integration_test | 5 from gpu_tests import gpu_integration_test |
| 6 from gpu_tests import webgl_conformance | 6 from gpu_tests import webgl_conformance |
| 7 from gpu_tests import webgl_conformance_expectations | 7 from gpu_tests import webgl_conformance_expectations |
| 8 from gpu_tests import webgl2_conformance_expectations | 8 from gpu_tests import webgl2_conformance_expectations |
| 9 | 9 |
| 10 | 10 |
| 11 class WebGLConformanceIntegrationTest(gpu_integration_test.GpuIntegrationTest): | 11 class WebGLConformanceIntegrationTest(gpu_integration_test.GpuIntegrationTest): |
| 12 | 12 |
| 13 _webgl_version = None | 13 _webgl_version = None |
| 14 | 14 |
| 15 _first_time = True |
| 16 |
| 15 @classmethod | 17 @classmethod |
| 16 def Name(cls): | 18 def Name(cls): |
| 17 return 'webgl_conformance' | 19 return 'webgl_conformance' |
| 18 | 20 |
| 19 @classmethod | 21 @classmethod |
| 20 def AddCommandlineArgs(cls, parser): | 22 def AddCommandlineArgs(cls, parser): |
| 21 parser.add_option('--webgl-conformance-version', | 23 parser.add_option('--webgl-conformance-version', |
| 22 help='Version of the WebGL conformance tests to run.', | 24 help='Version of the WebGL conformance tests to run.', |
| 23 default='1.0.4') | 25 default='1.0.4') |
| 24 parser.add_option('--webgl2-only', | 26 parser.add_option('--webgl2-only', |
| (...skipping 12 matching lines...) Expand all Loading... |
| 37 for test_path in test_paths: | 39 for test_path in test_paths: |
| 38 # generated test name cannot contain '.' | 40 # generated test name cannot contain '.' |
| 39 name = webgl_conformance.GenerateTestNameFromTestPath(test_path).replace( | 41 name = webgl_conformance.GenerateTestNameFromTestPath(test_path).replace( |
| 40 '.', '_') | 42 '.', '_') |
| 41 yield (name, test_path, ()) | 43 yield (name, test_path, ()) |
| 42 | 44 |
| 43 def RunActualGpuTest(self, test_path, *args): | 45 def RunActualGpuTest(self, test_path, *args): |
| 44 url = self.UrlOfStaticFilePath(test_path) | 46 url = self.UrlOfStaticFilePath(test_path) |
| 45 harness_script = webgl_conformance.conformance_harness_script | 47 harness_script = webgl_conformance.conformance_harness_script |
| 46 self.tab.Navigate(url, script_to_evaluate_on_commit=harness_script) | 48 self.tab.Navigate(url, script_to_evaluate_on_commit=harness_script) |
| 49 if self.__class__._first_time: |
| 50 self.__class__._first_time = False |
| 51 # Try also replacing this with chrome://crash |
| 52 self.tab.Navigate('chrome://gpucrash', timeout=5) |
| 47 self.tab.action_runner.WaitForJavaScriptCondition( | 53 self.tab.action_runner.WaitForJavaScriptCondition( |
| 48 'webglTestHarness._finished', timeout_in_seconds=300) | 54 'webglTestHarness._finished', timeout_in_seconds=10) |
| 49 if not webgl_conformance._DidWebGLTestSucceed(self.tab): | 55 if not webgl_conformance._DidWebGLTestSucceed(self.tab): |
| 50 self.fail(webgl_conformance._WebGLTestMessages(self.tab)) | 56 self.fail(webgl_conformance._WebGLTestMessages(self.tab)) |
| 51 | 57 |
| 52 @classmethod | 58 @classmethod |
| 53 def CustomizeOptions(cls): | 59 def CustomizeOptions(cls): |
| 54 assert cls._webgl_version == 1 or cls._webgl_version == 2 | 60 assert cls._webgl_version == 1 or cls._webgl_version == 2 |
| 55 validator = None | 61 validator = None |
| 56 if cls._webgl_version == 1: | 62 if cls._webgl_version == 1: |
| 57 validator = webgl_conformance.WebglConformanceValidator() | 63 validator = webgl_conformance.WebglConformanceValidator() |
| 58 else: | 64 else: |
| (...skipping 10 matching lines...) Expand all Loading... |
| 69 return webgl2_conformance_expectations.WebGL2ConformanceExpectations( | 75 return webgl2_conformance_expectations.WebGL2ConformanceExpectations( |
| 70 webgl_conformance.conformance_path) | 76 webgl_conformance.conformance_path) |
| 71 | 77 |
| 72 @classmethod | 78 @classmethod |
| 73 def setUpClass(cls): | 79 def setUpClass(cls): |
| 74 super(cls, WebGLConformanceIntegrationTest).setUpClass() | 80 super(cls, WebGLConformanceIntegrationTest).setUpClass() |
| 75 cls.CustomizeOptions() | 81 cls.CustomizeOptions() |
| 76 cls.SetBrowserOptions(cls._finder_options) | 82 cls.SetBrowserOptions(cls._finder_options) |
| 77 cls.StartBrowser() | 83 cls.StartBrowser() |
| 78 cls.SetStaticServerDir(webgl_conformance.conformance_path) | 84 cls.SetStaticServerDir(webgl_conformance.conformance_path) |
| OLD | NEW |