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>Regression test for compressedTex with PBO
</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 <canvas id=
"example" width=
"24" height=
"24"></canvas>
18 <div id=
"description"></div>
19 <div id=
"console"></div>
23 var wtu
= WebGLTestUtils
;
26 var gl
= wtu
.create3DContext("example", undefined, 2);
28 var tex
= gl
.createTexture();
29 gl
.bindTexture(gl
.TEXTURE_2D
, tex
);
31 // The following statement caused a crash in Chrome. See crbug.com/690335.
32 // Because no PBO is bound, the last parameter is interprected as a pointer
33 // to the client side data.
34 gl
.compressedTexImage2D(gl
.TEXTURE_2D
, 0, 0, 4, 4, 0, 8, 3);
36 wtu
.glErrorShouldBe(gl
, [gl
.INVALID_ENUM
, gl
.INVALID_VALUE
, gl
.INVALID_OPERATION
],
37 "should not crash and generate a GL error");
39 var successfullyParsed
= true;
41 <script src=
"../../../js/js-test-post.js"></script>