| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 import json | 4 import json |
| 5 import optparse | 5 import optparse |
| 6 import os | 6 import os |
| 7 import sys | 7 import sys |
| 8 | 8 |
| 9 import webgl_conformance_expectations | 9 import webgl_conformance_expectations |
| 10 | 10 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 }; | 61 }; |
| 62 """ | 62 """ |
| 63 | 63 |
| 64 def _DidWebGLTestSucceed(tab): | 64 def _DidWebGLTestSucceed(tab): |
| 65 return tab.EvaluateJavaScript('webglTestHarness._allTestSucceeded') | 65 return tab.EvaluateJavaScript('webglTestHarness._allTestSucceeded') |
| 66 | 66 |
| 67 def _WebGLTestMessages(tab): | 67 def _WebGLTestMessages(tab): |
| 68 return tab.EvaluateJavaScript('webglTestHarness._messages') | 68 return tab.EvaluateJavaScript('webglTestHarness._messages') |
| 69 | 69 |
| 70 class WebglConformanceValidator(page_test.PageTest): | 70 class WebglConformanceValidator(page_test.PageTest): |
| 71 options = {'output_format': 'gtest'} |
| 72 |
| 71 def __init__(self): | 73 def __init__(self): |
| 72 super(WebglConformanceValidator, self).__init__(attempts=1, max_failures=10) | 74 super(WebglConformanceValidator, self).__init__(attempts=1, max_failures=10) |
| 73 | 75 |
| 74 def ValidatePage(self, page, tab, results): | 76 def ValidatePage(self, page, tab, results): |
| 75 if not _DidWebGLTestSucceed(tab): | 77 if not _DidWebGLTestSucceed(tab): |
| 76 raise page_test.Failure(_WebGLTestMessages(tab)) | 78 raise page_test.Failure(_WebGLTestMessages(tab)) |
| 77 | 79 |
| 78 def CustomizeBrowserOptions(self, options): | 80 def CustomizeBrowserOptions(self, options): |
| 79 options.AppendExtraBrowserArgs([ | 81 options.AppendExtraBrowserArgs([ |
| 80 '--disable-gesture-requirement-for-media-playback', | 82 '--disable-gesture-requirement-for-media-playback', |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 | 165 |
| 164 if '.txt' in test_name: | 166 if '.txt' in test_name: |
| 165 include_path = os.path.join(current_dir, test_name) | 167 include_path = os.path.join(current_dir, test_name) |
| 166 test_paths += WebglConformance._ParseTests( | 168 test_paths += WebglConformance._ParseTests( |
| 167 include_path, version) | 169 include_path, version) |
| 168 else: | 170 else: |
| 169 test = os.path.join(current_dir, test_name) | 171 test = os.path.join(current_dir, test_name) |
| 170 test_paths.append(test) | 172 test_paths.append(test) |
| 171 | 173 |
| 172 return test_paths | 174 return test_paths |
| OLD | NEW |