OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../../../resources/js-test.js"></script> | 4 <script src="../../../resources/js-test.js"></script> |
5 <script src="resources/webgl-test.js"></script> | 5 <script src="resources/webgl-test.js"></script> |
6 <script src="resources/webgl-test-utils.js"></script> | 6 <script src="resources/webgl-test-utils.js"></script> |
7 <script> | 7 <script> |
8 window.jsTestIsAsync = true; | |
9 | |
10 if (window.internals) | 8 if (window.internals) |
11 window.internals.settings.setWebGLErrorsToConsoleEnabled(false); | 9 window.internals.settings.setWebGLErrorsToConsoleEnabled(false); |
12 | 10 |
13 var wtu = WebGLTestUtils; | 11 var wtu = WebGLTestUtils; |
14 var canvas; | 12 var canvas; |
15 var gl; | 13 var gl; |
16 var shouldGenerateGLError; | 14 var shouldGenerateGLError; |
17 var extension; | 15 var extension; |
18 var bufferObjects; | 16 var bufferObjects; |
19 var program; | 17 var program; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 finishTest(); | 86 finishTest(); |
89 | 87 |
90 debug(""); | 88 debug(""); |
91 debug("Test losing and restoring a context."); | 89 debug("Test losing and restoring a context."); |
92 | 90 |
93 canvas.addEventListener("webglcontextlost", function(e) { | 91 canvas.addEventListener("webglcontextlost", function(e) { |
94 testLostContext(e); | 92 testLostContext(e); |
95 // restore the context after this event has exited. | 93 // restore the context after this event has exited. |
96 setTimeout(function() { | 94 setTimeout(function() { |
97 shouldGenerateGLError(gl, gl.NO_ERROR, "extension.restoreContext()"); | 95 shouldGenerateGLError(gl, gl.NO_ERROR, "extension.restoreContext()"); |
98 // The context should still be lost. It will not get restored until the | 96 // The context should still be lost. It will not get restored until the |
99 // webglrestorecontext event is fired. | 97 // webglrestorecontext event is fired. |
100 shouldBeTrue("gl.isContextLost()"); | 98 shouldBeTrue("gl.isContextLost()"); |
101 shouldBe("gl.getError()", "gl.NO_ERROR"); | 99 shouldBe("gl.getError()", "gl.NO_ERROR"); |
102 // gl methods should still be no-ops | 100 // gl methods should still be no-ops |
103 shouldGenerateGLError(gl, gl.NO_ERROR, "gl.blendFunc(gl.TEXTURE_2D, gl.T
EXTURE_CUBE_MAP)"); | 101 shouldGenerateGLError(gl, gl.NO_ERROR, "gl.blendFunc(gl.TEXTURE_2D, gl.T
EXTURE_CUBE_MAP)"); |
104 }, 0); | 102 }, 0); |
105 }); | 103 }); |
106 canvas.addEventListener("webglcontextrestored", function() { | 104 canvas.addEventListener("webglcontextrestored", function() { |
107 testRestoredContext(); | 105 testRestoredContext(); |
108 finishTest(); | 106 finishTest(); |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 } | 198 } |
201 | 199 |
202 | 200 |
203 </script> | 201 </script> |
204 </head> | 202 </head> |
205 <body onload="init()"> | 203 <body onload="init()"> |
206 <div id="description"></div> | 204 <div id="description"></div> |
207 <div id="console"></div> | 205 <div id="console"></div> |
208 </body> | 206 </body> |
209 </html> | 207 </html> |
OLD | NEW |