@@ -10151,25 +10151,28 @@ describe('$compile', function() {
10151
10151
expect ( element . attr ( 'src' ) ) . toEqual ( 'http://example.com/image2.png' ) ;
10152
10152
} ) ) ;
10153
10153
10154
- // Older IEs seem to reject the video tag with "Error: Not implemented"
10154
+ // IE9 rejects the video / audio tag with "Error: Not implemented" and the source tag with
10155
+ // "Unable to get value of the property 'childNodes': object is null or undefined"
10155
10156
if ( ! msie || msie > 9 ) {
10156
- it ( 'should NOT require trusted values for video src' ,
10157
- inject ( function ( $rootScope , $compile , $sce ) {
10158
- element = $compile ( '<video src="{{testUrl}}"></video>' ) ( $rootScope ) ;
10159
- $rootScope . testUrl = 'http://example.com/image.mp4' ;
10160
- $rootScope . $digest ( ) ;
10161
- expect ( element . attr ( 'src' ) ) . toEqual ( 'http://example.com/image.mp4' ) ;
10157
+ they ( 'should NOT require trusted values for $prop src' , [ 'video' , 'audio' , 'source' ] ,
10158
+ function ( tag ) {
10159
+ inject ( function ( $rootScope , $compile , $sce ) {
10160
+ element = $compile ( '<' + tag + ' src="{{testUrl}}"></' + tag + '>' ) ( $rootScope ) ;
10161
+ $rootScope . testUrl = 'http://example.com/image.mp4' ;
10162
+ $rootScope . $digest ( ) ;
10163
+ expect ( element . attr ( 'src' ) ) . toEqual ( 'http://example.com/image.mp4' ) ;
10162
10164
10163
- // But it should accept trusted values anyway.
10164
- $rootScope . testUrl = $sce . trustAsUrl ( 'http://example.com/image2.mp4' ) ;
10165
- $rootScope . $digest ( ) ;
10166
- expect ( element . attr ( 'src' ) ) . toEqual ( 'http://example.com/image2.mp4' ) ;
10165
+ // But it should accept trusted values anyway.
10166
+ $rootScope . testUrl = $sce . trustAsUrl ( 'http://example.com/image2.mp4' ) ;
10167
+ $rootScope . $digest ( ) ;
10168
+ expect ( element . attr ( 'src' ) ) . toEqual ( 'http://example.com/image2.mp4' ) ;
10167
10169
10168
- // and trustedResourceUrls for retrocompatibility
10169
- $rootScope . testUrl = $sce . trustAsResourceUrl ( 'http://example.com/image3.mp4' ) ;
10170
- $rootScope . $digest ( ) ;
10171
- expect ( element . attr ( 'src' ) ) . toEqual ( 'http://example.com/image3.mp4' ) ;
10172
- } ) ) ;
10170
+ // and trustedResourceUrls for retrocompatibility
10171
+ $rootScope . testUrl = $sce . trustAsResourceUrl ( 'http://example.com/image3.mp4' ) ;
10172
+ $rootScope . $digest ( ) ;
10173
+ expect ( element . attr ( 'src' ) ) . toEqual ( 'http://example.com/image3.mp4' ) ;
10174
+ } ) ;
10175
+ } ) ;
10173
10176
}
10174
10177
} ) ;
10175
10178
0 commit comments