* - passing through is disabled
* - auto flushing is disabled
*
- * Returns instance for e2e testing (when `$delegate` and `$defer` specified):
+ * Returns instance for e2e testing (when `$delegate` and `$browser` specified):
* - passing through (delegating request to real backend) is enabled
* - auto flushing is enabled
*
* @param {Object=} $delegate Real $httpBackend instance (allow passing through if specified)
- * @param {Object=} $defer Auto-flushing enabled if specified
+ * @param {Object=} $browser Auto-flushing enabled if specified
* @return {Object} Instance of $httpBackend mock
*/
-function createHttpBackendMock($delegate, $defer) {
+function createHttpBackendMock($delegate, $browser) {
var definitions = [],
expectations = [],
responses = [],
while ((definition = definitions[++i])) {
if (definition.match(method, url, data, headers || {})) {
if (definition.response) {
- // if $defer specified, we do auto flush all requests
- ($defer ? $defer : responsesPush)(function() {
+ // if $browser specified, we do auto flush all requests
+ ($browser ? $browser.defer : responsesPush)(function() {
var response = definition.response(method, url, data, headers);
xhr.$$respHeaders = response[2];
callback(response[0], response[1], xhr.getAllResponseHeaders());
}
};
- if ($defer) {
+ if ($browser) {
chain.passThrough = function() {
definition.passThrough = true;
};
* control how a matched request is handled.
*/
angular.mock.e2e = {};
-angular.mock.e2e.$httpBackendDecorator = ['$delegate', '$defer', createHttpBackendMock];
+angular.mock.e2e.$httpBackendDecorator = ['$delegate', '$browser', createHttpBackendMock];
* @name angular.mock.module
* @description
*
- * *NOTE*: This is function is also published on window for easy access.
+ * *NOTE*: This is function is also published on window for easy access.<br>
* *NOTE*: Only available with {@link http://pivotal.github.com/jasmine/ jasmine}.
*
* This function registers a module configuration code. It collects the configuration information
* @name angular.mock.inject
* @description
*
- * *NOTE*: This is function is also published on window for easy access.
+ * *NOTE*: This is function is also published on window for easy access.<br>
* *NOTE*: Only available with {@link http://pivotal.github.com/jasmine/ jasmine}.
*
* The inject function wraps a function into an injectable function. The inject() creates new