| <!DOCTYPE html> |
| <html> |
| <head> |
| <script src="../../../resources/js-test-pre.js"></script> |
| </head> |
| <body> |
| <script> |
| var canvas = document.createElement("canvas"); |
| canvas.width = 2; |
| canvas.height = 2; |
| var context = canvas.getContext("webgl"); |
| shouldBe("context.getError()", "context.NO_ERROR"); |
| var buffer = context.createBuffer(); |
| shouldBe("context.getError()", "context.NO_ERROR"); |
| context.bindBuffer(context.ARRAY_BUFFER, buffer); |
| shouldBe("context.getError()", "context.NO_ERROR"); |
| shouldNotThrow(context.bufferData(context.ARRAY_BUFFER, new ArrayBuffer(10), context.STATIC_DRAW)); |
| shouldBe("context.getError()", "context.NO_ERROR"); |
| shouldNotThrow(context.bufferData(context.ARRAY_BUFFER, null, context.STATIC_DRAW)); |
| shouldBe("context.getError()", "context.INVALID_VALUE"); |
| shouldBe("context.getError()", "context.NO_ERROR"); |
| </script> |
| <script src="../../../resources/js-test-post.js"></script> |
| </body> |
| </html> |