2 <title>WebGL test: bug
958723</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>
7 <canvas id=
"c"></canvas>
10 // Give ourselves a scope to return early from:
12 var gl
= c
.getContext('webgl');
14 todo(false, 'WebGL is unavailable.');
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
);
27 if (!gl
.getExtension('WEBGL_draw_buffers')) {
28 todo(false, 'Not having this extension is fine.');
31 checkGLError(ok
, 'before bad param query', 0);
33 var result
= gl
.getFramebufferAttachmentParameter(gl
.FRAMEBUFFER
,
35 gl
.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME
);
37 checkGLError(ok
, 'after bad param query', gl
.INVALID_OPERATION
);