blob: 4671604cf09b9c5eaf0c11daa71692fe5790a270 [file] [log] [blame]
Nicolas Penadc1b4222017-11-14 17:26:181<!DOCTYPE html>
2<body>
3<script src="/resources/testharness.js"></script>
4<script src="/resources/testharnessreport.js"></script>
5
6<script>
7async_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 Penadc1b4222017-11-14 17:26:1810 // When only child frame paints, expect only first-paint.
11 t.step_timeout( function() {
Nicolas Pena0c249ac2017-11-28 19:32:3512 const bufferedEntries = performance.getEntriesByType('paint');
Nicolas Penadc1b4222017-11-14 17:26:1813 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>