| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <script> |
| 4 function checkExtension(name, context_type) { |
| 5 var canvas = document.createElement("canvas"); |
| 6 document.body.appendChild(canvas); |
| 7 |
| 8 var gl_context = canvas.getContext(context_type || "webgl"); |
| 9 |
| 10 // If we don't have a GL context, give up now |
| 11 if (!gl_context) { |
| 12 webglTestHarness.reportResults(name, false, "Unable to initialize " + co
ntext_type + " context."); |
| 13 } else { |
| 14 var gl_extension = gl_context.getExtension(name); |
| 15 if (gl_extension) { |
| 16 webglTestHarness.reportResults(name, true, name + " was available"); |
| 17 } else { |
| 18 webglTestHarness.reportResults(name, false, name + " was not available
"); |
| 19 } |
| 20 } |
| 21 |
| 22 webglTestHarness.notifyFinished(name); |
| 23 } |
| 24 |
| 25 function checkSupportedExtensions(expected_extensions, context_type) { |
| 26 var canvas = document.createElement("canvas"); |
| 27 document.body.appendChild(canvas); |
| 28 |
| 29 var gl_context = canvas.getContext(context_type || "webgl"); |
| 30 |
| 31 // If we don't have a GL context, give up now |
| 32 if (!gl_context) { |
| 33 webglTestHarness.reportResults(name, false, "Unable to initialize " + co
ntext_type + " context."); |
| 34 } else { |
| 35 var missing_list = []; |
| 36 var extension_list = gl_context.getSupportedExtensions(); |
| 37 for (var i in extension_list) { |
| 38 var extension = extension_list[i]; |
| 39 if (extension.indexOf("WEBKIT_") == 0) |
| 40 continue; // Skip WEBKIT_ prefixed extensions since they all have un
prefixed variants at this point. |
| 41 var expected_index = expected_extensions.indexOf(extension); |
| 42 if (expected_index == -1) { |
| 43 missing_list.push(extension); |
| 44 } |
| 45 } |
| 46 |
| 47 if (missing_list.length == 0) { |
| 48 webglTestHarness.reportResults(name, true, "All " + context_type + " e
xtensions are being tested."); |
| 49 } else { |
| 50 var error_string = "The following " + context_type + " extensions are
not being tested and should be added to GetExtensionList() in content/test/gpu/g
pu_tests/webgl_conformance.py:"; |
| 51 for (var i in missing_list) { |
| 52 error_string += "\n\t" + missing_list[i]; |
| 53 } |
| 54 webglTestHarness.reportResults(name, false, error_string); |
| 55 } |
| 56 } |
| 57 |
| 58 webglTestHarness.notifyFinished(name); |
| 59 } |
| 60 </script> |
| 61 <body></body> |
| 62 </html> |
| OLD | NEW |