testing.async.MockControl Extends
Provides asynchronous mocks and assertions controlled by a parent MockControl.

Inheritance

Constructor

goog.testing.async.MockControl(mockControl)

Parameters

mockControl : goog.testing.MockControl
The parent MockControl.

Instance Methods

Public Protected Private
assertDeferredEquals(messageexpectedactual)
Asserts that a deferred object will call its callback with the given value.
Arguments:
message : string
A message to print if the arguments are wrong.
expected : goog.async.Deferred | *
The expected value. If this is a deferred object, then the expected value is the deferred value.
actual : goog.async.Deferred | *
The actual value. If this is a deferred object, then the actual value is the deferred value. Either this or 'expected' must be deferred.
code »
assertDeferredError(deferredfn)
Asserts that a deferred object will have an error and call its errback function.
Arguments:
deferred : goog.async.Deferred
The deferred object.
fn : function() : void
A function wrapping the code in which the error will occur.
code »
asyncAssertEquals(messagevar_args) function(...[*]) : void
Returns a function that will assert that its arguments are equal to the arguments given to asyncAssertEquals. In addition, the function also asserts that it will be called.
Arguments:
message : string
A message to print if the arguments are wrong.
var_args : ...*
The arguments to assert.
Returns: function(...[*]) : void  The mock callback.
code »
createCallbackMock(namecallbackopt_selfObj) !Function
Returns a function that will assert that it will be called, and run the given callback when it is.
Arguments:
name : string
The name of the callback mock.
callback : function(...[*]) : *
The wrapped callback. This will be called when the returned function is called.
opt_selfObj : Object=
The object which this should point to when the callback is run.
Returns: !Function  The mock callback.
code »

Instance Properties

mockControl_ : goog.testing.MockControl
The parent MockControl.
Code »

Package testing.async

Package Reference