search

goog.testing.MockClock

Provided By
Extends
All Implemented Interfaces

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

  1. 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.

new MockClock( opt_autoInstall )

Parameters
opt_autoInstallboolean=

Install the MockClock at construction time.

Instance Methods

Instance Properties

Static Functions

Static Properties