mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-28 21:05:43 +08:00
fix($sce): use msie instead of $document[0].documentMode
this is important so that people can mock $window without having to add stuff that angular uses internally into it Closes #9661
This commit is contained in:
@@ -27,11 +27,20 @@ describe('SCE', function() {
|
||||
});
|
||||
|
||||
describe('IE<11 quirks mode', function() {
|
||||
/* global msie: true */
|
||||
var msieBackup;
|
||||
|
||||
beforeEach(function() {
|
||||
msieBackup = msie;
|
||||
});
|
||||
|
||||
afterEach(function() {
|
||||
msie = msieBackup;
|
||||
});
|
||||
|
||||
function runTest(enabled, documentMode, expectException) {
|
||||
msie = documentMode;
|
||||
module(function($provide) {
|
||||
$provide.value('$document', [{
|
||||
documentMode: documentMode
|
||||
}]);
|
||||
$provide.value('$sceDelegate', {trustAs: null, valueOf: null, getTrusted: null});
|
||||
});
|
||||
|
||||
|
||||
@@ -4,4 +4,9 @@ describe('$window', function() {
|
||||
it("should inject $window", inject(function($window) {
|
||||
expect($window).toBe(window);
|
||||
}));
|
||||
|
||||
it('should be able to mock $window without errors', function() {
|
||||
module({$window: {}});
|
||||
inject(['$sce', angular.noop]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user