MCPcopy Create free account
hub / github.com/caike/jQuery-Simple-Timer / internalStop

Function internalStop

tests/qunit-2.9.2.js:3565–3599  ·  view source on GitHub ↗
(test)

Source from the content-addressed store, hash-verified

3563
3564 // Put a hold on processing and return a function that will release it.
3565 function internalStop(test) {
3566 var released = false;
3567 test.semaphore += 1;
3568 config.blocking = true;
3569
3570 // Set a recovery timeout, if so configured.
3571 if (defined.setTimeout) {
3572 var timeoutDuration = void 0;
3573
3574 if (typeof test.timeout === "number") {
3575 timeoutDuration = test.timeout;
3576 } else if (typeof config.testTimeout === "number") {
3577 timeoutDuration = config.testTimeout;
3578 }
3579
3580 if (typeof timeoutDuration === "number" && timeoutDuration > 0) {
3581 clearTimeout(config.timeout);
3582 config.timeout = setTimeout$1(function () {
3583 pushFailure("Test took longer than " + timeoutDuration + "ms; test timed out.", sourceFromStacktrace(2));
3584 released = true;
3585 internalRecover(test);
3586 }, timeoutDuration);
3587 }
3588 }
3589
3590 return function resume() {
3591 if (released) {
3592 return;
3593 }
3594
3595 released = true;
3596 test.semaphore -= 1;
3597 internalStart(test);
3598 };
3599 }
3600
3601 // Forcefully release all processing holds.
3602 function internalRecover(test) {

Callers 1

qunit-2.9.2.jsFile · 0.85

Calls 4

pushFailureFunction · 0.85
sourceFromStacktraceFunction · 0.85
internalRecoverFunction · 0.85
internalStartFunction · 0.85

Tested by

no test coverage detected