UNPKG

selenium-webdriver

Version:

The official WebDriver JavaScript bindings from the Selenium project

66 lines (58 loc) 29.7 kB
<!DOCTYPE html><meta charset="UTF-8"><meta http-equiv="Content-Language" content="en" /><title>goog.testing.MockClock</title><link href="dossier.css" rel="stylesheet" type="text/css"><div id="main-wrapper"><input type="checkbox" id="sidenav-toggle" /><main><header><h1>Class goog.testing.MockClock</h1><a class="source" href="source/lib/goog/testing/mockclock.js.src.html#l59">code &raquo;</a><pre><code><a href="class_goog_Disposable.html">goog.Disposable</a> &#x2514; goog.testing.MockClock</code></pre><dl><dt>All implemented interfaces:<dd><code><a href="interface_goog_disposable_IDisposable.html">goog.disposable.IDisposable</a></code></dl></header><section><p>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.<h2>Constructor</h2><div class="ctor wrap-details public"><div><div class="ctor"><span class="member">goog.testing.MockClock <span class="args">( opt_autoInstall )</span></span></div><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>opt_autoInstall: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>=</code><dd>Install the MockClock at construction time.</dl></table></div></div></div></section><div id="visibility-controls"><b>Show:</b><label for="show-public"><span><input type="checkbox" id="show-public" checked/></span>Public</label><label for="show-protected"><span><input type="checkbox" id="show-protected"/></span>Protected</label><label for="show-private"><span><input type="checkbox" id="show-private"/></span>Private</label></div><section id="instance-methods"><h2>Instance Methods</h2><h3>Defined in <code class="type">goog.testing.MockClock</code></h3><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/mockclock.js.src.html#l546">code &raquo;</a><span class="member"><a name="cancelRequestAnimationFrame_">cancelRequestAnimationFrame_</a> <span class="args">( timeoutKey )</span></span></div><p>Clears a requestAnimationFrame. Mock implementation for cancelRequestAnimationFrame.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>timeoutKey: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code><dd>The requestAnimationFrame key to clear.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/mockclock.js.src.html#l535">code &raquo;</a><span class="member"><a name="clearInterval_">clearInterval_</a> <span class="args">( timeoutKey )</span></span></div><p>Clears an interval. Mock implementation for clearInterval.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>timeoutKey: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code><dd>The interval key to clear.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/mockclock.js.src.html#l508">code &raquo;</a><span class="member"><a name="clearTimeout_">clearTimeout_</a> <span class="args">( timeoutKey )</span></span></div><p>Clears a timeout. Mock implementation for clearTimeout.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>timeoutKey: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code><dd>The timeout key to clear.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/mockclock.js.src.html#l228">code &raquo;</a><span class="member"><a name="disposeInternal">disposeInternal</a> <span class="args">( )</span></span></div></summary></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/mockclock.js.src.html#l255">code &raquo;</a><span class="member"><a name="fireResetEvent">fireResetEvent</a> <span class="args">( )</span></span></div><p>Signals that the mock clock has been reset, allowing objects that maintain their own internal state to reset.</summary></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/mockclock.js.src.html#l309">code &raquo;</a><span class="member"><a name="getCurrentTime">getCurrentTime</a> <span class="args">( )</span> &rArr; <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>The MockClock's current time in milliseconds.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/mockclock.js.src.html#l275">code &raquo;</a><span class="member"><a name="getTimeoutDelay">getTimeoutDelay</a> <span class="args">( )</span> &rArr; <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>delay The amount of time between when a timeout is scheduled to fire and when it actually fires, in milliseconds. May be negative.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/mockclock.js.src.html#l301">code &raquo;</a><span class="member"><a name="getTimeoutsMade">getTimeoutsMade</a> <span class="args">( )</span> &rArr; <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>The number of timeouts that have been scheduled.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/mockclock.js.src.html#l152">code &raquo;</a><span class="member"><a name="install">install</a> <span class="args">( )</span></span></div><p>Installs the MockClock by overriding the global object's implementation of setTimeout, setInterval, clearTimeout and clearInterval.</summary></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/mockclock.js.src.html#l323">code &raquo;</a><span class="member"><a name="isTimeoutSet">isTimeoutSet</a> <span class="args">( timeoutKey )</span> &rArr; <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>timeoutKey: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code><dd>The timeout key.</dl><tr><th>Returns<tr><td><dl>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.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/mockclock.js.src.html#l182">code &raquo;</a><span class="member"><a name="replaceRequestAnimationFrame_">replaceRequestAnimationFrame_</a> <span class="args">( )</span></span></div><p>Installs the mocks for requestAnimationFrame and cancelRequestAnimationFrame.</summary></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/mockclock.js.src.html#l476">code &raquo;</a><span class="member"><a name="requestAnimationFrame_">requestAnimationFrame_</a> <span class="args">( funcToCall )</span> &rArr; <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div><p>Schedules a function to be called when an animation frame is triggered. Mock implementation for requestAnimationFrame.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>funcToCall: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a></code><dd>The function to call.</dl><tr><th>Returns<tr><td><dl>The number of timeouts created.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/mockclock.js.src.html#l240">code &raquo;</a><span class="member"><a name="reset">reset</a> <span class="args">( )</span></span></div><p>Resets the MockClock, removing all timeouts that are scheduled and resets the fake timer count.</summary></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/mockclock.js.src.html#l334">code &raquo;</a><span class="member"><a name="runFunctionsWithinRange_">runFunctionsWithinRange_</a> <span class="args">( endTime )</span></span></div><p>Runs any function that is scheduled before a certain time. Timeouts can be made to fire early or late if timeoutDelay_ is non-0.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>endTime: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code><dd>The latest time in the range, in milliseconds.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/mockclock.js.src.html#l367">code &raquo;</a><span class="member"><a name="scheduleFunction_">scheduleFunction_</a> <span class="args">( timeoutKey, funcToCall, millis, recurring )</span></span></div><p>Schedules a function to be run at a certain time.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>timeoutKey: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code><dd>The timeout key.<dt>funcToCall: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a></code><dd>The function to call.<dt>millis: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code><dd>The number of milliseconds to call it in.<dt>recurring: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code><dd>Whether to function call should recur.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/mockclock.js.src.html#l497">code &raquo;</a><span class="member"><a name="setImmediate_">setImmediate_</a> <span class="args">( funcToCall )</span> &rArr; <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div><p>Schedules a function to be called immediately after the current JS execution. Mock implementation for setImmediate.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>funcToCall: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a></code><dd>The function to call.</dl><tr><th>Returns<tr><td><dl>The number of timeouts created.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/mockclock.js.src.html#l462">code &raquo;</a><span class="member"><a name="setInterval_">setInterval_</a> <span class="args">( funcToCall, millis )</span> &rArr; <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div><p>Schedules a function to be called every <code >millis</code> milliseconds. Mock implementation for setInterval.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>funcToCall: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a></code><dd>The function to call.<dt>millis: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code><dd>The number of milliseconds between calls.</dl><tr><th>Returns<tr><td><dl>The number of timeouts created.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/mockclock.js.src.html#l265">code &raquo;</a><span class="member"><a name="setTimeoutDelay">setTimeoutDelay</a> <span class="args">( delay )</span></span></div><p>Sets the amount of time between when a timeout is scheduled to fire and when it actually fires.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>delay: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code><dd>The delay in milliseconds. May be negative.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/mockclock.js.src.html#l441">code &raquo;</a><span class="member"><a name="setTimeout_">setTimeout_</a> <span class="args">( funcToCall, millis )</span> &rArr; <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div><p>Schedules a function to be called after <code >millis</code> milliseconds. Mock implementation for setTimeout.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>funcToCall: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a></code><dd>The function to call.<dt>millis: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code><dd>The number of milliseconds to call it after.</dl><tr><th>Returns<tr><td><dl>The number of timeouts created.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/mockclock.js.src.html#l287">code &raquo;</a><span class="member"><a name="tick">tick</a> <span class="args">( opt_millis )</span> &rArr; <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div><p>Increments the MockClock's time by a given number of milliseconds, running any functions that are now overdue.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>opt_millis: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>=</code><dd>Number of milliseconds to increment the counter. If not specified, clock ticks 1 millisecond.</dl><tr><th>Returns<tr><td><dl>Current mock time in milliseconds.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/mockclock.js.src.html#l216">code &raquo;</a><span class="member"><a name="uninstall">uninstall</a> <span class="args">( )</span></span></div><p>Removes the MockClock's hooks into the global object's functions and revert to their original values.</summary></details></div></div><h3>Defined in <code class="type"><a href="class_goog_Disposable.html">goog.Disposable</a></code></h3><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/disposable/disposable.js.src.html#l214">code &raquo;</a><code class="type">&lt;T&gt;</code> <span class="member"><a name="addOnDisposeCallback">addOnDisposeCallback</a> <span class="args">( callback, opt_scope )</span></span></div><p>Invokes a callback function when this object is disposed. Callbacks are invoked in the order in which they were added.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>callback: <code class="type">function(this: T): ?</code><dd>The callback function.<dt>opt_scope: <code class="type">T=</code><dd>An optional scope to call the callback in.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/disposable/disposable.js.src.html#l175">code &raquo;</a><span class="member"><a name="dispose">dispose</a> <span class="args">( )</span> &rArr; <code class="type">void</code></span></div><p>Disposes of the object. If the object hasn't already been disposed of, calls <code class="type"><a class="unresolved-link">#disposeInternal</a></code>. Classes that extend <code >goog.Disposable</code> should override <code class="type"><a class="unresolved-link">#disposeInternal</a></code> in order to delete references to COM objects, DOM nodes, and other disposable objects. Reentrant.</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>Nothing.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/disposable/disposable.js.src.html#l163">code &raquo;</a><span class="member deprecation-notice"><a name="getDisposed">getDisposed</a> <span class="args">( )</span> &rArr; <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div><div class="deprecation-notice">Deprecated: <span class="deprecation-reason">Use <code class="type"><a class="unresolved-link">#isDisposed</a></code> instead.</span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>Whether the object has been disposed of.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/disposable/disposable.js.src.html#l154">code &raquo;</a><span class="member"><a name="isDisposed">isDisposed</a> <span class="args">( )</span> &rArr; <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>Whether the object has been disposed of.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/disposable/disposable.js.src.html#l202">code &raquo;</a><span class="member"><a name="registerDisposable">registerDisposable</a> <span class="args">( disposable )</span></span></div><p>Associates a disposable object with this object so that they will be disposed together.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>disposable: <code class="type"><a href="interface_goog_disposable_IDisposable.html">goog.disposable.IDisposable</a></code><dd>that will be disposed when this object is disposed.</dl></table></div></details></div></div></section><section id="instance-properties"><h2>Instance Properties</h2><h3>Defined in <code class="type">goog.testing.MockClock</code></h3><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/goog/testing/mockclock.js.src.html#l126">code &raquo;</a><span class="member"><a name="deletedKeys_">deletedKeys_</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></code></span></div><p>Map of deleted keys. These keys represents keys that were deleted in a clearInterval, timeoutid -> object.</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/goog/testing/mockclock.js.src.html#l134">code &raquo;</a><span class="member"><a name="nowMillis_">nowMillis_</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div><p>The current simulated time in milliseconds.</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/goog/testing/mockclock.js.src.html#l72">code &raquo;</a><span class="member"><a name="queue_">queue_</a> : <code class="type"><a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>.&lt;<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>&gt;</code></span></div><p>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.</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/goog/testing/mockclock.js.src.html#l117">code &raquo;</a><span class="member"><a name="replacer_">replacer_</a> : <code class="type"><a href="class_goog_testing_PropertyReplacer.html">goog.testing.PropertyReplacer</a></code></span></div><p>PropertyReplacer instance which overwrites and resets setTimeout, setInterval, etc. or null if the MockClock is not installed.</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/goog/testing/mockclock.js.src.html#l145">code &raquo;</a><span class="member"><a name="timeoutDelay_">timeoutDelay_</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div><p>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.</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/goog/testing/mockclock.js.src.html#l108">code &raquo;</a><span class="member"><a name="timeoutsMade_">timeoutsMade_</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div><p>Count of the number of timeouts made.</summary></details></div></div><h3>Defined in <code class="type"><a href="class_goog_Disposable.html">goog.Disposable</a></code></h3><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/goog/disposable/disposable.js.src.html#l147">code &raquo;</a><span class="member"><a name="creationStack">creationStack</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div><p>If monitoring the goog.Disposable instances is enabled, stores the creation stack trace of the Disposable instance.</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/goog/disposable/disposable.js.src.html#l131">code &raquo;</a><span class="member"><a name="disposed_">disposed_</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div><p>Whether the object has been disposed of.</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/goog/disposable/disposable.js.src.html#l139">code &raquo;</a><span class="member"><a name="onDisposeCallbacks_">onDisposeCallbacks_</a> : <code class="type"><a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></code></span></div><p>Callbacks to invoke when this object is disposed.</summary></details></div></div></section><section id="static-functions"><h2>Static Functions</h2><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/mockclock.js.src.html#l399">code &raquo;</a><span class="member"><a name="goog.testing.MockClock.insert_">goog.testing.MockClock.insert_</a> <span class="args">( timeout, queue )</span></span></div><p>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.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>timeout: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></code><dd>The timeout to insert, with numerical runAtMillis property.<dt>queue: <code class="type"><a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>.&lt;<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>&gt;</code><dd>The queue to insert into, with each element having a numerical runAtMillis property.</dl></table></div></details></div></div></section><section id="static-properties"><h2>Static Properties</h2><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/goog/testing/mockclock.js.src.html#l430">code &raquo;</a><span class="member"><a name="goog.testing.MockClock.MAX_INT_">goog.testing.MockClock.MAX_INT_</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div><p>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.</summary></details></div></div><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/goog/testing/mockclock.js.src.html#l100">code &raquo;</a><span class="member"><a name="goog.testing.MockClock.REQUEST_ANIMATION_FRAME_TIMEOUT">goog.testing.MockClock.REQUEST_ANIMATION_FRAME_TIMEOUT</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div><p>Default wait timeout for mocking requestAnimationFrame (in milliseconds).</summary></details></div></div><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/goog/testing/mockclock.js.src.html#l59">code &raquo;</a><span class="member"><a name="goog.testing.MockClock.superClass_">goog.testing.MockClock.superClass_</a> : <code class="type"><a href="class_goog_Disposable.html">goog.Disposable.prototype</a></code></span></div></summary></details></div></div></section></main><nav id="topnav"><div><div id="menubutton"><label for="sidenav-toggle">Menu</label></div><form id="searchbox"><div><input type="search" placeholder="Search" tabindex="1"></div></form></div></nav><nav id="sidenav"><input type="checkbox" id="sidenav-types-ctrl" /><input type="checkbox" id="sidenav-files-ctrl" /><input type="checkbox" id="sidenav-modules-ctrl" /><a id="sidenav-overview"><div><h4>Overview</h4></div></a><div id="sidenav-types"><label for="sidenav-types-ctrl"><h4>Types</h4></label><i>Loading</i></div><div id="sidenav-modules"><label for="sidenav-modules-ctrl"><h4>Modules</h4></label><i>Loading</i></div><div id="sidenav-files"><label for="sidenav-files-ctrl"><h4>Files</h4></label><i>Loading</i></div><a href="license.html"><div><h4>License</h4></div></a></nav><div id="push-footer"></div></div><footer><a href="https://github.com/jleyba/js-dossier">Generated by dossier</a></footer><script src="types.js"></script><script src="dossier.js"></script>