|
|
@@ -1112,7 +1112,7 @@ angular.mock.dump = function(object) { |
|
|
``` |
|
|
*/ |
|
|
angular.mock.$HttpBackendProvider = function() { |
|
|
this.$get = ['$rootScope', createHttpBackendMock]; |
|
|
this.$get = ['$rootScope', '$timeout', createHttpBackendMock]; |
|
|
}; |
|
|
|
|
|
/** |
|
|
@@ -1129,7 +1129,7 @@ angular.mock.$HttpBackendProvider = function() { |
|
|
* @param {Object=} $browser Auto-flushing enabled if specified |
|
|
* @return {Object} Instance of $httpBackend mock |
|
|
*/ |
|
|
function createHttpBackendMock($rootScope, $delegate, $browser) { |
|
|
function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) { |
|
|
var definitions = [], |
|
|
expectations = [], |
|
|
responses = [], |
|
|
@@ -1159,7 +1159,9 @@ function createHttpBackendMock($rootScope, $delegate, $browser) { |
|
|
} |
|
|
|
|
|
function wrapResponse(wrapped) { |
|
|
if (!$browser && timeout && timeout.then) timeout.then(handleTimeout); |
|
|
if (!$browser && timeout) { |
|
|
timeout.then ? timeout.then(handleTimeout) : $timeout(handleTimeout, timeout); |
|
|
} |
|
|
|
|
|
return handleResponse; |
|
|
|
|
|
@@ -2033,7 +2035,7 @@ angular.module('ngMockE2E', ['ng']).config(['$provide', function($provide) { |
|
|
*/ |
|
|
angular.mock.e2e = {}; |
|
|
angular.mock.e2e.$httpBackendDecorator = |
|
|
['$rootScope', '$delegate', '$browser', createHttpBackendMock]; |
|
|
['$rootScope', '$timeout', '$delegate', '$browser', createHttpBackendMock]; |
|
|
|
|
|
|
|
|
/** |
|
|
|