OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <meta charset="utf-8"> |
| 5 <!-- |
| 6 |
| 7 /* |
| 8 ** Copyright (c) 2012 The Khronos Group Inc. |
| 9 ** |
| 10 ** Permission is hereby granted, free of charge, to any person obtaining a |
| 11 ** copy of this software and/or associated documentation files (the |
| 12 ** "Materials"), to deal in the Materials without restriction, including |
| 13 ** without limitation the rights to use, copy, modify, merge, publish, |
| 14 ** distribute, sublicense, and/or sell copies of the Materials, and to |
| 15 ** permit persons to whom the Materials are furnished to do so, subject to |
| 16 ** the following conditions: |
| 17 ** |
| 18 ** The above copyright notice and this permission notice shall be included |
| 19 ** in all copies or substantial portions of the Materials. |
| 20 ** |
| 21 ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 22 ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 23 ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
| 24 ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
| 25 ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
| 26 ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
| 27 ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. |
| 28 */ |
| 29 |
| 30 --> |
| 31 <link rel="stylesheet" href="../../../resources/js-test-style.css"/> |
| 32 <script src="../../../resources/js-test-pre.js"></script> |
| 33 <script src="../../../conformance/resources/webgl-test-utils.js"></script> |
| 34 |
| 35 </head> |
| 36 <body> |
| 37 <div id="description"></div> |
| 38 <div id="console"></div> |
| 39 <canvas id="canvas_element" width="1" height="1"></canvas> |
| 40 <script type="application/x-javascript"> |
| 41 |
| 42 function runTest() |
| 43 { |
| 44 shouldThrow("gl.isBuffer(gl.createFramebuffer())"); |
| 45 shouldThrow("gl.isBuffer(gl.createProgram())"); |
| 46 shouldThrow("gl.isBuffer(gl.createRenderbuffer())"); |
| 47 shouldThrow("gl.isBuffer(gl.createShader(gl.VERTEX_SHADER))"); |
| 48 shouldThrow("gl.isBuffer(gl.createTexture())"); |
| 49 |
| 50 shouldThrow("gl.isFramebuffer(gl.createBuffer())"); |
| 51 shouldThrow("gl.isFramebuffer(gl.createProgram())"); |
| 52 shouldThrow("gl.isFramebuffer(gl.createRenderbuffer())"); |
| 53 shouldThrow("gl.isFramebuffer(gl.createShader(gl.VERTEX_SHADER))"); |
| 54 shouldThrow("gl.isFramebuffer(gl.createTexture())"); |
| 55 |
| 56 shouldThrow("gl.isProgram(gl.createBuffer())"); |
| 57 shouldThrow("gl.isProgram(gl.createFramebuffer())"); |
| 58 shouldThrow("gl.isProgram(gl.createRenderbuffer())"); |
| 59 shouldThrow("gl.isProgram(gl.createShader(gl.VERTEX_SHADER))"); |
| 60 shouldThrow("gl.isProgram(gl.createTexture())"); |
| 61 |
| 62 shouldThrow("gl.isRenderbuffer(gl.createBuffer())"); |
| 63 shouldThrow("gl.isRenderbuffer(gl.createFramebuffer())"); |
| 64 shouldThrow("gl.isRenderbuffer(gl.createProgram())"); |
| 65 shouldThrow("gl.isRenderbuffer(gl.createShader(gl.VERTEX_SHADER))"); |
| 66 shouldThrow("gl.isRenderbuffer(gl.createTexture())"); |
| 67 |
| 68 shouldThrow("gl.isShader(gl.createBuffer())"); |
| 69 shouldThrow("gl.isShader(gl.createFramebuffer())"); |
| 70 shouldThrow("gl.isShader(gl.createProgram())"); |
| 71 shouldThrow("gl.isShader(gl.createRenderbuffer())"); |
| 72 shouldThrow("gl.isShader(gl.createTexture())"); |
| 73 |
| 74 shouldThrow("gl.isTexture(gl.createBuffer())"); |
| 75 shouldThrow("gl.isTexture(gl.createFramebuffer())"); |
| 76 shouldThrow("gl.isTexture(gl.createProgram())"); |
| 77 shouldThrow("gl.isTexture(gl.createRenderbuffer())"); |
| 78 shouldThrow("gl.isTexture(gl.createShader(gl.VERTEX_SHADER))"); |
| 79 |
| 80 shouldBe("gl.isBuffer(null)", "false"); |
| 81 shouldBe("gl.isBuffer(undefined)", "false"); |
| 82 |
| 83 shouldBe("gl.isFramebuffer(null)", "false"); |
| 84 shouldBe("gl.isFramebuffer(undefined)", "false"); |
| 85 |
| 86 shouldBe("gl.isProgram(null)", "false"); |
| 87 shouldBe("gl.isProgram(undefined)", "false"); |
| 88 |
| 89 shouldBe("gl.isRenderbuffer(null)", "false"); |
| 90 shouldBe("gl.isRenderbuffer(undefined)", "false"); |
| 91 |
| 92 shouldBe("gl.isShader(null)", "false"); |
| 93 shouldBe("gl.isShader(undefined)", "false"); |
| 94 |
| 95 shouldBe("gl.isTexture(null)", "false"); |
| 96 shouldBe("gl.isTexture(undefined)", "false"); |
| 97 } |
| 98 |
| 99 description("Tests type checking for isX() functions"); |
| 100 var gl = WebGLTestUtils.create3DContext(document.getElementById("canvas_element"
)); |
| 101 runTest(); |
| 102 var successfullyParsed = true; |
| 103 </script> |
| 104 |
| 105 <script src="../../../resources/js-test-post.js"></script> |
| 106 </body> |
| 107 </html> |
| 108 |
OLD | NEW |