6 Copyright (c) 2019 The Khronos Group Inc.
7 Use of this source code is governed by an MIT-style license that can be
8 found in the LICENSE.txt file.
10 <link rel=
"stylesheet" type=
"text/css" href=
"../unit.css" />
11 <script type=
"application/javascript" src=
"../unit.js"></script>
12 <script type=
"application/javascript" src=
"../util.js"></script>
13 <script type=
"application/javascript">
15 Tests.startUnit = function () {
16 var canvas = document.getElementById('gl');
17 var gl = wrapGLContext(getGLContext(canvas));
21 Tests.testBindBufferARRAY_BUFFER = function(gl) {
22 var b = gl.createBuffer();
23 assert(gl.NO_ERROR == checkError(gl,
"genBuffers"));
24 gl.bindBuffer(gl.ARRAY_BUFFER, b);
25 assert(gl.NO_ERROR == checkError(gl,
"bindBuffer"));
26 gl.bindBuffer(gl.ARRAY_BUFFER, null);
27 assert(gl.NO_ERROR == checkError(gl,
"bindBuffer 0"));
29 assert(gl.NO_ERROR == checkError(gl,
"deleteBuffers"));
32 Tests.testBindBufferELEMENT_ARRAY_BUFFER = function(gl) {
33 var b = gl.createBuffer();
34 assert(gl.NO_ERROR == checkError(gl,
"genBuffers"));
35 gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, b);
36 assert(gl.NO_ERROR == checkError(gl,
"bindBuffer"));
37 gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);
38 assert(gl.NO_ERROR == checkError(gl,
"bindBuffer 0"));
40 assert(gl.NO_ERROR == checkError(gl,
"deleteBuffers"));
45 <style>canvas{ position:absolute; }
</style>
47 <canvas id=
"gl" width=
"1" height=
"1"></canvas>