@@ -12411,9 +12411,9 @@ describe('$compile', function() {
12411
12411
element = $compile('<img ng-prop-src="testUrl"></img>')($rootScope);
12412
12412
// Some browsers complain if you try to write `javascript:` into an `img[src]`
12413
12413
// So for the test use something different
12414
- $rootScope . testUrl = $sce . trustAsMediaUrl ( 'someUntrustedThing :foo();' ) ;
12414
+ $rootScope.testUrl = $sce.trustAsMediaUrl('someuntrustedthing :foo();');
12415
12415
$rootScope.$digest();
12416
- expect ( element . prop ( 'src' ) ) . toEqual ( 'someUntrustedThing :foo();' ) ;
12416
+ expect(element.prop('src')).toEqual('someuntrustedthing :foo();');
12417
12417
}));
12418
12418
12419
12419
it('should sanitize concatenated values even if they are trusted', inject(function($rootScope, $compile, $sce) {
@@ -12456,7 +12456,6 @@ describe('$compile', function() {
12456
12456
});
12457
12457
});
12458
12458
12459
-
12460
12459
it('should use $$sanitizeUri on concatenated trusted values', function() {
12461
12460
var $$sanitizeUri = jasmine.createSpy('$$sanitizeUri').and.returnValue('someSanitizedUrl');
12462
12461
module(function($provide) {
@@ -12494,6 +12493,13 @@ describe('$compile', function() {
12494
12493
describe('img[srcset] sanitization', function() {
12495
12494
it('should not error if srcset is undefined', inject(function($compile, $rootScope) {
12496
12495
element = $compile('<img ng-prop-srcset="testUrl"></img>')($rootScope);
12496
+ // Set srcset to a value
12497
+ $rootScope.testUrl = 'http://example.com/';
12498
+ $rootScope.$digest();
12499
+ expect(element.prop('srcset')).toBe('http://example.com/');
12500
+
12501
+ // Now set it to undefined
12502
+ $rootScope.testUrl = '';
12497
12503
$rootScope.$digest();
12498
12504
expect(element.prop('srcset')).toBe('');
12499
12505
}));
@@ -12631,7 +12637,7 @@ describe('$compile', function() {
12631
12637
expect(element.prop('href')).toBe('javascript:doEvilStuff()');
12632
12638
}));
12633
12639
12634
- it ( 'should not sanitize properties' , inject ( function ( $compile , $rootScope ) {
12640
+ it('should not sanitize properties other then those configured ', inject(function($compile, $rootScope) {
12635
12641
element = $compile('<a ng-prop-title="testUrl"></a>')($rootScope);
12636
12642
$rootScope.testUrl = 'javascript:doEvilStuff()';
12637
12643
$rootScope.$apply();
0 commit comments