summaryrefslogtreecommitdiff
path: root/includes/js/dojo/tests/_base/Deferred.js
diff options
context:
space:
mode:
Diffstat (limited to 'includes/js/dojo/tests/_base/Deferred.js')
-rw-r--r--includes/js/dojo/tests/_base/Deferred.js76
1 files changed, 0 insertions, 76 deletions
diff --git a/includes/js/dojo/tests/_base/Deferred.js b/includes/js/dojo/tests/_base/Deferred.js
deleted file mode 100644
index 5dcf003..0000000
--- a/includes/js/dojo/tests/_base/Deferred.js
+++ /dev/null
@@ -1,76 +0,0 @@
-if(!dojo._hasResource["tests._base.Deferred"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
-dojo._hasResource["tests._base.Deferred"] = true;
-dojo.provide("tests._base.Deferred");
-
-doh.register("tests._base.Deferred",
- [
-
- function callback(t){
- var nd = new dojo.Deferred();
- var cnt = 0;
- nd.addCallback(function(res){
- doh.debug("debug from dojo.Deferred callback");
- return res;
- });
- nd.addCallback(function(res){
- // t.debug("val:", res);
- cnt+=res;
- return cnt;
- });
- nd.callback(5);
- // t.debug("cnt:", cnt);
- t.assertEqual(cnt, 5);
- },
-
- function callback_extra_args(t){
- var nd = new dojo.Deferred();
- var cnt = 0;
- nd.addCallback(dojo.global, function(base, res){ cnt+=base; cnt+=res; return cnt; }, 30);
- nd.callback(5);
- t.assertEqual(cnt, 35);
- },
-
- function errback(t){
- var nd = new dojo.Deferred();
- var cnt = 0;
- nd.addErrback(function(val){
- return ++cnt;
- });
- nd.errback();
- t.assertEqual(cnt, 1);
- },
-
- function callbackTwice(t){
- var nd = new dojo.Deferred();
- var cnt = 0;
- nd.addCallback(function(res){
- return ++cnt;
- });
- nd.callback();
- t.assertEqual(cnt, 1);
- var thrown = false;
- try{
- nd.callback();
- }catch(e){
- thrown = true;
- }
- t.assertTrue(thrown);
- },
-
- function addBoth(t){
- var nd = new dojo.Deferred();
- var cnt = 0;
- nd.addBoth(function(res){
- return ++cnt;
- });
- nd.callback();
- t.assertEqual(cnt, 1);
-
- // nd.callback();
- // t.debug(cnt);
- // t.assertEqual(cnt, 1);
- }
- ]
-);
-
-}