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.
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>
17 <div id=
"description"></div>
18 <div id=
"console"></div>
22 var wtu
= WebGLTestUtils
;
24 function runTest(extension_name
) {
26 debug("getExtension('" + extension_name
+ "') while PIXEL_UNPACK_BUFFER bound should be stable");
28 var gl
= wtu
.create3DContext(null, undefined, 2);
30 testFailed("Fail to get a WebGL context");
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
);
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');
53 var successfullyParsed
= true;
55 <script src=
"../../js/js-test-post.js"></script>