OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE HTML> |
| 2 |
| 3 <!-- READ BEFORE UPDATING: |
| 4 If this test is updated make sure to increment the "revision" value of the |
| 5 associated test in content/test/gpu/gpu_tests/pixel_test_pages.py. This will ens
ure |
| 6 that the baseline images are regenerated on the next run. |
| 7 --> |
| 8 |
| 9 <html> |
| 10 <head> |
| 11 <title>OffscreenCanvas commit() for a frameless canvas : Blank page</title> |
| 12 <style type="text/css"> |
| 13 .nomargin { |
| 14 margin: 0px auto; |
| 15 } |
| 16 </style> |
| 17 </head> |
| 18 <body onload="main()"> |
| 19 <div style="position:relative; width:50px; height:50px; background-color:white"> |
| 20 </div> |
| 21 <script> |
| 22 var g_swapsBeforeAck = 15; |
| 23 |
| 24 function main() |
| 25 { |
| 26 // This test aims to ensure that OffscreenCanvas.commit() does not |
| 27 // crash for a placeholder canvas under frameless document. |
| 28 // Since the document is invisible, the resultant image should be |
| 29 // not visible too. |
| 30 // TODO(crbug.com/683172): Modify this test after handling for |
| 31 // frameless canvas is done. |
| 32 var framelessDoc = document.implementation.createHTMLDocument("frameless"); |
| 33 var canvas = framelessDoc.createElement("canvas"); |
| 34 canvas.width = 50; |
| 35 canvas.height = 50; |
| 36 var offscreenCanvas = canvas.transferControlToOffscreen(); |
| 37 var ctx = offscreenCanvas.getContext("2d"); |
| 38 ctx.fillStyle = "blue"; |
| 39 ctx.fillRect(0, 0, 50, 50); |
| 40 ctx.commit(); |
| 41 |
| 42 waitForFinish(); |
| 43 } |
| 44 |
| 45 function waitForFinish() |
| 46 { |
| 47 if (g_swapsBeforeAck == 0) { |
| 48 domAutomationController.setAutomationId(1); |
| 49 domAutomationController.send("SUCCESS"); |
| 50 } else { |
| 51 g_swapsBeforeAck--; |
| 52 document.getElementById('container').style.zIndex = g_swapsBeforeAck + 1; |
| 53 window.requestAnimationFrame(waitForFinish); |
| 54 } |
| 55 } |
| 56 </script> |
| 57 </body> |
| 58 </html> |
OLD | NEW |