OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <head> |
| 3 <title>Performance Paint Timing Test: FCP due to background image</title> |
| 4 </head> |
| 5 <body> |
| 6 <script src="../../resources/testharness.js"></script> |
| 7 <script src="../../resources/testharnessreport.js"></script> |
| 8 <div id="main"></div> |
| 9 </body> |
| 10 <footer> |
| 11 <script> |
| 12 async_test(function (t) { |
| 13 const body = document.getElementsByTagName('body')[0]; |
| 14 body.style.backgroundImage = 'url(resources/circles.png)'; |
| 15 window.onload = function() { |
| 16 testRunner.capturePixelsAsyncThen(t.step_func_done(function() { |
| 17 const bufferedEntries = performance.getEntriesByType('paint'); |
| 18 assert_equals(bufferedEntries.length, 2, "There should be two pa
int timing instances."); |
| 19 assert_equals(bufferedEntries[0].entryType, "paint"); |
| 20 assert_equals(bufferedEntries[0].name, "first-paint"); |
| 21 assert_equals(bufferedEntries[1].entryType, "paint"); |
| 22 assert_equals(bufferedEntries[1].name, "first-contentful-paint")
; |
| 23 })); |
| 24 }; |
| 25 }, "First contentful paint fires due to background image render."); |
| 26 </script> |
| 27 <footer> |
| 28 </html> |
OLD | NEW |