OLD | NEW |
| (Empty) |
1 <html> | |
2 <head> | |
3 <script src="../../../resources/js-test.js"></script> | |
4 <script src="resources/webgl-test.js"></script> | |
5 </head> | |
6 <body> | |
7 <div id="description"></div> | |
8 <div id="console"></div> | |
9 | |
10 <script> | |
11 description("Tests generation of synthetic and real GL errors"); | |
12 | |
13 if (window.internals) | |
14 window.internals.settings.setWebGLErrorsToConsoleEnabled(false); | |
15 | |
16 var context = create3DContext(); | |
17 var program = loadStandardProgram(context); | |
18 | |
19 // Other tests in this directory like getActiveTest and | |
20 // incorrect-context-object-behaviour already test the raising of many | |
21 // synthetic GL errors. This test verifies the raising of certain | |
22 // known real GL errors, and contains a few regression tests for bugs | |
23 // discovered in the synthetic error generation and in the WebGL | |
24 // implementation itself. | |
25 | |
26 glErrorShouldBe(context, context.NO_ERROR); | |
27 | |
28 debug("Testing getActiveAttrib"); | |
29 // Synthetic OpenGL error | |
30 shouldBeNull("context.getActiveAttrib(null, 2)"); | |
31 glErrorShouldBe(context, context.INVALID_VALUE); | |
32 // Error state should be clear by this point | |
33 glErrorShouldBe(context, context.NO_ERROR); | |
34 // Real OpenGL error | |
35 shouldBeNull("context.getActiveAttrib(program, 2)"); | |
36 glErrorShouldBe(context, context.INVALID_VALUE); | |
37 // Error state should be clear by this point | |
38 glErrorShouldBe(context, context.NO_ERROR); | |
39 | |
40 debug("Testing getActiveUniform"); | |
41 // Synthetic OpenGL error | |
42 shouldBeNull("context.getActiveUniform(null, 0)"); | |
43 glErrorShouldBe(context, context.INVALID_VALUE); | |
44 // Error state should be clear by this point | |
45 glErrorShouldBe(context, context.NO_ERROR); | |
46 // Real OpenGL error | |
47 shouldBeNull("context.getActiveUniform(program, 50)"); | |
48 glErrorShouldBe(context, context.INVALID_VALUE); | |
49 // Error state should be clear by this point | |
50 glErrorShouldBe(context, context.NO_ERROR); | |
51 | |
52 debug("Testing attempts to manipulate the default framebuffer"); | |
53 shouldBeUndefined("context.bindFramebuffer(context.FRAMEBUFFER, null)"); | |
54 glErrorShouldBe(context, context.NO_ERROR); | |
55 shouldBeUndefined("context.framebufferRenderbuffer(context.FRAMEBUFFER, context.
DEPTH_ATTACHMENT, context.RENDERBUFFER, null)"); | |
56 // Synthetic OpenGL error | |
57 glErrorShouldBe(context, context.INVALID_OPERATION); | |
58 // Error state should be clear by this point | |
59 glErrorShouldBe(context, context.NO_ERROR); | |
60 shouldBeUndefined("context.framebufferTexture2D(context.FRAMEBUFFER, context.COL
OR_ATTACHMENT0, context.TEXTURE_2D, null, 0)"); | |
61 // Synthetic OpenGL error | |
62 glErrorShouldBe(context, context.INVALID_OPERATION); | |
63 // Error state should be clear by this point | |
64 glErrorShouldBe(context, context.NO_ERROR); | |
65 </script> | |
66 | |
67 </body> | |
68 </html> | |
OLD | NEW |