OLD | NEW |
---|---|
1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
2 | 2 |
3 <!-- READ BEFORE UPDATING: | 3 <!-- READ BEFORE UPDATING: |
4 If this test is updated make sure to increment the "revision" value of the | 4 If this test is updated make sure to increment the "revision" value of the |
5 associated test in content/test/gpu/page_sets/pixel_tests.json. This will ensure | 5 associated test in content/test/gpu/page_sets/pixel_tests.json. This will ensure |
6 that the baseline images are regenerated on the next run. | 6 that the baseline images are regenerated on the next run. |
7 --> | 7 --> |
8 | 8 |
9 <html> | 9 <html> |
10 <head> | 10 <head> |
(...skipping 24 matching lines...) Expand all Loading... | |
35 var g_swapsBeforeAck = 15; | 35 var g_swapsBeforeAck = 15; |
36 var gl; | 36 var gl; |
37 var lose_context_ext; | 37 var lose_context_ext; |
38 | 38 |
39 function main() | 39 function main() |
40 { | 40 { |
41 var canvas = document.getElementById("c"); | 41 var canvas = document.getElementById("c"); |
42 gl = initGL(canvas); | 42 gl = initGL(canvas); |
43 | 43 |
44 canvas.addEventListener("webglcontextlost", function(ev) { | 44 canvas.addEventListener("webglcontextlost", function(ev) { |
45 ev.preventDefault(); | 45 ev.preventDefault(); |
dshwang
2014/03/11 17:30:57
we prevent default, so we should trust "webglconte
Ken Russell (switch to Gerrit)
2014/03/11 17:35:14
Sorry, the WEBGL_context_lost extension doesn't wo
| |
46 }, false); | 46 }, false); |
47 canvas.addEventListener("webglcontextrestored", function(ev) { | 47 canvas.addEventListener("webglcontextrestored", function(ev) { |
48 if (setup(gl)) { | 48 if (setup(gl)) { |
49 drawSomeFrames(); | 49 drawSomeFrames(); |
50 } else { | 50 } else { |
51 domAutomationController.setAutomationId(1); | 51 domAutomationController.setAutomationId(1); |
52 domAutomationController.send("FAILURE"); | 52 domAutomationController.send("FAILURE"); |
53 } | 53 } |
54 }, false); | 54 }, false); |
55 | 55 |
56 if (gl && setup(gl)) { | 56 if (gl && setup(gl)) { |
57 gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); | 57 gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); |
58 | 58 |
59 lose_context_ext.loseContext(); | 59 lose_context_ext.loseContext(); |
60 setTimeout(function() { | |
61 lose_context_ext.restoreContext(); | |
62 }, 3000); | |
63 } else { | 60 } else { |
64 domAutomationController.setAutomationId(1); | 61 domAutomationController.setAutomationId(1); |
65 domAutomationController.send("FAILURE"); | 62 domAutomationController.send("FAILURE"); |
66 } | 63 } |
67 } | 64 } |
68 | 65 |
69 function drawSomeFrames() | 66 function drawSomeFrames() |
70 { | 67 { |
71 if (g_swapsBeforeAck == 0) { | 68 if (g_swapsBeforeAck == 0) { |
72 domAutomationController.setAutomationId(1); | 69 domAutomationController.setAutomationId(1); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
157 } | 154 } |
158 </script> | 155 </script> |
159 </head> | 156 </head> |
160 <body onload="main()"> | 157 <body onload="main()"> |
161 <div style="position:relative; width:200px; height:200px; background-color:black "></div> | 158 <div style="position:relative; width:200px; height:200px; background-color:black "></div> |
162 <div style="position:absolute; top:0px; left:0px"> | 159 <div style="position:absolute; top:0px; left:0px"> |
163 <canvas id="c" width="200" height="200" class="nomargin"></canvas> | 160 <canvas id="c" width="200" height="200" class="nomargin"></canvas> |
164 </div> | 161 </div> |
165 </body> | 162 </body> |
166 </html> | 163 </html> |
OLD | NEW |