loaf-timeline.html (1108B)
1 <!DOCTYPE HTML> 2 <meta charset=utf-8> 3 <title>Long Animation Frame Timing: basic</title> 4 <meta name="timeout" content="long"> 5 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharnessreport.js"></script> 7 <script src="resources/utils.js"></script> 8 9 <body> 10 <h1>Long Animation Frame: basic</h1> 11 <div id="log"></div> 12 <script> 13 promise_test(async t => { 14 busy_wait(very_long_frame_duration); 15 const is_loaf = entry => entry.duration >= very_long_frame_duration && 16 entry.entryType == "long-animation-frame"; 17 await new Promise(resolve => t.step_timeout(resolve, 300)); 18 const entry_from_all = [...performance.getEntries()].find(is_loaf); 19 const entry_by_type = [...performance.getEntriesByType("long-animation-frame")].find(is_loaf); 20 const entry_by_name = [...performance.getEntriesByName("long-animation-frame")].find(is_loaf); 21 assert_true(!!entry_from_all, "LoAF Entry found"); 22 assert_equals(entry_from_all, entry_by_type); 23 assert_equals(entry_from_all, entry_by_name); 24 }, 'LoAF entries are available in the performance timeline'); 25 </script> 26 </body>