From 1c5685d68f1b73270fb814fe04cbb490eb90ba5f Mon Sep 17 00:00:00 2001 From: mensonge Date: Fri, 14 Nov 2008 15:39:19 +0000 Subject: Minor fix: Remove DOJO library (60Mo) replaced by link to Google CDN (online DOJO library) git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@159 b3834d28-1941-0410-a4f8-b48e95affb8f --- includes/js/dojo/tests/DeferredList.js | 206 --------------------------------- 1 file changed, 206 deletions(-) delete mode 100644 includes/js/dojo/tests/DeferredList.js (limited to 'includes/js/dojo/tests/DeferredList.js') diff --git a/includes/js/dojo/tests/DeferredList.js b/includes/js/dojo/tests/DeferredList.js deleted file mode 100644 index 9353bfa..0000000 --- a/includes/js/dojo/tests/DeferredList.js +++ /dev/null @@ -1,206 +0,0 @@ -if(!dojo._hasResource["tests.DeferredList"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests.DeferredList"] = true; -dojo.provide("tests.DeferredList"); - -dojo.require("dojo.DeferredList"); - -doh.register("tests.DeferredList", - [ - function callback(t){ - var d1 = new dojo.Deferred(); - var d2 = new dojo.Deferred(); - var dl = new dojo.DeferredList([d1, d2]); - var fired = false; - - dl.addCallback(function(res){ - doh.debug("debug from dojo.DeferredList callback"); - return res; - }); - dl.addCallback(function(res){ - console.log("res: ", res, res.length); - t.assertTrue(res.length == 2); - t.assertTrue(res[0][0]); - t.assertEqual(res[0][1], "foo"); - t.assertTrue(res[1][0]); - t.assertEqual(res[1][1], "bar"); - fired = true; - return res; - }); - d1.callback("foo"); - d2.callback("bar"); - t.assertTrue(fired); - }, - - function errback(t){ - var d1 = new dojo.Deferred(); - var d2 = new dojo.Deferred(); - var dl = new dojo.DeferredList([d1, d2]); - var fired = false; - var e1 = new Error("foo"); - var e2 = new Error("bar"); - - dl.addCallback(function(res){ - doh.debug("debug from dojo.DeferredList callback"); - return res; - }); - dl.addCallback(function(res){ - t.assertTrue(res.length == 2); - t.assertTrue(!res[0][0]); - - t.assertEqual(res[0][1], e1); - t.assertTrue(!res[1][0]); - t.assertEqual(res[1][1], e2); - fired = true; - return res; - }); - d1.errback(e1); - d2.errback(e2); - t.assertTrue(fired); - }, - - - function mixed(t){ - var d1 = new dojo.Deferred(); - var d2 = new dojo.Deferred(); - var dl = new dojo.DeferredList([d1, d2]); - var fired = false; - var e = new Error("foo"); - - dl.addCallback(function(res){ - doh.debug("debug from dojo.DeferredList callback"); - return res; - }); - dl.addCallback(function(res){ - t.assertTrue(res.length == 2); - t.assertTrue(!res[0][0]); - - t.assertEqual(res[0][1], e); - t.assertTrue(res[1][0]); - t.assertEqual(res[1][1], "bar"); - fired = true; - return res; - }); - d1.errback(e); - d2.callback("bar"); - t.assertTrue(fired); - }, - - function gather(t){ - var d1 = new dojo.Deferred(); - var d2 = new dojo.Deferred(); - var dl = dojo.DeferredList.prototype.gatherResults([d1, d2]); - var fired = false; - dl.addCallback(function(res){ - t.assertEqual(res[0], "foo"); - t.assertEqual(res[1], "bar"); - fired = true; - return res; - }); - d1.callback("foo"); - d2.callback("bar"); - t.assertTrue(fired); - } - ] -); -dojo.provide("tests.DeferredList"); - -dojo.require("dojo.DeferredList"); - -doh.register("tests.DeferredList", - [ - function callback(t){ - var d1 = new dojo.Deferred(); - var d2 = new dojo.Deferred(); - var dl = new dojo.DeferredList([d1, d2]); - var fired = false; - dl.addCallback(function(res){ - doh.debug("debug from dojo.DeferredList callback"); - return res; - }); - dl.addCallback(function(res){ - t.assertTrue(res.length == 2); - t.assertTrue(res[0][0]); - t.assertEqual(res[0][1], "foo"); - t.assertTrue(res[1][0]); - t.assertEqual(res[1][1], "bar"); - fired = true; - return res; - }); - d1.callback("foo"); - d2.callback("bar"); - t.assertTrue(fired); - }, - - function errback(t){ - var d1 = new dojo.Deferred(); - var d2 = new dojo.Deferred(); - var dl = new dojo.DeferredList([d1, d2]); - var fired = false; - var e1 = new Error("foo"); - var e2 = new Error("bar"); - - dl.addCallback(function(res){ - doh.debug("debug from dojo.DeferredList callback"); - return res; - }); - dl.addCallback(function(res){ - t.assertTrue(res.length == 2); - t.assertTrue(!res[0][0]); - - t.assertEqual(res[0][1], e1); - t.assertTrue(!res[1][0]); - t.assertEqual(res[1][1], e2); - fired = true; - return res; - }); - d1.errback(e1); - d2.errback(e2); - t.assertTrue(fired); - }, - - - function mixed(t){ - var d1 = new dojo.Deferred(); - var d2 = new dojo.Deferred(); - var dl = new dojo.DeferredList([d1, d2]); - var fired = false; - var e = new Error("foo"); - - dl.addCallback(function(res){ - doh.debug("debug from dojo.DeferredList callback"); - return res; - }); - dl.addCallback(function(res){ - t.assertTrue(res.length == 2); - t.assertTrue(!res[0][0]); - - t.assertEqual(res[0][1], e); - t.assertTrue(res[1][0]); - t.assertEqual(res[1][1], "bar"); - fired = true; - return res; - }); - d1.errback(e); - d2.callback("bar"); - t.assertTrue(fired); - }, - - function gather(t){ - var d1 = new dojo.Deferred(); - var d2 = new dojo.Deferred(); - var dl = dojo.DeferredList.prototype.gatherResults([d1, d2]); - var fired = false; - dl.addCallback(function(res){ - t.assertEqual(res[0], "foo"); - t.assertEqual(res[1], "bar"); - fired = true; - return res; - }); - d1.callback("foo"); - d2.callback("bar"); - t.assertTrue(fired); - } - ] -); - -} -- cgit v1.2.3