diff options
Diffstat (limited to 'src/ngScenario/Application.js')
| -rw-r--r-- | src/ngScenario/Application.js | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/src/ngScenario/Application.js b/src/ngScenario/Application.js index 2ca6c8fd..f7ce28cb 100644 --- a/src/ngScenario/Application.js +++ b/src/ngScenario/Application.js @@ -49,7 +49,7 @@ angular.scenario.Application.prototype.getWindow_ = function() { */ angular.scenario.Application.prototype.navigateTo = function(url, loadFn, errorFn) { var self = this; - var frame = this.getFrame_(); + var frame = self.getFrame_(); //TODO(esprehn): Refactor to use rethrow() errorFn = errorFn || function(e) { throw e; }; if (url === 'about:blank') { @@ -57,21 +57,39 @@ angular.scenario.Application.prototype.navigateTo = function(url, loadFn, errorF } else if (url.charAt(0) === '#') { url = frame.attr('src').split('#')[0] + url; frame.attr('src', url); - this.executeAction(loadFn); + self.executeAction(loadFn); } else { frame.remove(); - this.context.find('#test-frames').append('<iframe>'); - frame = this.getFrame_(); + self.context.find('#test-frames').append('<iframe>'); + frame = self.getFrame_(); + + frame[0].contentWindow.name = "NG_DEFER_BOOTSTRAP!"; + frame.load(function() { frame.unbind(); try { + var $window = self.getWindow_(); + + if ($window.angular) { + // Disable animations + + // TODO(i): this doesn't disable javascript animations + // we don't need that for our tests, but it should be done + $window.angular.resumeBootstrap([['$provide', function($provide) { + $provide.decorator('$sniffer', function($delegate) { + $delegate.supportsTransitions = false; + return $delegate; + }); + }]]); + } + self.executeAction(loadFn); } catch (e) { errorFn(e); } }).attr('src', url); } - this.context.find('> h2 a').attr('href', url).text(url); + self.context.find('> h2 a').attr('href', url).text(url); }; /** |
