зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1233046
- Add ensure-extension tests. - r=jrmuizel
This commit is contained in:
Родитель
f14fb612c2
Коммит
6b27b1d9fc
|
@ -3,10 +3,51 @@ subsuite = webgl
|
|||
skip-if = ((os == 'linux') && (buildapp == 'b2g'))
|
||||
|
||||
support-files =
|
||||
webgl-mochitest/ensure-exts/ensure-ext.js
|
||||
webgl-mochitest/driver-info.js
|
||||
webgl-mochitest/es3-data.js
|
||||
webgl-mochitest/webgl-util.js
|
||||
|
||||
[webgl-mochitest/ensure-exts/test_ANGLE_instanced_arrays.html]
|
||||
fail-if = (os == 'android') || (os == 'mac')
|
||||
[webgl-mochitest/ensure-exts/test_EXT_blend_minmax.html]
|
||||
fail-if = (os == 'android')
|
||||
[webgl-mochitest/ensure-exts/test_EXT_color_buffer_half_float.html]
|
||||
fail-if = (os == 'android')
|
||||
[webgl-mochitest/ensure-exts/test_EXT_disjoint_timer_query.html]
|
||||
fail-if = (os == 'android') || (os == 'linux') || (os == 'mac') || (os == 'win')
|
||||
[webgl-mochitest/ensure-exts/test_EXT_frag_depth.html]
|
||||
fail-if = (os == 'android')
|
||||
[webgl-mochitest/ensure-exts/test_EXT_sRGB.html]
|
||||
fail-if = (os == 'android') || (os == 'linux') || (os == 'mac') || (os == 'win')
|
||||
[webgl-mochitest/ensure-exts/test_EXT_shader_texture_lod.html]
|
||||
fail-if = (os == 'android') || (os == 'linux') || (os == 'mac')
|
||||
[webgl-mochitest/ensure-exts/test_EXT_texture_filter_anisotropic.html]
|
||||
fail-if = (os == 'android') || (os == 'linux')
|
||||
[webgl-mochitest/ensure-exts/test_OES_standard_derivatives.html]
|
||||
fail-if = (os == 'android')
|
||||
[webgl-mochitest/ensure-exts/test_WEBGL_color_buffer_float.html]
|
||||
fail-if = (os == 'android')
|
||||
[webgl-mochitest/ensure-exts/test_WEBGL_compressed_texture_atc.html]
|
||||
fail-if = (os == 'android') || (os == 'linux') || (os == 'mac') || (os == 'win')
|
||||
[webgl-mochitest/ensure-exts/test_WEBGL_compressed_texture_es3.html]
|
||||
fail-if = (os == 'android') || (os == 'linux') || (os == 'mac') || (os == 'win')
|
||||
[webgl-mochitest/ensure-exts/test_WEBGL_compressed_texture_etc1.html]
|
||||
# Win7 is 6.1
|
||||
fail-if = (os == 'linux') || (os == 'mac') || (os == 'win' && os_version == '6.1')
|
||||
[webgl-mochitest/ensure-exts/test_WEBGL_compressed_texture_pvrtc.html]
|
||||
fail-if = (os == 'android') || (os == 'linux') || (os == 'mac') || (os == 'win')
|
||||
[webgl-mochitest/ensure-exts/test_WEBGL_compressed_texture_s3tc.html]
|
||||
fail-if = (os == 'android') || (os == 'linux')
|
||||
[webgl-mochitest/ensure-exts/test_WEBGL_depth_texture.html]
|
||||
fail-if = (os == 'mac')
|
||||
[webgl-mochitest/ensure-exts/test_WEBGL_draw_buffers.html]
|
||||
# Win7 is 6.1
|
||||
fail-if = (os == 'android') || (os == 'win' && os_version == '6.1')
|
||||
|
||||
[webgl-mochitest/ensure-exts/test_common.html]
|
||||
|
||||
|
||||
[webgl-mochitest/test_backbuffer_channels.html]
|
||||
fail-if = (os == 'b2g')
|
||||
[webgl-mochitest/test_depth_readpixels.html]
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
'use strict';
|
||||
|
||||
function EnsureExt(name, shouldBe = true) {
|
||||
var c = document.createElement('canvas');
|
||||
var gl = c.getContext('experimental-webgl');
|
||||
|
||||
if (shouldBe) {
|
||||
ok(gl.getExtension(name), 'Should have extension ' + name + '.');
|
||||
} else {
|
||||
ok(!gl.getExtension(name), 'Should not have extension ' + name + '.');
|
||||
}
|
||||
}
|
||||
|
||||
function EnsureDraftExt(name, shouldBe = true) {
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
var fnEnsure = function() {
|
||||
EnsureExt(name, shouldBe);
|
||||
SimpleTest.finish();
|
||||
};
|
||||
|
||||
if ('SpecialPowers' in window) {
|
||||
var prefStateList = [
|
||||
['webgl.enable-draft-extensions', true],
|
||||
];
|
||||
var prefEnv = {'set': prefStateList};
|
||||
SpecialPowers.pushPrefEnv(prefEnv, fnEnsure);
|
||||
} else {
|
||||
console.log('Couldn\'t use SpecialPowers to enable draft extensions.');
|
||||
fnEnsure();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset='utf-8'/>
|
||||
<script src='/tests/SimpleTest/SimpleTest.js'></script>
|
||||
<link rel='stylesheet' href='/tests/SimpleTest/test.css'>
|
||||
<script src='ensure-ext.js'></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
|
||||
'use strict';
|
||||
EnsureExt('ANGLE_instanced_arrays');
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset='utf-8'/>
|
||||
<script src='/tests/SimpleTest/SimpleTest.js'></script>
|
||||
<link rel='stylesheet' href='/tests/SimpleTest/test.css'>
|
||||
<script src='ensure-ext.js'></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
|
||||
'use strict';
|
||||
EnsureExt('EXT_blend_minmax');
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset='utf-8'/>
|
||||
<script src='/tests/SimpleTest/SimpleTest.js'></script>
|
||||
<link rel='stylesheet' href='/tests/SimpleTest/test.css'>
|
||||
<script src='ensure-ext.js'></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
|
||||
'use strict';
|
||||
EnsureExt('EXT_color_buffer_half_float');
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset='utf-8'/>
|
||||
<script src='/tests/SimpleTest/SimpleTest.js'></script>
|
||||
<link rel='stylesheet' href='/tests/SimpleTest/test.css'>
|
||||
<script src='ensure-ext.js'></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
|
||||
'use strict';
|
||||
EnsureDraftExt('EXT_disjoint_timer_query');
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset='utf-8'/>
|
||||
<script src='/tests/SimpleTest/SimpleTest.js'></script>
|
||||
<link rel='stylesheet' href='/tests/SimpleTest/test.css'>
|
||||
<script src='ensure-ext.js'></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
|
||||
'use strict';
|
||||
EnsureExt('EXT_frag_depth');
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset='utf-8'/>
|
||||
<script src='/tests/SimpleTest/SimpleTest.js'></script>
|
||||
<link rel='stylesheet' href='/tests/SimpleTest/test.css'>
|
||||
<script src='ensure-ext.js'></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
|
||||
'use strict';
|
||||
EnsureExt('EXT_sRGB');
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset='utf-8'/>
|
||||
<script src='/tests/SimpleTest/SimpleTest.js'></script>
|
||||
<link rel='stylesheet' href='/tests/SimpleTest/test.css'>
|
||||
<script src='ensure-ext.js'></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
|
||||
'use strict';
|
||||
EnsureExt('EXT_shader_texture_lod');
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset='utf-8'/>
|
||||
<script src='/tests/SimpleTest/SimpleTest.js'></script>
|
||||
<link rel='stylesheet' href='/tests/SimpleTest/test.css'>
|
||||
<script src='ensure-ext.js'></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
|
||||
'use strict';
|
||||
EnsureExt('EXT_texture_filter_anisotropic');
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset='utf-8'/>
|
||||
<script src='/tests/SimpleTest/SimpleTest.js'></script>
|
||||
<link rel='stylesheet' href='/tests/SimpleTest/test.css'>
|
||||
<script src='ensure-ext.js'></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
|
||||
'use strict';
|
||||
EnsureExt('OES_standard_derivatives');
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset='utf-8'/>
|
||||
<script src='/tests/SimpleTest/SimpleTest.js'></script>
|
||||
<link rel='stylesheet' href='/tests/SimpleTest/test.css'>
|
||||
<script src='ensure-ext.js'></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
|
||||
'use strict';
|
||||
EnsureExt('WEBGL_color_buffer_float');
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset='utf-8'/>
|
||||
<script src='/tests/SimpleTest/SimpleTest.js'></script>
|
||||
<link rel='stylesheet' href='/tests/SimpleTest/test.css'>
|
||||
<script src='ensure-ext.js'></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
|
||||
'use strict';
|
||||
EnsureExt('WEBGL_compressed_texture_atc');
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset='utf-8'/>
|
||||
<script src='/tests/SimpleTest/SimpleTest.js'></script>
|
||||
<link rel='stylesheet' href='/tests/SimpleTest/test.css'>
|
||||
<script src='ensure-ext.js'></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
|
||||
'use strict';
|
||||
EnsureDraftExt('WEBGL_compressed_texture_es3');
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset='utf-8'/>
|
||||
<script src='/tests/SimpleTest/SimpleTest.js'></script>
|
||||
<link rel='stylesheet' href='/tests/SimpleTest/test.css'>
|
||||
<script src='ensure-ext.js'></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
|
||||
'use strict';
|
||||
EnsureExt('WEBGL_compressed_texture_etc1');
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset='utf-8'/>
|
||||
<script src='/tests/SimpleTest/SimpleTest.js'></script>
|
||||
<link rel='stylesheet' href='/tests/SimpleTest/test.css'>
|
||||
<script src='ensure-ext.js'></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
|
||||
'use strict';
|
||||
EnsureExt('WEBGL_compressed_texture_pvrtc');
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset='utf-8'/>
|
||||
<script src='/tests/SimpleTest/SimpleTest.js'></script>
|
||||
<link rel='stylesheet' href='/tests/SimpleTest/test.css'>
|
||||
<script src='ensure-ext.js'></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
|
||||
'use strict';
|
||||
EnsureExt('WEBGL_compressed_texture_s3tc');
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset='utf-8'/>
|
||||
<script src='/tests/SimpleTest/SimpleTest.js'></script>
|
||||
<link rel='stylesheet' href='/tests/SimpleTest/test.css'>
|
||||
<script src='ensure-ext.js'></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
|
||||
'use strict';
|
||||
EnsureExt('WEBGL_depth_texture');
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset='utf-8'/>
|
||||
<script src='/tests/SimpleTest/SimpleTest.js'></script>
|
||||
<link rel='stylesheet' href='/tests/SimpleTest/test.css'>
|
||||
<script src='ensure-ext.js'></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
|
||||
'use strict';
|
||||
EnsureExt('WEBGL_draw_buffers');
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,75 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset='utf-8'/>
|
||||
<script src='/tests/SimpleTest/SimpleTest.js'></script>
|
||||
<link rel='stylesheet' href='/tests/SimpleTest/test.css'>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
|
||||
'use strict';
|
||||
|
||||
var c = document.createElement('canvas');
|
||||
var gl = c.getContext('experimental-webgl');
|
||||
|
||||
function ensureExt(name) {
|
||||
ok(gl.getExtension(name), 'Should have extension ' + name + '.');
|
||||
}
|
||||
|
||||
function ensureNoExt(name) {
|
||||
ok(!gl.getExtension(name), 'Should not have extension ' + name + '.');
|
||||
}
|
||||
|
||||
do {
|
||||
if (!gl)
|
||||
break;
|
||||
|
||||
// These aren't all guaranteed, but they're common to all our test slaves.
|
||||
// If you're adding a slave config that is missing one of these, comment the line out
|
||||
// and split it into its own test.
|
||||
|
||||
// Implemented. (commented out if not test-slave-universal)
|
||||
//ensureExt('ANGLE_instanced_arrays');
|
||||
//ensureExt('EXT_blend_minmax');
|
||||
//ensureExt('EXT_color_buffer_half_float');
|
||||
//ensureExt('EXT_frag_depth');
|
||||
//ensureExt('EXT_shader_texture_lod');
|
||||
//ensureExt('EXT_sRGB');
|
||||
//ensureExt('EXT_texture_filter_anisotropic');
|
||||
ensureExt('OES_element_index_uint');
|
||||
//ensureExt('OES_standard_derivatives');
|
||||
ensureExt('OES_texture_float');
|
||||
ensureExt('OES_texture_float_linear');
|
||||
ensureExt('OES_texture_half_float');
|
||||
ensureExt('OES_texture_half_float_linear');
|
||||
ensureExt('OES_vertex_array_object');
|
||||
//ensureExt('WEBGL_color_buffer_float');
|
||||
//ensureExt('WEBGL_compressed_texture_atc');
|
||||
//ensureExt('WEBGL_compressed_texture_es3');
|
||||
//ensureExt('WEBGL_compressed_texture_etc1');
|
||||
//ensureExt('WEBGL_compressed_texture_pvrtc');
|
||||
//ensureExt('WEBGL_compressed_texture_s3tc');
|
||||
//ensureExt('WEBGL_depth_texture');
|
||||
//ensureExt('WEBGL_draw_buffers');
|
||||
ensureExt('WEBGL_lose_context');
|
||||
|
||||
// Draft extensions, which should not be exposed by default.
|
||||
ensureNoExt('EXT_disjoint_timer_query');
|
||||
ensureNoExt('WEBGL_compressed_texture_es3');
|
||||
|
||||
// Not implemented.
|
||||
ensureNoExt('EXT_color_buffer_float');
|
||||
ensureNoExt('OES_fbo_render_mipmap');
|
||||
ensureNoExt('WEBGL_compressed_texture_astc');
|
||||
ensureNoExt('WEBGL_security_sensitive_resources');
|
||||
ensureNoExt('WEBGL_shared_resources');
|
||||
|
||||
// Privileged
|
||||
//ensureExt('WEBGL_debug_renderer_info');
|
||||
//ensureExt('WEBGL_debug_shaders');
|
||||
} while (false);
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Загрузка…
Ссылка в новой задаче