fcp-canvas-context.html (863B)
1 <!DOCTYPE html> 2 <head> 3 <title>Performance Paint Timing Test: FCP when canvas context is created</title> 4 </head> 5 <body> 6 <script src="../resources/utils.js"></script> 7 <script src="/resources/testharness.js"></script> 8 <script src="/resources/testharnessreport.js"></script> 9 <canvas id="canvas" width="50" height="50"></canvas> 10 <script> 11 setup({"hide_test_state": true}); 12 promise_test(async t => { 13 assert_implements(window.PerformancePaintTiming, "Paint Timing isn't supported."); 14 await new Promise(r => window.addEventListener('load', r)); 15 await assertNoFirstContentfulPaint(t); 16 const canvas = document.getElementById('canvas'); 17 const context = canvas.getContext('2d'); 18 context.fillRect(0, 0, 100, 100); 19 await assertFirstContentfulPaint(t); 20 }, 'Canvas should count as contentful when context is created'); 21 </script> 22 </body> 23 24 </html>