skip callback test

This commit is contained in:
Eduardo Speroni
2020-11-16 14:14:39 -03:00
parent 646f2fd64d
commit 7d01a1eaca

View File

@ -188,6 +188,23 @@ export function test_setInterval_callbackNotDelayedByBusyWork() {
TKUnit.assertEqual(calls, 2, 'Callback should be called multiple times with busy wait');
}
export function test_setInterval_callbackSkippedByBusyWork() {
let calls = 0;
let firstCall = true;
const id = timer.setInterval(() => {
calls++;
if (firstCall) {
firstCall = false;
TKUnit.wait(0.051);
}
}, 50);
TKUnit.wait(0.16);
timer.clearInterval(id);
TKUnit.assertEqual(calls, 2, 'Callback should be called skipped when it takes too long to process');
}
export function test_setInterval_callbackShouldBeCleared(done) {
const start = TKUnit.time();
// >> timer-set-interval