From: rwldrn Date: Wed, 16 Feb 2011 20:43:30 +0000 (-0500) Subject: [#347] Adds a test for remote JSONP with different callback labels X-Git-Tag: v0.4~34^2~8 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=fb9bb2a1fea9cecfcdade8b9a39ce77c51a9fb96;p=popcorn-js.git [#347] Adds a test for remote JSONP with different callback labels --- diff --git a/test/popcorn.unit.js b/test/popcorn.unit.js index c1660c1..e5cd865 100644 --- a/test/popcorn.unit.js +++ b/test/popcorn.unit.js @@ -1206,7 +1206,7 @@ test("dataType: JSON Response", function () { test("JSONP Response", function () { - var expects = 6, + var expects = 8, count = 0; function plus() { @@ -1228,7 +1228,7 @@ test("JSONP Response", function () { dataType: 'jsonp', success: function( data ) { - ok(data, "xhr returns data"); + ok(data, "getJSONP returns data"); plus(); @@ -1243,7 +1243,7 @@ test("JSONP Response", function () { function( data ) { - ok(data, "xhr returns data"); + ok(data, "getJSONP returns data"); plus(); @@ -1253,14 +1253,30 @@ test("JSONP Response", function () { } ); - + + Popcorn.xhr.getJSONP( + "http://api.flickr.com/services/feeds/photos_public.gne?id=35034346917@N01&lang=en-us&format=json&jsoncallback=flickr", + + function( data ) { + + + + ok(data, "getJSONP returns flickr data"); + plus(); + + equal( typeof data, "object", "getJSONP returns flickr data"); + plus(); + + + } + ); Popcorn.xhr.getJSONP( 'data/jsonp.json', function( data ) { - ok(data, "xhr returns data"); + ok(data, "getJSONP returns data"); plus();