Module: alfresco/testing/MockXhr

alfresco/testing/MockXhr

This can be extended for creating widgets that provide Mock XHR responses. It is provided for use
in testing and will replace the standard browser XMLHttpRequest rendering all standard XHR requests
impossible when included on a page.

Returns:

constructor()

loadBinaryData()

This is an extension point function intended to be overridden by extending mock xhr services.
The extension should load binary data before the XMLHttpRequest object is overridden by Sinon
and the data loading call backs should call the waitForServer
function which will in turn call setupServerWithBinaryData
when the fake Sinon server is ready for configuring.

setupServerWithBinaryData()

This is an extension point function intended to be overridden by extending mock xhr services. It
is called from waitForServer and indicates that
both the binary data and the fake Sinon server are ready to use.