Sha256: 81c9a231dc39a6e79e4dc81a08b3958217ff24f1e7b9a213ac6a759fc1465218
Contents?: true
Size: 990 Bytes
Versions: 53
Compression:
Stored size: 990 Bytes
Contents
// ======================================================================== // SC.Timer Tests // ======================================================================== /*globals module test ok isObj equals expects */ /** Exercises timer invalidation on the SC.Timer class. */ module("Timer.invalidate") ; /** A timer scheduled and then invalidated before the end of the run loop should not fire. @author Erich Ocean @since 6e7becdfb4e7f22b340eb5e6d7f3b4df4ea65060 */ test("invalidate immediately should never execute", function() { var fired = NO ; SC.RunLoop.begin() ; var start = SC.RunLoop.currentRunLoop.get('startTime') ; var t = SC.Timer.schedule({ target: this, action: function() { fired = YES ; }, interval: 100 }); t.invalidate() ; SC.RunLoop.end() ; stop(2500) ; // stops the test runner, fails after 2500ms setTimeout(function() { equals(NO, fired) ; window.start() ; // starts the test runner }, 1500); });
Version data entries
53 entries across 53 versions & 3 rubygems