From fb9bb2a1fea9cecfcdade8b9a39ce77c51a9fb96 Mon Sep 17 00:00:00 2001 From: rwldrn Date: Wed, 16 Feb 2011 15:43:30 -0500 Subject: [PATCH] [#347] Adds a test for remote JSONP with different callback labels --- test/popcorn.unit.js | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) 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(); -- 2.43.0