@@ -1044,27 +1044,25 @@ describe('$http', function() {
1044
1044
describe ( 'jsonp trust' , function ( ) {
1045
1045
it ( 'should throw error if the url is not a trusted resource' , function ( ) {
1046
1046
var success , error ;
1047
- $http ( { method : 'JSONP' , url : 'http://example.org/path?cb=JSON_CALLBACK' , callback : callback } ) . catch (
1047
+ $http ( { method : 'JSONP' , url : 'http://example.org/path?cb=JSON_CALLBACK' } ) . catch (
1048
1048
function ( e ) { error = e ; }
1049
1049
) ;
1050
1050
$rootScope . $digest ( ) ;
1051
1051
expect ( error . message ) . toContain ( '[$sce:insecurl]' ) ;
1052
1052
} ) ;
1053
1053
1054
- it ( 'should not throw error if the url is an explicitly trusted resource' , function ( ) {
1055
- expect ( function ( ) {
1056
- $httpBackend . expect ( 'JSONP' , 'http://example.org/path?cb=JSON_CALLBACK' ) . respond ( '' ) ;
1057
- $http ( { method : 'JSONP' , url : $sce . trustAsResourceUrl ( 'http://example.org/path?cb=JSON_CALLBACK' ) , callback : callback } ) ;
1058
- } ) . not . toThrow ( ) ;
1054
+ it ( 'should accept an explicitly trusted resource url' , function ( ) {
1055
+ $httpBackend . expect ( 'JSONP' , 'http://example.org/path?cb=JSON_CALLBACK' ) . respond ( '' ) ;
1056
+ $http ( { method : 'JSONP' , url : $sce . trustAsResourceUrl ( 'http://example.org/path?cb=JSON_CALLBACK' ) } ) ;
1059
1057
} ) ;
1060
1058
1061
- it ( 'jsonp() should accept explictly trusted urls' , inject ( [ '$sce' , function ( $sce ) {
1059
+ it ( 'jsonp() should accept explictly trusted urls' , function ( ) {
1062
1060
$httpBackend . expect ( 'JSONP' , '/url' ) . respond ( '' ) ;
1063
1061
$http ( { method : 'JSONP' , url : $sce . trustAsResourceUrl ( '/url' ) } ) ;
1064
1062
1065
1063
$httpBackend . expect ( 'JSONP' , '/url?a=b' ) . respond ( '' ) ;
1066
1064
$http ( { method : 'JSONP' , url : $sce . trustAsResourceUrl ( '/url' ) , params : { a : 'b' } } ) ;
1067
- } ] ) ) ;
1065
+ } ) ;
1068
1066
} ) ;
1069
1067
1070
1068
describe ( 'callbacks' , function ( ) {
0 commit comments