Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / canvas / webgl / gl-enum-tests.html
blob569f506fd0736dfc1d8f6f31ccf18cb50462a7cb
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
3 <html>
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6 <title>WebGL gl enums Conformance Tests</title>
7 <script src="resources/desktop-gl-constants.js" type="text/javascript"></script>
8 <script src="../../../resources/js-test.js"></script>
9 <script src="resources/webgl-test.js"></script>
10 </head>
11 <body>
12 <div id="description"></div>
13 <div id="console"></div>
14 <canvas id="canvas" width="2" height="2"> </canvas>
15 <script>
16 description("This test ensures various WebGL functions fail when passed non OpenGL ES 2.0 enums.");
18 debug("");
19 debug("Canvas.getContext");
21 if (window.internals)
22 window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
24 var gl = create3DContext(document.getElementById("canvas"));
25 if (!gl) {
26 testFailed("context does not exist");
27 } else {
28 testPassed("context exists");
30 debug("");
31 debug("Checking gl enums.");
33 var buffer = new ArrayBuffer(2);
34 var buf = new Uint16Array(buffer);
35 var tex = gl.createTexture();
36 gl.bindBuffer(gl.ARRAY_BUFFER, gl.createBuffer());
37 glErrorShouldBe(gl, gl.NO_ERROR);
39 var tests = [
40 "gl.bindTexture(desktopGL['TEXTURE_3D'], tex)",
41 "gl.blendEquation(desktopGL['MIN'])",
42 "gl.blendEquation(desktopGL['MAX'])",
43 "gl.blendEquationSeparate(desktopGL['MIN'], gl.FUNC_ADD)",
44 "gl.blendEquationSeparate(desktopGL['MAX'], gl.FUNC_ADD)",
45 "gl.blendEquationSeparate(gl.FUNC_ADD, desktopGL['MIN'])",
46 "gl.blendEquationSeparate(gl.FUNC_ADD, desktopGL['MAX'])",
47 "gl.bufferData(gl.ARRAY_BUFFER, 3, desktopGL['STATIC_READ'])",
48 "gl.disable(desktopGL['CLIP_PLANE0'])",
49 "gl.disable(desktopGL['POINT_SPRITE'])",
50 "gl.getBufferParameter(gl.ARRAY_BUFFER, desktopGL['PIXEL_PACK_BUFFER'])",
51 "gl.hint(desktopGL['PERSPECTIVE_CORRECTION_HINT'], gl.FASTEST)",
52 "gl.isEnabled(desktopGL['CLIP_PLANE0'])",
53 "gl.isEnabled(desktopGL['POINT_SPRITE'])",
54 "gl.pixelStorei(desktopGL['PACK_SWAP_BYTES'], 1)",
55 "gl.readPixels(0, 0, 1, 1, gl.ALPHA, gl.SHORT, buf)",
57 for (var ii = 0; ii < tests.length; ++ii) {
58 eval(tests[ii]);
59 glErrorShouldBe(gl, gl.INVALID_ENUM,
60 tests[ii] + " should return INVALID_ENUM.");
63 gl.bindTexture(gl.TEXTURE_2D, tex);
64 glErrorShouldBe(gl, gl.NO_ERROR);
66 tests = [
67 "gl.getTexParameter(gl.TEXTURE_2D, desktopGL['GENERATE_MIPMAP'])",
68 "gl.texParameteri(desktopGL['TEXTURE_3D'], gl.TEXTURE_MAG_FILTER, gl.NEAREST)",
69 "gl.texParameteri(gl.TEXTURE_2D, desktopGL['GENERATE_MIPMAP'], 1)"
71 for (var ii = 0; ii < tests.length; ++ii) {
72 eval(tests[ii]);
73 glErrorShouldBe(gl, gl.INVALID_ENUM,
74 tests[ii] + " should return INVALID_ENUM.");
78 debug("");
80 </script>
82 <script>
83 </script>
85 </body>
86 </html>