| Nicolas Pena | dc1b422 | 2017-11-14 17:26:18 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <body> |
| 3 | <script src="/resources/testharness.js"></script> |
| 4 | <script src="/resources/testharnessreport.js"></script> |
| 5 | |
| 6 | <script> |
| 7 | async_test(function (t) { |
| 8 | window.addEventListener('message', t.step_func(e => { |
| 9 | assert_equals(e.data, '2 paint first-paint paint first-contentful-paint'); |
| Nicolas Pena | dc1b422 | 2017-11-14 17:26:18 | [diff] [blame] | 10 | // When only child frame paints, expect only first-paint. |
| 11 | t.step_timeout( function() { |
| Nicolas Pena | 0c249ac | 2017-11-28 19:32:35 | [diff] [blame] | 12 | const bufferedEntries = performance.getEntriesByType('paint'); |
| Nicolas Pena | dc1b422 | 2017-11-14 17:26:18 | [diff] [blame] | 13 | assert_equals(bufferedEntries.length, 1); |
| 14 | assert_equals(bufferedEntries[0].entryType, 'paint'); |
| 15 | assert_equals(bufferedEntries[0].name, 'first-paint'); |
| 16 | t.done(); |
| 17 | }, 50); |
| 18 | })); |
| 19 | const iframe = document.createElement('iframe'); |
| 20 | iframe.id = 'child-iframe'; |
| 21 | iframe.src = 'resources/subframe-painting.html'; |
| 22 | document.body.appendChild(iframe); |
| 23 | }, 'Parent frame ignores paint-timing events fired from child image rendering.'); |
| 24 | </script> |
| 25 | </body> |
| 26 | </html> |