Class for unit testing code that uses setTimeout and clearTimeout.
NOTE: If you are using MockClock to test code that makes use of
goog.fx.Animation, then you must either:
1. Install and dispose of the MockClock in setUpPage() and tearDownPage()
respectively (rather than setUp()/tearDown()).
or
2. Ensure that every test clears the animation queue by calling
mockClock.tick(x) at the end of each test function (where `x` is large
enough to complete all animations).
Otherwise, if any animation is left pending at the time that
MockClock.dispose() is called, that will permanently prevent any future
animations from playing on the page.
Whether the timer has been set and not cleared,
independent of the timeout's expiration. In other words, the timeout
could have passed or could be scheduled for the future. Either way,
this function returns true or false depending only on whether the
provided timeoutKey represents a timeout that has been set and not
cleared.
Disposes of the object. If the object hasn't already been disposed of, calls
#disposeInternal. Classes that extend goog.Disposable should
override #disposeInternal in order to delete references to COM
objects, DOM nodes, and other disposable objects. Reentrant.
Reverse-order queue of timers to fire.
The last item of the queue is popped off. Insertion happens from the
right. For example, the expiration times for each element of the queue
might be in the order 300, 200, 200.
Additional delay between the time a timeout was set to fire, and the time
it actually fires. Useful for testing workarounds for this Firefox 2 bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=291386
May be negative.
Inserts a timer descriptor into a descending-order queue.
Later-inserted duplicates appear at lower indices. For example, the
asterisk in (5,4,*,3,2,1) would be the insertion point for 3.
Maximum 32-bit signed integer.
Timeouts over this time return immediately in many browsers, due to integer
overflow. Such known browsers include Firefox, Chrome, and Safari, but not
IE.