1
0
Fork 0
firefox/testing/web-platform/tests/html/webappapis/timers/clearinterval-from-callback.any.js
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

19 lines
471 B
JavaScript

async_test((t) => {
let wasPreviouslyCalled = false;
const handle = setInterval(
t.step_func(() => {
if (!wasPreviouslyCalled) {
wasPreviouslyCalled = true;
clearInterval(handle);
// Make the test succeed after the callback would've run next.
setInterval(t.step_func_done(), 750);
} else {
assert_unreached();
}
}),
500
);
}, "Clearing an interval from the callback should still clear it.");