webgl: Add test for getSupportedExtensions

This commit is contained in:
Emilio Cobos Álvarez 2015-11-08 16:22:43 +01:00
parent b740b90b8d
commit 75ecb67e62
3 changed files with 29 additions and 3 deletions

View file

@ -5047,10 +5047,16 @@
"url": "/_mozilla/mozilla/variadic-interface.html"
}
],
"mozilla/webgl_context_creation_error.html": [
"mozilla/webgl/context_creation_error.html": [
{
"path": "mozilla/webgl_context_creation_error.html",
"url": "/_mozilla/mozilla/webgl_context_creation_error.html"
"path": "mozilla/webgl/context_creation_error.html",
"url": "/_mozilla/mozilla/webgl/context_creation_error.html"
}
],
"mozilla/webgl/get_supported_extensions.html": [
{
"path": "mozilla/webgl/get_supported_extensions.html",
"url": "/_mozilla/mozilla/webgl/get_supported_extensions.html"
}
],
"mozilla/websocket_connection_fail.html": [

View file

@ -0,0 +1,20 @@
<!doctype html>
<meta charset="utf-8">
<title>WebGLContextEvent getSupportedExtensions test</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(function() {
var gl = document.createElement("canvas").getContext("webgl");
if (!gl)
return;
var extensions = gl.getSupportedExtensions();
assert_true(Array.isArray(extensions), "getSupportedExtensions should return an array");
for (var i = 0; i < extensions.length; ++i)
assert_true(typeof(extensions[i]) === "string", "Extensions should be strings, got " + typeof(extensions[i]));
});
</script>