Chromium Code Reviews| 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 let body = document.getElementsByTagName('body')[0]; | |
|
tdresser
2017/06/12 14:44:45
const
| |
| 14 body.style.backgroundImage = 'url(resources/circles.png)'; | |
| 15 | |
| 16 testRunner.capturePixelsAsyncThen(t.step_func_done(function() { | |
| 17 const bufferedEntries = performance.getEntriesByType('paint'); | |
| 18 assert_equals(bufferedEntries.length, 2, "There should be two paint 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 }, "First contentful paint fires due to background image render."); | |
| 25 </script> | |
| 26 <footer> | |
| 27 </html> | |
| OLD | NEW |