Bug 1915045 Ensure decode tasks are scheduled on BufferingState::Enter() r=media...
[gecko.git] / dom / canvas / test / webgl-mochitest / test_fb_param.html
blob80d76a6137543c495b93d3b85634a1e698a2889a
1 <!DOCTYPE HTML>
2 <title>WebGL test: bug 958491</title>
3 <script src="/tests/SimpleTest/SimpleTest.js"></script>
4 <link rel="stylesheet" href="/tests/SimpleTest/test.css">
5 <script src="driver-info.js"></script>
6 <body>
7 <canvas id="c"></canvas>
8 <script>
10 // Give ourselves a scope to return early from:
11 (function() {
12 var gl = c.getContext('webgl');
13 if (!gl) {
14 todo(false, 'WebGL is unavailable.');
15 return;
18 function checkGLError(func, info, reference) {
19 var error = gl.getError();
20 var prefix = info ? ('[' + info + '] ') : '';
21 var text = 'gl.getError should be 0x' + reference.toString(16) +
22 ', was 0x' + error.toString(16) + '.';
23 func(error == reference, prefix + text);
26 // Begin test:
27 var rb = gl.createRenderbuffer();
28 gl.bindRenderbuffer(gl.RENDERBUFFER, rb);
29 gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, 4, 4);
31 var fb = gl.createFramebuffer();
32 gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
33 gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0,
34 gl.RENDERBUFFER, rb);
36 checkGLError(ok, 'before bad param query', 0);
38 var GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 0x8210;
39 var result = gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER,
40 gl.COLOR_ATTACHMENT0,
41 GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING);
43 checkGLError(ok, 'after bad param query', gl.INVALID_ENUM);
44 })();
46 </script>