input-sequence-of-events.html (790B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>Test the sequence of events when reporting input timing.</title> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 <body> 7 <script> 8 async_test(t => { 9 const input = document.createElement('input'); 10 input.type = "image"; 11 const absoluteURL = new URL('resources/blue.png', location.href).toString(); 12 t.add_cleanup(() => input.remove()); 13 input.addEventListener('load', t.step_func(() => { 14 assert_equals(performance.getEntriesByName(absoluteURL).length, 1); 15 t.done(); 16 })); 17 input.src = absoluteURL; 18 document.body.appendChild(input); 19 }, "An image input element should receive its load event after the ResourceTiming entry is available"); 20 21 </script>