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