Backed out changeset 7272b7396c78 (bug 1932758) for causing fenix debug failures...
[gecko.git] / dom / canvas / test / webgl-conf / checkout / conformance / buffers / buffer-data-array-buffer-delete.html
blob4a25426f0c44ab473e023e3ed6b668c0513bbecd
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 <link rel="stylesheet" href="../../resources/js-test-style.css"/>
12 <script src="../../js/js-test-pre.js"></script>
13 <script src="../../js/webgl-test-utils.js"></script>
14 </head>
15 <body>
16 <div id="description"></div>
17 <div id="console"></div>
19 <script>
20 "use strict";
21 description("Test ARRAY_BUFFER deletion when a vertex attrib array with location != 0 is pointing to it and preserveDrawingBuffer is true.");
23 var canvas = document.createElement('canvas');
24 document.body.appendChild(canvas);
26 canvas.addEventListener(
27 "webglcontextlost",
28 function(event) {
29 testFailed("Context lost");
30 event.preventDefault();
32 false);
34 var wtu = WebGLTestUtils;
35 var gl = wtu.create3DContext(canvas, {preserveDrawingBuffer: true});
37 if (!gl) {
38 testFailed("context does not exist");
39 finishTest();
40 } else {
41 var array = new Float32Array([0]);
42 var buf = gl.createBuffer();
43 gl.bindBuffer(gl.ARRAY_BUFFER, buf);
44 gl.bufferData(gl.ARRAY_BUFFER, array, gl.STATIC_DRAW);
45 wtu.glErrorShouldBe(gl, gl.NO_ERROR);
47 var attribLocation = 1;
48 gl.enableVertexAttribArray(attribLocation);
49 gl.vertexAttribPointer(attribLocation, 1, gl.FLOAT, false, 0, 0);
51 gl.deleteBuffer(buf);
53 setTimeout(function() {
54 // Wait for possible context loss
55 finishTest();
56 }, 2000);
59 var successfullyParsed = true;
60 </script>
62 </body>
63 </html>