From e9b57f9df8eb4aaa2c1657d303c78dc68828091b Mon Sep 17 00:00:00 2001 From: Vojta Jina Date: Wed, 10 Aug 2011 16:03:26 +0200 Subject: fix($browser.xhr): respond with internal -2 status on jsonp error If jsonp is not successfull, we return internal status -2. This internal status should by normalized by $xhr into 0, but $xhr needs to distinguish between jsonp-error/abort/timeout (all status 0). --- test/service/browserSpecs.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/service/browserSpecs.js b/test/service/browserSpecs.js index 41f17f2a..a3ec6486 100644 --- a/test/service/browserSpecs.js +++ b/test/service/browserSpecs.js @@ -147,14 +147,14 @@ describe('browser', function() { }); - it('should call callback when script fails to load', function() { + it('should call callback with status -2 when script fails to load', function() { browser.xhr('JSONP', 'http://example.org/path?cb=JSON_CALLBACK', null, callback); var script = scripts[0]; expect(typeof script.onload).toBe('function'); expect(typeof script.onerror).toBe('function'); script.onerror(); - expect(log).toEqual('undefined:undefined;'); + expect(log).toEqual('-2:undefined;'); }); -- cgit v1.2.3