Backed out changeset 7272b7396c78 (bug 1932758) for causing fenix debug failures...
[gecko.git] / dom / canvas / test / webgl-conf / checkout / conformance2 / misc / getextension-while-pbo-bound-stability.html
blob73e34fdc1d8eb31d5912b1080057168b6cb23b4a
1 <!--
2 Copyright (c) 2019 The Khronos Group Inc.
3 Use of this source code is governed by an MIT-style license that can be
4 found in the LICENSE.txt file.
5 -->
7 <!DOCTYPE html>
8 <html>
9 <head>
10 <meta charset="utf-8">
11 <title>WebGL2 getExtension while PBO bound stability conformance test.</title>
12 <link rel="stylesheet" href="../../resources/js-test-style.css"/>
13 <script src="../../js/js-test-pre.js"></script>
14 <script src="../../js/webgl-test-utils.js"></script>
15 </head>
16 <body>
17 <div id="description"></div>
18 <div id="console"></div>
19 <script>
20 "use strict";
22 var wtu = WebGLTestUtils;
24 function runTest(extension_name) {
25 debug("");
26 debug("getExtension('" + extension_name + "') while PIXEL_UNPACK_BUFFER bound should be stable");
28 var gl = wtu.create3DContext(null, undefined, 2);
29 if (!gl) {
30 testFailed("Fail to get a WebGL context");
31 return;
34 var pbo = gl.createBuffer();
35 gl.bindBuffer(gl.PIXEL_UNPACK_BUFFER, pbo);
36 var ext = gl.getExtension('EXT_color_buffer_float');
37 var gl_texture_float_linear = gl.getExtension(extension_name);
38 wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Late-enable of extension should succeed");
39 if (pbo != gl.getParameter(gl.PIXEL_UNPACK_BUFFER_BINDING)) {
40 testFailed("Fail to maintain PIXEL_UNPACK_BUFFER binding when enabling extension " + extension_name);
44 function runTests() {
45 debug("This is a regression test for <a href='https://bugs.chromium.org/p/chromium/issues/detail?id=641643'>Chromium Issue 641642</a>");
46 runTest('EXT_color_buffer_float');
47 runTest('OES_texture_float_linear');
50 runTests();
52 debug("");
53 var successfullyParsed = true;
54 </script>
55 <script src="../../js/js-test-post.js"></script>
56 </body>
57 </html>