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 Context Resize Bug 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>
19 <canvas id=
"test"></canvas>
22 description("This test verifies canvas resize does not affect PIXEL_UNPACK_BUFFER binding.");
24 var wtu
= WebGLTestUtils
;
25 var canvas
= document
.getElementById("test");
26 var gl
= wtu
.create3DContext(canvas
, null, 2);
28 testFailed("context does not exist");
30 testPassed("context exists");
31 var texture1
= gl
.createTexture();
32 gl
.bindTexture(gl
.TEXTURE_3D
, texture1
);
33 var buffer0
= gl
.createBuffer();
34 gl
.bindBuffer(gl
.PIXEL_UNPACK_BUFFER
, buffer0
);
37 // Resizing canvas incorrectly cleared the PIXEL_UNPACK_BUFFER binding to 0
38 // and caused a crash from the following line in Chrome. crbug.com/673929.
39 gl
.texImage3D(gl
.TEXTURE_3D
, 1, gl
.R8
, 225,664 , 143, 0,
40 gl
.LUMINANCE_ALPHA
, gl
.UNSIGNED_SHORT_4_4_4_4
, 0x41414141);
41 testPassed("no crash from texImage3D");
44 var successfullyParsed
= true;
46 <script src=
"../../js/js-test-post.js"></script>