loaf-pointer-without-render.html (1233B)
1 <!DOCTYPE HTML> 2 <meta charset=utf-8> 3 <title>Long Animation Frame Timing: Pointer event without render in the main frame</title> 4 <meta name="timeout" content="long"> 5 <script src=/resources/testdriver.js></script> 6 <script src=/resources/testdriver-actions.js></script> 7 <script src=/resources/testdriver-vendor.js></script> 8 <script src="/resources/testharness.js"></script> 9 <script src="/resources/testharnessreport.js"></script> 10 <script src="resources/utils.js"></script> 11 <style> 12 * { 13 user-select: none; 14 } 15 </style> 16 <body> 17 <h1>Test</h1> 18 <script> 19 promise_test(async t => { 20 document.body.addEventListener("pointerdown", () => { 21 busy_wait(60); 22 }); 23 const loaf_promise = new Promise(resolve => new PerformanceObserver(entries => { 24 if (entries.getEntries().some( 25 e => e.scripts.some(script => script.invoker === "BODY.onpointerdown"))) { 26 resolve("OK"); 27 } 28 }).observe({type: "long-animation-frame"})); 29 30 const actions = new test_driver.Actions(); 31 await actions.pointerMove(10, 10, {origin: document.body}) 32 .pointerDown() 33 .pointerUp() 34 .send(); 35 assert_equals(await loaf_promise, "OK"); 36 }, "Input events should create a LoAF even if they don't generate a frame") 37 </script> 38 </body>