diff options
Diffstat (limited to 'testing/web-platform/tests/long-animation-frame/tentative/loaf-user-callback.html')
-rw-r--r-- | testing/web-platform/tests/long-animation-frame/tentative/loaf-user-callback.html | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/testing/web-platform/tests/long-animation-frame/tentative/loaf-user-callback.html b/testing/web-platform/tests/long-animation-frame/tentative/loaf-user-callback.html new file mode 100644 index 0000000000..3d868af87f --- /dev/null +++ b/testing/web-platform/tests/long-animation-frame/tentative/loaf-user-callback.html @@ -0,0 +1,56 @@ +<!DOCTYPE HTML> +<meta charset=utf-8> +<title>Long Animation Frame Timing: basic</title> +<meta name="timeout" content="long"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="resources/utils.js"></script> + +<body> +<h1>Long Animation Frame: user callbacks</h1> +<div id="log"></div> +<script> + +test_self_user_callback(t => + t.step_timeout(() => busy_wait()), "TimerHandler:setTimeout"); + +test_self_user_callback(() => { + const interval = setInterval(() => { + busy_wait(); + clearInterval(interval); + }, 10); +}, "TimerHandler:setInterval"); +test_self_user_callback(() => + requestAnimationFrame(() => busy_wait()), "FrameRequestCallback"); + +test_self_user_callback(t => { + const element = document.createElement("div"); + document.body.appendChild(element); + t.add_cleanup(() => element.remove()); + new ResizeObserver((entries, observer) => { + busy_wait(very_long_frame_duration); + observer.disconnect(); + }).observe(element); +}, "ResizeObserverCallback"); + +test_self_user_callback(t => { + const element = document.createElement("div"); + element.innerText = "123"; + t.add_cleanup(() => element.remove()); + new IntersectionObserver((entries, observer) => { + busy_wait(very_long_frame_duration); + observer.disconnect(); + }).observe(element); + document.body.appendChild(element); +}, "IntersectionObserverCallback"); + +test_self_user_callback(t => + scheduler.postTask(() => busy_wait()), "SchedulerPostTaskCallback"); + + test_self_user_callback(t => { + new PerformanceObserver(() => busy_wait()).observe( + {type: "navigation", buffered: true}); +}, "PerformanceObserverCallback"); + +</script> +</body> |