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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 def __init__(self): | 71 def __init__(self): |
72 super(WebglConformanceValidator, self).__init__(attempts=1, max_failures=10) | 72 super(WebglConformanceValidator, self).__init__(attempts=1, max_failures=10) |
73 | 73 |
74 def ValidatePage(self, page, tab, results): | 74 def ValidateAndMeasurePage(self, page, tab, results): |
75 if not _DidWebGLTestSucceed(tab): | 75 if not _DidWebGLTestSucceed(tab): |
76 raise page_test.Failure(_WebGLTestMessages(tab)) | 76 raise page_test.Failure(_WebGLTestMessages(tab)) |
77 | 77 |
78 def CustomizeBrowserOptions(self, options): | 78 def CustomizeBrowserOptions(self, options): |
79 options.AppendExtraBrowserArgs([ | 79 options.AppendExtraBrowserArgs([ |
80 '--disable-gesture-requirement-for-media-playback', | 80 '--disable-gesture-requirement-for-media-playback', |
81 '--disable-domain-blocking-for-3d-apis', | 81 '--disable-domain-blocking-for-3d-apis', |
82 '--disable-gpu-process-crash-limit' | 82 '--disable-gpu-process-crash-limit' |
83 ]) | 83 ]) |
84 | 84 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 | 163 |
164 if '.txt' in test_name: | 164 if '.txt' in test_name: |
165 include_path = os.path.join(current_dir, test_name) | 165 include_path = os.path.join(current_dir, test_name) |
166 test_paths += WebglConformance._ParseTests( | 166 test_paths += WebglConformance._ParseTests( |
167 include_path, version) | 167 include_path, version) |
168 else: | 168 else: |
169 test = os.path.join(current_dir, test_name) | 169 test = os.path.join(current_dir, test_name) |
170 test_paths.append(test) | 170 test_paths.append(test) |
171 | 171 |
172 return test_paths | 172 return test_paths |
OLD | NEW |