recordfunction.js
No description.

File Location

/goog/testing/recordfunction.js

Classes

goog.testing.FunctionCall
Struct for a single function call.

Public Protected Private

Global Functions

goog.testing.recordFunction&recordedFunction.assertCallCount(expected)
Asserts that the function was called expected times.
Arguments:
expected : number
The expected number of calls.
code »
goog.testing.recordFunction&recordedFunction.getCallCount() number
No description.
Returns: number  Total number of calls.
code »
goog.testing.recordFunction&recordedFunction.getCalls() !Array.<!goog.testing.FunctionCall>
No description.
Returns: !Array.<!goog.testing.FunctionCall>  All calls of the recorded function.
code »
goog.testing.recordFunction&recordedFunction.getLastCall() goog.testing.FunctionCall
No description.
Returns: goog.testing.FunctionCall  Last call of the recorded function or null if it hasn't been called.
code »
goog.testing.recordFunction&recordedFunction.popLastCall() goog.testing.FunctionCall
Returns and removes the last call of the recorded function.
Returns: goog.testing.FunctionCall  Last call of the recorded function or null if it hasn't been called.
code »
goog.testing.recordConstructor(ctor) !Function
Same as goog.testing.recordFunction but the recorded function will have the same prototype and static fields as the original one. It can be used with constructors.
Arguments:
ctor : !Function
The function to wrap and record.
Returns: !Function  The wrapped function.
code »
goog.testing.recordFunction(opt_f) !Function
Wraps the function into another one which calls the inner function and records its calls. The recorded function will have 3 static methods: getCallCount, getCalls and getLastCall but won't inherit the original function's prototype and static fields.
Arguments:
opt_f : !Function=
The function to wrap and record. Defaults to goog.nullFunction.
Returns: !Function  The wrapped function.
code »
goog.testing.recordFunction&recordedFunction()
No description.
code »
goog.testing.recordFunction&recordedFunction.reset()
Resets the recorded function and removes all calls.
code »

Directory testing

File Reference