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>WebGL gl.getParameter initial values Tests
</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=
"canvas" width=
"2" height=
"2"> </canvas>
22 description("This test checks the initial value of the OpenGL state");
25 debug("Canvas.getContext");
27 var wtu
= WebGLTestUtils
;
28 var gl
= wtu
.create3DContext("canvas");
30 testFailed("context does not exist");
32 testPassed("context exists");
35 checkParameterInitialValue("ONE", "BLEND_SRC_RGB");
36 checkParameterInitialValue("ONE", "BLEND_SRC_ALPHA");
37 checkParameterInitialValue("ZERO", "BLEND_DST_RGB");
38 checkParameterInitialValue("ZERO", "BLEND_DST_ALPHA");
39 shouldBe("gl.getError()", "gl.NO_ERROR");
42 function checkParameterInitialValue(expected
, enum_val
) {
43 var s
= gl
.getParameter(gl
[enum_val
]);
44 if (s
=== gl
[expected
]) {
45 testPassed("getParameter(gl." + enum_val
+ ") returned " + expected
+ " which is " + gl
[expected
]);
47 testFailed("getParameter(gl." + enum_val
+ ") returned " + s
+ " expected: " + expected
+ " which is " + gl
[expected
]);
52 var successfullyParsed
= true;
55 <script src=
"../../js/js-test-post.js"></script>