diff options
| author | Igor Minar | 2012-04-12 02:15:36 -0700 | 
|---|---|---|
| committer | Igor Minar | 2012-04-12 02:36:03 -0700 | 
| commit | df72852f3496d7640bb4f70837338e464b7ed69f (patch) | |
| tree | 29ec837b702e97938d3ea2d8a225dbb54a93b003 /src/ngScenario | |
| parent | c4f6ccb0658cb723c6e9704cf7fcf1bc72b2ae99 (diff) | |
| download | angular.js-df72852f3496d7640bb4f70837338e464b7ed69f.tar.bz2 | |
fix(e2eRunner): $browser.location should delegate to apps $location
previously it would create a new instance which wasn't configured as the one in the app,
which resulted in incorrect values being returned in html5 mode with base url set
Diffstat (limited to 'src/ngScenario')
| -rw-r--r-- | src/ngScenario/Application.js | 3 | ||||
| -rw-r--r-- | src/ngScenario/dsl.js | 8 | 
2 files changed, 5 insertions, 6 deletions
diff --git a/src/ngScenario/Application.js b/src/ngScenario/Application.js index d3a70569..1fdf3eb8 100644 --- a/src/ngScenario/Application.js +++ b/src/ngScenario/Application.js @@ -91,8 +91,7 @@ angular.scenario.Application.prototype.executeAction = function(action) {      return action.call(this, $window, _jQuery($window.document));    }    angularInit($window.document, function(element) { -    element = $window.angular.element(element); -    var $injector = element.inheritedData('$injector'); +    var $injector = $window.angular.element(element).injector();      $injector.invoke(function($browser){        $browser.notifyWhenNoOutstandingRequests(function() {          action.call(self, $window, _jQuery($window.document)); diff --git a/src/ngScenario/dsl.js b/src/ngScenario/dsl.js index 7ca33a26..6f3a3c73 100644 --- a/src/ngScenario/dsl.js +++ b/src/ngScenario/dsl.js @@ -103,25 +103,25 @@ angular.scenario.dsl('browser', function() {      api.url = function() {        return this.addFutureAction('$location.url()', function($window, $document, done) { -        done(null, $window.angular.injector(['ng']).get('$location').url()); +        done(null, $window.angular.element($window.document).injector().get('$location').url());        });      };      api.path = function() {        return this.addFutureAction('$location.path()', function($window, $document, done) { -        done(null, $window.angular.injector(['ng']).get('$location').path()); +        done(null, $window.angular.element($window.document).injector().get('$location').path());        });      };      api.search = function() {        return this.addFutureAction('$location.search()', function($window, $document, done) { -        done(null, $window.angular.injector(['ng']).get('$location').search()); +        done(null, $window.angular.element($window.document).injector().get('$location').search());        });      };      api.hash = function() {        return this.addFutureAction('$location.hash()', function($window, $document, done) { -        done(null, $window.angular.injector(['ng']).get('$location').hash()); +        done(null, $window.angular.element($window.document).injector().get('$location').hash());        });      };  | 
