Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | <!DOCTYPE HTML> |
michael@0 | 2 | <title>WebGL test: bug 958723</title> |
michael@0 | 3 | <script src="/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 4 | <link rel="stylesheet" href="/tests/SimpleTest/test.css"> |
michael@0 | 5 | <script src="driver-info.js"></script> |
michael@0 | 6 | <script src="webgl-util.js"></script> |
michael@0 | 7 | <body> |
michael@0 | 8 | <canvas id="c"></canvas> |
michael@0 | 9 | <script> |
michael@0 | 10 | |
michael@0 | 11 | // Give ourselves a scope to return early from: |
michael@0 | 12 | (function() { |
michael@0 | 13 | var gl = WebGLUtil.getWebGL('c'); |
michael@0 | 14 | if (!gl) { |
michael@0 | 15 | todo(false, 'WebGL is unavailable.'); |
michael@0 | 16 | return; |
michael@0 | 17 | } |
michael@0 | 18 | |
michael@0 | 19 | // Catch actual WebGLUtil errors, not GL errors. |
michael@0 | 20 | function errorFunc(str) { |
michael@0 | 21 | ok(false, 'Error: ' + str); |
michael@0 | 22 | } |
michael@0 | 23 | WebGLUtil.setErrorFunc(errorFunc); |
michael@0 | 24 | |
michael@0 | 25 | function checkGLError(func, info, reference) { |
michael@0 | 26 | var error = gl.getError(); |
michael@0 | 27 | var prefix = info ? ('[' + info + '] ') : ''; |
michael@0 | 28 | var text = 'gl.getError should be 0x' + reference.toString(16) + |
michael@0 | 29 | ', was 0x' + error.toString(16) + '.'; |
michael@0 | 30 | func(error == reference, prefix + text); |
michael@0 | 31 | } |
michael@0 | 32 | |
michael@0 | 33 | // Begin test: |
michael@0 | 34 | if (!gl.getExtension('WEBGL_draw_buffers')) { |
michael@0 | 35 | todo(false, 'Not having this extension is fine.'); |
michael@0 | 36 | return; |
michael@0 | 37 | } |
michael@0 | 38 | checkGLError(ok, 'before bad param query', 0); |
michael@0 | 39 | |
michael@0 | 40 | var result = gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, |
michael@0 | 41 | gl.COLOR_ATTACHMENT0, |
michael@0 | 42 | gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME); |
michael@0 | 43 | |
michael@0 | 44 | checkGLError(ok, 'after bad param query', gl.INVALID_OPERATION); |
michael@0 | 45 | })(); |
michael@0 | 46 | |
michael@0 | 47 | </script> |
michael@0 | 48 |