| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 """ | 59 """ |
| 60 | 60 |
| 61 def _DidWebGLTestSucceed(tab): | 61 def _DidWebGLTestSucceed(tab): |
| 62 return tab.EvaluateJavaScript('webglTestHarness._allTestSucceeded') | 62 return tab.EvaluateJavaScript('webglTestHarness._allTestSucceeded') |
| 63 | 63 |
| 64 def _WebGLTestMessages(tab): | 64 def _WebGLTestMessages(tab): |
| 65 return tab.EvaluateJavaScript('webglTestHarness._messages') | 65 return tab.EvaluateJavaScript('webglTestHarness._messages') |
| 66 | 66 |
| 67 class WebglConformanceValidator(page_test.PageTest): | 67 class WebglConformanceValidator(page_test.PageTest): |
| 68 def __init__(self): | 68 def __init__(self): |
| 69 super(WebglConformanceValidator, self).__init__(attempts=1, max_failures=10) | 69 super(WebglConformanceValidator, self).__init__(max_failures=10) |
| 70 | 70 |
| 71 def ValidateAndMeasurePage(self, page, tab, results): | 71 def ValidateAndMeasurePage(self, page, tab, results): |
| 72 if not _DidWebGLTestSucceed(tab): | 72 if not _DidWebGLTestSucceed(tab): |
| 73 raise page_test.Failure(_WebGLTestMessages(tab)) | 73 raise page_test.Failure(_WebGLTestMessages(tab)) |
| 74 | 74 |
| 75 def CustomizeBrowserOptions(self, options): | 75 def CustomizeBrowserOptions(self, options): |
| 76 options.AppendExtraBrowserArgs([ | 76 options.AppendExtraBrowserArgs([ |
| 77 '--disable-gesture-requirement-for-media-playback', | 77 '--disable-gesture-requirement-for-media-playback', |
| 78 '--disable-domain-blocking-for-3d-apis', | 78 '--disable-domain-blocking-for-3d-apis', |
| 79 '--disable-gpu-process-crash-limit' | 79 '--disable-gpu-process-crash-limit' |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 | 160 |
| 161 if '.txt' in test_name: | 161 if '.txt' in test_name: |
| 162 include_path = os.path.join(current_dir, test_name) | 162 include_path = os.path.join(current_dir, test_name) |
| 163 test_paths += WebglConformance._ParseTests( | 163 test_paths += WebglConformance._ParseTests( |
| 164 include_path, version) | 164 include_path, version) |
| 165 else: | 165 else: |
| 166 test = os.path.join(current_dir, test_name) | 166 test = os.path.join(current_dir, test_name) |
| 167 test_paths.append(test) | 167 test_paths.append(test) |
| 168 | 168 |
| 169 return test_paths | 169 return test_paths |
| OLD | NEW |