mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-14 10:01:08 +08:00
skip callback test
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user