fix($browser): handle async href on url change in <=IE9

Closes #9235
This commit is contained in:
Chris Chua
2014-09-23 18:00:37 -07:00
committed by Brian Ford
parent 029ac8cb80
commit fe7d9dedaa
2 changed files with 28 additions and 1 deletions

View File

@@ -641,6 +641,29 @@ describe('browser', function() {
expect($location.path()).toBe('/someTestHash');
});
});
});
describe('integration test with $rootScope', function() {
beforeEach(module(function($provide, $locationProvider) {
$provide.value('$browser', browser);
browser.pollFns = [];
}));
it('should not interfere with legacy browser url replace behavior', function() {
inject(function($rootScope) {
var current = fakeWindow.location.href;
var newUrl = 'notyet';
sniffer.history = false;
browser.url(newUrl, true);
expect(browser.url()).toBe(newUrl);
$rootScope.$digest();
expect(browser.url()).toBe(newUrl);
expect(fakeWindow.location.href).toBe(current);
});
});
});
});