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/AdapterRegistry.js | 75 - includes/js/dojo/tests/DeferredList.js | 206 -- includes/js/dojo/tests/NodeList-fx.html | 150 -- includes/js/dojo/tests/TODO | 11 - includes/js/dojo/tests/_base.js | 136 -- includes/js/dojo/tests/_base/Color.js | 32 - includes/js/dojo/tests/_base/Deferred.js | 76 - includes/js/dojo/tests/_base/NodeList.html | 370 ---- .../js/dojo/tests/_base/_loader/addLoadEvents.html | 37 - .../js/dojo/tests/_base/_loader/afterOnLoad.html | 56 - includes/js/dojo/tests/_base/_loader/bootstrap.js | 86 - includes/js/dojo/tests/_base/_loader/getText.txt | 1 - .../js/dojo/tests/_base/_loader/hostenv_browser.js | 15 - .../js/dojo/tests/_base/_loader/hostenv_rhino.js | 17 - .../tests/_base/_loader/hostenv_spidermonkey.js | 15 - includes/js/dojo/tests/_base/_loader/loader.js | 52 - .../js/dojo/tests/_base/_loader/scope/scope04.html | 80 - .../tests/_base/_loader/scope/scopeContained.html | 71 - .../_base/_loader/scope/scopeContainedXd.html | 84 - .../tests/_base/_loader/scope/scopeDjConfig.html | 64 - .../tests/_base/_loader/scope/scopeSingle.html | 62 - .../tests/_base/_loader/scope/scopeSingleDaac.html | 63 - includes/js/dojo/tests/_base/array.js | 301 --- includes/js/dojo/tests/_base/connect.js | 225 -- includes/js/dojo/tests/_base/declare.js | 197 -- includes/js/dojo/tests/_base/fx.html | 342 --- includes/js/dojo/tests/_base/fx.js | 8 - includes/js/dojo/tests/_base/fx_delay.html | 22 - includes/js/dojo/tests/_base/html.html | 556 ----- includes/js/dojo/tests/_base/html.js | 12 - includes/js/dojo/tests/_base/html_box.html | 207 -- includes/js/dojo/tests/_base/html_box_quirks.html | 205 -- includes/js/dojo/tests/_base/html_quirks.html | 322 --- includes/js/dojo/tests/_base/html_rtl.html | 110 - includes/js/dojo/tests/_base/json.js | 37 - includes/js/dojo/tests/_base/lang.js | 180 -- includes/js/dojo/tests/_base/query.html | 154 -- includes/js/dojo/tests/_base/query.js | 9 - includes/js/dojo/tests/_base/timeout.php | 7 - includes/js/dojo/tests/_base/xhr.html | 404 ---- includes/js/dojo/tests/_base/xhr.js | 8 - includes/js/dojo/tests/_base/xhrDummyMethod.php | 7 - includes/js/dojo/tests/back-hash.js | 33 - includes/js/dojo/tests/back.html | 107 - includes/js/dojo/tests/back.js | 8 - includes/js/dojo/tests/behavior.html | 106 - includes/js/dojo/tests/behavior.js | 8 - includes/js/dojo/tests/cldr.js | 19 - includes/js/dojo/tests/colors.js | 48 - includes/js/dojo/tests/cookie.html | 84 - includes/js/dojo/tests/cookie.js | 8 - includes/js/dojo/tests/currency.js | 48 - includes/js/dojo/tests/data.js | 12 - includes/js/dojo/tests/data/ItemFileReadStore.js | 10 - includes/js/dojo/tests/data/ItemFileWriteStore.js | 1402 ------------ includes/js/dojo/tests/data/countries.json | 11 - .../dojo/tests/data/countries_commentFiltered.json | 12 - .../js/dojo/tests/data/countries_idcollision.json | 10 - .../js/dojo/tests/data/countries_references.json | 44 - .../js/dojo/tests/data/countries_withBoolean.json | 11 - .../js/dojo/tests/data/countries_withDates.json | 21 - .../js/dojo/tests/data/countries_withNull.json | 10 - .../js/dojo/tests/data/countries_withoutid.json | 10 - includes/js/dojo/tests/data/data_multitype.json | 18 - .../dojo/tests/data/geography_hierarchy_large.json | 44 - .../dojo/tests/data/geography_hierarchy_small.json | 19 - .../tests/data/readOnlyItemFileTestTemplates.js | 2260 -------------------- .../js/dojo/tests/data/reference_integrity.json | 27 - includes/js/dojo/tests/data/runTests.html | 9 - includes/js/dojo/tests/data/utils.js | 203 -- includes/js/dojo/tests/date.js | 716 ------- includes/js/dojo/tests/date/locale.js | 398 ---- includes/js/dojo/tests/date/stamp.js | 94 - includes/js/dojo/tests/dnd/dndDefault.css | 52 - .../js/dojo/tests/dnd/dndDefault.css.commented.css | 69 - includes/js/dojo/tests/dnd/flickr_viewer.html | 168 -- .../js/dojo/tests/dnd/test_box_constraints.html | 61 - includes/js/dojo/tests/dnd/test_container.html | 74 - .../js/dojo/tests/dnd/test_container_markup.html | 67 - .../js/dojo/tests/dnd/test_custom_constraints.html | 51 - includes/js/dojo/tests/dnd/test_dnd.html | 130 -- includes/js/dojo/tests/dnd/test_dnd_handles.html | 65 - includes/js/dojo/tests/dnd/test_form.html | 103 - includes/js/dojo/tests/dnd/test_moveable.html | 106 - .../js/dojo/tests/dnd/test_moveable_markup.html | 83 - includes/js/dojo/tests/dnd/test_params.html | 61 - .../js/dojo/tests/dnd/test_parent_constraints.html | 53 - .../tests/dnd/test_parent_constraints_margins.html | 51 - includes/js/dojo/tests/dnd/test_selector.html | 80 - .../js/dojo/tests/dnd/test_selector_markup.html | 71 - .../js/dojo/tests/dnd/test_timed_moveable.html | 112 - includes/js/dojo/tests/fx.html | 310 --- includes/js/dojo/tests/fx.js | 9 - includes/js/dojo/tests/i18n.js | 88 - includes/js/dojo/tests/io/iframe.html | 124 -- includes/js/dojo/tests/io/iframe.js | 8 - includes/js/dojo/tests/io/iframeResponse.html | 8 - includes/js/dojo/tests/io/iframeResponse.js.html | 7 - includes/js/dojo/tests/io/iframeResponse.json.html | 7 - includes/js/dojo/tests/io/iframeResponse.text.html | 7 - includes/js/dojo/tests/io/iframeUploadTest.html | 50 - includes/js/dojo/tests/io/script.html | 101 - includes/js/dojo/tests/io/script.js | 8 - includes/js/dojo/tests/io/scriptJsonp.js | 57 - includes/js/dojo/tests/io/scriptSimple.js | 5 - includes/js/dojo/tests/io/scriptTimeout.html | 67 - includes/js/dojo/tests/io/upload.cgi | 60 - includes/js/dojo/tests/manualTests.html | 12 - includes/js/dojo/tests/manualTests.js | 45 - includes/js/dojo/tests/module.js | 29 - includes/js/dojo/tests/nls/ar/salutations.js | 1 - includes/js/dojo/tests/nls/cs/salutations.js | 1 - includes/js/dojo/tests/nls/de/salutations.js | 1 - includes/js/dojo/tests/nls/el/salutations.js | 1 - includes/js/dojo/tests/nls/en-au/salutations.js | 1 - .../js/dojo/tests/nls/en-us-hawaii/salutations.js | 1 - .../nls/en-us-new_york-brooklyn/salutations.js | 1 - .../js/dojo/tests/nls/en-us-texas/salutations.js | 1 - includes/js/dojo/tests/nls/es/salutations.js | 1 - includes/js/dojo/tests/nls/fa/salutations.js | 1 - includes/js/dojo/tests/nls/fr/salutations.js | 1 - includes/js/dojo/tests/nls/he/salutations.js | 1 - includes/js/dojo/tests/nls/hi/salutations.js | 1 - includes/js/dojo/tests/nls/it/salutations.js | 1 - includes/js/dojo/tests/nls/ja/salutations.js | 1 - includes/js/dojo/tests/nls/ko/salutations.js | 1 - includes/js/dojo/tests/nls/pl/salutations.js | 1 - includes/js/dojo/tests/nls/pt/salutations.js | 1 - includes/js/dojo/tests/nls/ru/salutations.js | 1 - includes/js/dojo/tests/nls/salutations.js | 1 - includes/js/dojo/tests/nls/sw/salutations.js | 1 - includes/js/dojo/tests/nls/th/salutations.js | 1 - includes/js/dojo/tests/nls/tr/salutations.js | 1 - includes/js/dojo/tests/nls/yi/salutations.js | 1 - includes/js/dojo/tests/nls/zh-cn/salutations.js | 1 - includes/js/dojo/tests/nls/zh-tw/salutations.js | 1 - includes/js/dojo/tests/number.js | 966 --------- includes/js/dojo/tests/parser.html | 241 --- includes/js/dojo/tests/parser.js | 8 - .../js/dojo/tests/resources/ApplicationState.js | 28 - includes/js/dojo/tests/resources/JSON.php | 724 ------- includes/js/dojo/tests/resources/testClass.php | 20 - includes/js/dojo/tests/resources/testClass.smd | 40 - .../dojo/tests/resources/test_JsonRPCMediator.php | 43 - includes/js/dojo/tests/resources/test_css.html | 100 - includes/js/dojo/tests/resources/yahoo_smd_v1.smd | 268 --- includes/js/dojo/tests/rpc.js | 151 -- includes/js/dojo/tests/runTests.html | 9 - includes/js/dojo/tests/string.js | 31 - includes/js/dojo/tests/test_FirebugLite.html | 100 - includes/js/dojo/tests/test_FirebugLitePopup.html | 101 - includes/js/dojo/tests/test_fx.html | 107 - 152 files changed, 16304 deletions(-) delete mode 100644 includes/js/dojo/tests/AdapterRegistry.js delete mode 100644 includes/js/dojo/tests/DeferredList.js delete mode 100644 includes/js/dojo/tests/NodeList-fx.html delete mode 100644 includes/js/dojo/tests/TODO delete mode 100644 includes/js/dojo/tests/_base.js delete mode 100644 includes/js/dojo/tests/_base/Color.js delete mode 100644 includes/js/dojo/tests/_base/Deferred.js delete mode 100644 includes/js/dojo/tests/_base/NodeList.html delete mode 100644 includes/js/dojo/tests/_base/_loader/addLoadEvents.html delete mode 100644 includes/js/dojo/tests/_base/_loader/afterOnLoad.html delete mode 100644 includes/js/dojo/tests/_base/_loader/bootstrap.js delete mode 100644 includes/js/dojo/tests/_base/_loader/getText.txt delete mode 100644 includes/js/dojo/tests/_base/_loader/hostenv_browser.js delete mode 100644 includes/js/dojo/tests/_base/_loader/hostenv_rhino.js delete mode 100644 includes/js/dojo/tests/_base/_loader/hostenv_spidermonkey.js delete mode 100644 includes/js/dojo/tests/_base/_loader/loader.js delete mode 100644 includes/js/dojo/tests/_base/_loader/scope/scope04.html delete mode 100644 includes/js/dojo/tests/_base/_loader/scope/scopeContained.html delete mode 100644 includes/js/dojo/tests/_base/_loader/scope/scopeContainedXd.html delete mode 100644 includes/js/dojo/tests/_base/_loader/scope/scopeDjConfig.html delete mode 100644 includes/js/dojo/tests/_base/_loader/scope/scopeSingle.html delete mode 100644 includes/js/dojo/tests/_base/_loader/scope/scopeSingleDaac.html delete mode 100644 includes/js/dojo/tests/_base/array.js delete mode 100644 includes/js/dojo/tests/_base/connect.js delete mode 100644 includes/js/dojo/tests/_base/declare.js delete mode 100644 includes/js/dojo/tests/_base/fx.html delete mode 100644 includes/js/dojo/tests/_base/fx.js delete mode 100644 includes/js/dojo/tests/_base/fx_delay.html delete mode 100644 includes/js/dojo/tests/_base/html.html delete mode 100644 includes/js/dojo/tests/_base/html.js delete mode 100644 includes/js/dojo/tests/_base/html_box.html delete mode 100644 includes/js/dojo/tests/_base/html_box_quirks.html delete mode 100644 includes/js/dojo/tests/_base/html_quirks.html delete mode 100644 includes/js/dojo/tests/_base/html_rtl.html delete mode 100644 includes/js/dojo/tests/_base/json.js delete mode 100644 includes/js/dojo/tests/_base/lang.js delete mode 100644 includes/js/dojo/tests/_base/query.html delete mode 100644 includes/js/dojo/tests/_base/query.js delete mode 100644 includes/js/dojo/tests/_base/timeout.php delete mode 100644 includes/js/dojo/tests/_base/xhr.html delete mode 100644 includes/js/dojo/tests/_base/xhr.js delete mode 100644 includes/js/dojo/tests/_base/xhrDummyMethod.php delete mode 100644 includes/js/dojo/tests/back-hash.js delete mode 100644 includes/js/dojo/tests/back.html delete mode 100644 includes/js/dojo/tests/back.js delete mode 100644 includes/js/dojo/tests/behavior.html delete mode 100644 includes/js/dojo/tests/behavior.js delete mode 100644 includes/js/dojo/tests/cldr.js delete mode 100644 includes/js/dojo/tests/colors.js delete mode 100644 includes/js/dojo/tests/cookie.html delete mode 100644 includes/js/dojo/tests/cookie.js delete mode 100644 includes/js/dojo/tests/currency.js delete mode 100644 includes/js/dojo/tests/data.js delete mode 100644 includes/js/dojo/tests/data/ItemFileReadStore.js delete mode 100644 includes/js/dojo/tests/data/ItemFileWriteStore.js delete mode 100644 includes/js/dojo/tests/data/countries.json delete mode 100644 includes/js/dojo/tests/data/countries_commentFiltered.json delete mode 100644 includes/js/dojo/tests/data/countries_idcollision.json delete mode 100644 includes/js/dojo/tests/data/countries_references.json delete mode 100644 includes/js/dojo/tests/data/countries_withBoolean.json delete mode 100644 includes/js/dojo/tests/data/countries_withDates.json delete mode 100644 includes/js/dojo/tests/data/countries_withNull.json delete mode 100644 includes/js/dojo/tests/data/countries_withoutid.json delete mode 100644 includes/js/dojo/tests/data/data_multitype.json delete mode 100644 includes/js/dojo/tests/data/geography_hierarchy_large.json delete mode 100644 includes/js/dojo/tests/data/geography_hierarchy_small.json delete mode 100644 includes/js/dojo/tests/data/readOnlyItemFileTestTemplates.js delete mode 100644 includes/js/dojo/tests/data/reference_integrity.json delete mode 100644 includes/js/dojo/tests/data/runTests.html delete mode 100644 includes/js/dojo/tests/data/utils.js delete mode 100644 includes/js/dojo/tests/date.js delete mode 100644 includes/js/dojo/tests/date/locale.js delete mode 100644 includes/js/dojo/tests/date/stamp.js delete mode 100644 includes/js/dojo/tests/dnd/dndDefault.css delete mode 100644 includes/js/dojo/tests/dnd/dndDefault.css.commented.css delete mode 100644 includes/js/dojo/tests/dnd/flickr_viewer.html delete mode 100644 includes/js/dojo/tests/dnd/test_box_constraints.html delete mode 100644 includes/js/dojo/tests/dnd/test_container.html delete mode 100644 includes/js/dojo/tests/dnd/test_container_markup.html delete mode 100644 includes/js/dojo/tests/dnd/test_custom_constraints.html delete mode 100644 includes/js/dojo/tests/dnd/test_dnd.html delete mode 100644 includes/js/dojo/tests/dnd/test_dnd_handles.html delete mode 100644 includes/js/dojo/tests/dnd/test_form.html delete mode 100644 includes/js/dojo/tests/dnd/test_moveable.html delete mode 100644 includes/js/dojo/tests/dnd/test_moveable_markup.html delete mode 100644 includes/js/dojo/tests/dnd/test_params.html delete mode 100644 includes/js/dojo/tests/dnd/test_parent_constraints.html delete mode 100644 includes/js/dojo/tests/dnd/test_parent_constraints_margins.html delete mode 100644 includes/js/dojo/tests/dnd/test_selector.html delete mode 100644 includes/js/dojo/tests/dnd/test_selector_markup.html delete mode 100644 includes/js/dojo/tests/dnd/test_timed_moveable.html delete mode 100644 includes/js/dojo/tests/fx.html delete mode 100644 includes/js/dojo/tests/fx.js delete mode 100644 includes/js/dojo/tests/i18n.js delete mode 100644 includes/js/dojo/tests/io/iframe.html delete mode 100644 includes/js/dojo/tests/io/iframe.js delete mode 100644 includes/js/dojo/tests/io/iframeResponse.html delete mode 100644 includes/js/dojo/tests/io/iframeResponse.js.html delete mode 100644 includes/js/dojo/tests/io/iframeResponse.json.html delete mode 100644 includes/js/dojo/tests/io/iframeResponse.text.html delete mode 100644 includes/js/dojo/tests/io/iframeUploadTest.html delete mode 100644 includes/js/dojo/tests/io/script.html delete mode 100644 includes/js/dojo/tests/io/script.js delete mode 100644 includes/js/dojo/tests/io/scriptJsonp.js delete mode 100644 includes/js/dojo/tests/io/scriptSimple.js delete mode 100644 includes/js/dojo/tests/io/scriptTimeout.html delete mode 100644 includes/js/dojo/tests/io/upload.cgi delete mode 100644 includes/js/dojo/tests/manualTests.html delete mode 100644 includes/js/dojo/tests/manualTests.js delete mode 100644 includes/js/dojo/tests/module.js delete mode 100644 includes/js/dojo/tests/nls/ar/salutations.js delete mode 100644 includes/js/dojo/tests/nls/cs/salutations.js delete mode 100644 includes/js/dojo/tests/nls/de/salutations.js delete mode 100644 includes/js/dojo/tests/nls/el/salutations.js delete mode 100644 includes/js/dojo/tests/nls/en-au/salutations.js delete mode 100644 includes/js/dojo/tests/nls/en-us-hawaii/salutations.js delete mode 100644 includes/js/dojo/tests/nls/en-us-new_york-brooklyn/salutations.js delete mode 100644 includes/js/dojo/tests/nls/en-us-texas/salutations.js delete mode 100644 includes/js/dojo/tests/nls/es/salutations.js delete mode 100644 includes/js/dojo/tests/nls/fa/salutations.js delete mode 100644 includes/js/dojo/tests/nls/fr/salutations.js delete mode 100644 includes/js/dojo/tests/nls/he/salutations.js delete mode 100644 includes/js/dojo/tests/nls/hi/salutations.js delete mode 100644 includes/js/dojo/tests/nls/it/salutations.js delete mode 100644 includes/js/dojo/tests/nls/ja/salutations.js delete mode 100644 includes/js/dojo/tests/nls/ko/salutations.js delete mode 100644 includes/js/dojo/tests/nls/pl/salutations.js delete mode 100644 includes/js/dojo/tests/nls/pt/salutations.js delete mode 100644 includes/js/dojo/tests/nls/ru/salutations.js delete mode 100644 includes/js/dojo/tests/nls/salutations.js delete mode 100644 includes/js/dojo/tests/nls/sw/salutations.js delete mode 100644 includes/js/dojo/tests/nls/th/salutations.js delete mode 100644 includes/js/dojo/tests/nls/tr/salutations.js delete mode 100644 includes/js/dojo/tests/nls/yi/salutations.js delete mode 100644 includes/js/dojo/tests/nls/zh-cn/salutations.js delete mode 100644 includes/js/dojo/tests/nls/zh-tw/salutations.js delete mode 100644 includes/js/dojo/tests/number.js delete mode 100644 includes/js/dojo/tests/parser.html delete mode 100644 includes/js/dojo/tests/parser.js delete mode 100644 includes/js/dojo/tests/resources/ApplicationState.js delete mode 100644 includes/js/dojo/tests/resources/JSON.php delete mode 100644 includes/js/dojo/tests/resources/testClass.php delete mode 100644 includes/js/dojo/tests/resources/testClass.smd delete mode 100644 includes/js/dojo/tests/resources/test_JsonRPCMediator.php delete mode 100644 includes/js/dojo/tests/resources/test_css.html delete mode 100644 includes/js/dojo/tests/resources/yahoo_smd_v1.smd delete mode 100644 includes/js/dojo/tests/rpc.js delete mode 100644 includes/js/dojo/tests/runTests.html delete mode 100644 includes/js/dojo/tests/string.js delete mode 100644 includes/js/dojo/tests/test_FirebugLite.html delete mode 100644 includes/js/dojo/tests/test_FirebugLitePopup.html delete mode 100644 includes/js/dojo/tests/test_fx.html (limited to 'includes/js/dojo/tests') diff --git a/includes/js/dojo/tests/AdapterRegistry.js b/includes/js/dojo/tests/AdapterRegistry.js deleted file mode 100644 index 4565e27..0000000 --- a/includes/js/dojo/tests/AdapterRegistry.js +++ /dev/null @@ -1,75 +0,0 @@ -if(!dojo._hasResource["tests.AdapterRegistry"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests.AdapterRegistry"] = true; -dojo.provide("tests.AdapterRegistry"); -dojo.require("dojo.AdapterRegistry"); - -doh.register("tests.AdapterRegistry", - [ - function ctor(t){ - var taa = new dojo.AdapterRegistry(); - t.is(0, taa.pairs.length); - t.f(taa.returnWrappers); - - var taa = new dojo.AdapterRegistry(true); - t.t(taa.returnWrappers); - }, - - function register(t){ - var taa = new dojo.AdapterRegistry(); - taa.register("blah", - function(str){ return str == "blah"; }, - function(){ return "blah"; } - ); - t.is(1, taa.pairs.length); - t.is("blah", taa.pairs[0][0]); - - taa.register("thinger"); - taa.register("prepend", null, null, true, true); - t.is("prepend", taa.pairs[0][0]); - t.t(taa.pairs[0][3]); - }, - - /* - function match(t){ - }, - */ - - function noMatch(t){ - var taa = new dojo.AdapterRegistry(); - var threw = false; - try{ - taa.match("blah"); - }catch(e){ - threw = true; - } - t.t(threw); - }, - - function returnWrappers(t){ - var taa = new dojo.AdapterRegistry(); - taa.register("blah", - function(str){ return str == "blah"; }, - function(){ return "blah"; } - ); - t.is("blah", taa.match("blah")); - - taa.returnWrappers = true; - t.is("blah", taa.match("blah")()); - }, - - function unregister(t){ - var taa = new dojo.AdapterRegistry(); - taa.register("blah", - function(str){ return str == "blah"; }, - function(){ return "blah"; } - ); - taa.register("thinger"); - taa.register("prepend", null, null, true, true); - taa.unregister("prepend"); - t.is(2, taa.pairs.length); - t.is("blah", taa.pairs[0][0]); - } - ] -); - -} 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); - } - ] -); - -} diff --git a/includes/js/dojo/tests/NodeList-fx.html b/includes/js/dojo/tests/NodeList-fx.html deleted file mode 100644 index 07fdbe0..0000000 --- a/includes/js/dojo/tests/NodeList-fx.html +++ /dev/null @@ -1,150 +0,0 @@ - - - - Testing dojo.fx extensions to dojo.NodeList - - - - - -

- Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean semper - sagittis velit. Cras in mi. Duis porta mauris ut ligula. Proin porta - rutrum lacus. Etiam consequat scelerisque quam. Nulla facilisi. - Maecenas luctus venenatis nulla. In sit amet dui non mi semper iaculis. - Sed molestie tortor at ipsum. Morbi dictum rutrum magna. Sed vitae - risus. -

-

- Aliquam vitae enim. Duis scelerisque metus auctor est venenatis - imperdiet. Fusce dignissim porta augue. Nulla vestibulum. Integer lorem - nunc, ullamcorper a, commodo ac, malesuada sed, dolor. Aenean id mi in - massa bibendum suscipit. Integer eros. Nullam suscipit mauris. In - pellentesque. Mauris ipsum est, pharetra semper, pharetra in, viverra - quis, tellus. Etiam purus. Quisque egestas, tortor ac cursus lacinia, - felis leo adipiscing nisi, et rhoncus elit dolor eget eros. Fusce ut - quam. Suspendisse eleifend leo vitae ligula. Nulla facilisi. Nulla - rutrum, erat vitae lacinia dictum, pede purus imperdiet lacus, ut - semper velit ante id metus. Praesent massa dolor, porttitor sed, - pulvinar in, consequat ut, leo. Nullam nec est. Aenean id risus blandit - tortor pharetra congue. Suspendisse pulvinar. -

-

- Aliquam vitae enim. Duis scelerisque metus auctor est venenatis - imperdiet. Fusce dignissim porta augue. Nulla vestibulum. Integer lorem - nunc, ullamcorper a, commodo ac, malesuada sed, dolor. Aenean id mi in - massa bibendum suscipit. Integer eros. Nullam suscipit mauris. In - pellentesque. Mauris ipsum est, pharetra semper, pharetra in, viverra - quis, tellus. Etiam purus. Quisque egestas, tortor ac cursus lacinia, - felis leo adipiscing nisi, et rhoncus elit dolor eget eros. Fusce ut - quam. Suspendisse eleifend leo vitae ligula. Nulla facilisi. Nulla - rutrum, erat vitae lacinia dictum, pede purus imperdiet lacus, ut - semper velit ante id metus. Praesent massa dolor, porttitor sed, - pulvinar in, consequat ut, leo. Nullam nec est. Aenean id risus blandit - tortor pharetra congue. Suspendisse pulvinar. -

- - - diff --git a/includes/js/dojo/tests/TODO b/includes/js/dojo/tests/TODO deleted file mode 100644 index c18bc3a..0000000 --- a/includes/js/dojo/tests/TODO +++ /dev/null @@ -1,11 +0,0 @@ -This file lists tests that need to be implemented or expanded. See ticket #3121 -for changes related to things listed here. - -Tests to add: -------------- - * add tests for dojo.place() - -Tests to improve: ------------------ - * cookie tests don't seem to test expiry or date functions - * NodeList isn't testing several of its public methods (place, orphan, adopt, etc.) diff --git a/includes/js/dojo/tests/_base.js b/includes/js/dojo/tests/_base.js deleted file mode 100644 index 7bc5301..0000000 --- a/includes/js/dojo/tests/_base.js +++ /dev/null @@ -1,136 +0,0 @@ -if(!dojo._hasResource["tests._base"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests._base"] = true; -var testGlobal = this; -try{ - dojo.provide("tests._base"); - testGlobal = dojo.global; -}catch(e){ } - -// the test suite for the bootstrap. Requires hostenv and other base tests at -// the end - -if(doh.selfTest){ - - doh.register("doh.smokeTest", - [ - function sanityCheckHarness(t){ - // sanity checks - t.assertTrue(true); - t.assertFalse(false); - t.assertFalse(0); - t.assertFalse(null); - var tObj = { w00t: false, blarg: true }; - t.assertEqual( - ["thinger", "blah", tObj], - ["thinger", "blah", tObj] - ); - t.assertEqual(tObj, tObj); - }, - /* - // uncomment to tests exception handling - function sanityCheckassertTrue(t){ - // should throw an error - t.assertTrue(false); - }, - function sanityCheckassertFalse(t){ - // should throw an error - t.assertFalse(true); - }, - function sanityCheckassertEqual(t){ - // should throw an error - t.assertEqual("foo", "bar"); - }, - */ - { - name: "eqTest", - // smoke test the fixture system - setUp: function(t){ - this.foo = "blah"; - }, - runTest: function(t){ - t.assertEqual("blah", this.foo); - }, - tearDown: function(t){ - } - } - ] - ); - - if(testGlobal["dojo"]){ - doh.register("tests._base", - [ - function dojoIsAvailable(t){ - t.assertTrue(testGlobal["dojo"]); - } - ] - ); - } - - if(testGlobal["setTimeout"]){ - // a stone-stupid async test - doh.register("tests.async", - [ - { - name: "deferredSuccess", - runTest: function(t){ - var d = new doh.Deferred(); - setTimeout(d.getTestCallback(function(){ - t.assertTrue(true); - t.assertFalse(false); - }), 50); - return d; - } - }, - { - name: "deferredFailure", - runTest: function(t){ - var d = new doh.Deferred(); - setTimeout(function(){ - d.errback(new Error("hrm...")); - }, 50); - return d; - } - }, - { - name: "timeoutFailure", - timeout: 50, - runTest: function(t){ - // timeout of 50 - var d = new doh.Deferred(); - setTimeout(function(){ - d.callback(true); - }, 100); - return d; - } - } - ] - ); - } -} - -try{ - // go grab the others - dojo.require("tests._base._loader.bootstrap"); - dojo.require("tests._base._loader.loader"); - dojo.platformRequire({ - browser: ["tests._base._loader.hostenv_browser"], - rhino: ["tests._base._loader.hostenv_rhino"], - spidermonkey: ["tests._base._loader.hostenv_spidermonkey"] - }); - dojo.require("tests._base.array"); - dojo.require("tests._base.Color"); - dojo.require("tests._base.lang"); - dojo.require("tests._base.declare"); - dojo.require("tests._base.connect"); - dojo.require("tests._base.Deferred"); - dojo.require("tests._base.json"); - // FIXME: add test includes for the rest of the Dojo Base groups here - dojo.requireIf(dojo.isBrowser, "tests._base.html"); - dojo.requireIf(dojo.isBrowser, "tests._base.fx"); - dojo.requireIf(dojo.isBrowser, "tests._base.query"); - dojo.requireIf(dojo.isBrowser, "tests._base.xhr"); -}catch(e){ - doh.debug(e); -} - -} diff --git a/includes/js/dojo/tests/_base/Color.js b/includes/js/dojo/tests/_base/Color.js deleted file mode 100644 index fa09842..0000000 --- a/includes/js/dojo/tests/_base/Color.js +++ /dev/null @@ -1,32 +0,0 @@ -if(!dojo._hasResource["tests._base.Color"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests._base.Color"] = true; -dojo.provide("tests._base.Color"); - -(function(){ - var white = dojo.colorFromString("white").toRgba(); - var maroon = dojo.colorFromString("maroon").toRgba(); - var verifyColor = function(t, source, expected){ - var color = new dojo.Color(source); - t.is(expected, color.toRgba()); - dojo.forEach(color.toRgba(), function(n){ t.is("number", typeof(n)); }); - } - - doh.register("tests._base.Color", - [ - function testColor1(t){ verifyColor(t, "maroon", maroon); }, - function testColor2(t){ verifyColor(t, "white", white); }, - function testColor3(t){ verifyColor(t, "#fff", white); }, - function testColor4(t){ verifyColor(t, "#ffffff", white); }, - function testColor5(t){ verifyColor(t, "rgb(255,255,255)", white); }, - function testColor6(t){ verifyColor(t, "#800000", maroon); }, - function testColor7(t){ verifyColor(t, "rgb(128, 0, 0)", maroon); }, - function testColor8(t){ verifyColor(t, "rgba(128, 0, 0, 0.5)", [128, 0, 0, 0.5]); }, - function testColor9(t){ verifyColor(t, maroon, maroon); }, - function testColor10(t){ verifyColor(t, [1, 2, 3], [1, 2, 3, 1]); }, - function testColor11(t){ verifyColor(t, [1, 2, 3, 0.5], [1, 2, 3, 0.5]); }, - function testColor12(t){ verifyColor(t, dojo.blendColors(new dojo.Color("black"), new dojo.Color("white"), 0.5), [128, 128, 128, 1]); } - ] - ); -})(); - -} 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); - } - ] -); - -} diff --git a/includes/js/dojo/tests/_base/NodeList.html b/includes/js/dojo/tests/_base/NodeList.html deleted file mode 100644 index e3f08c5..0000000 --- a/includes/js/dojo/tests/_base/NodeList.html +++ /dev/null @@ -1,370 +0,0 @@ - - - - - - testing dojo.NodeList - - - - -

testing dojo.NodeList

-
- 100px square, abs -
-
- c1 -
- - - diff --git a/includes/js/dojo/tests/_base/_loader/addLoadEvents.html b/includes/js/dojo/tests/_base/_loader/addLoadEvents.html deleted file mode 100644 index 53e669f..0000000 --- a/includes/js/dojo/tests/_base/_loader/addLoadEvents.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - Testing dojo.addOnLoad() and dojo.addOnUnload() - - - - -

Testing dojo.addOnLoad() and dojo.addOnUnload()

- -

This page has registers a function with dojo.addOnLoad() and dojo.addOnUnload.

- -

dojo.addOnLoad(): You should see an alert with the page first loads ("addOnLoad works").

- -

dojo.addOnUnload(): You should see an alert if the page is reloaded, or if you navigate to a - different web page ("addOnUnload works"). - - - diff --git a/includes/js/dojo/tests/_base/_loader/afterOnLoad.html b/includes/js/dojo/tests/_base/_loader/afterOnLoad.html deleted file mode 100644 index 48ebd60..0000000 --- a/includes/js/dojo/tests/_base/_loader/afterOnLoad.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - Testing afterOnLoad - - - - - - - - -

Testing afterOnLoad

- -

This page only works with a dojo build. It will not work properly if you run it directly from the subversion source.

- -

This page tests loading dojo after the page is loaded.

- -

When the window.onload fires, the dojo script tag will be added to the DOM - and configured to fire the onload callbacks. If everything works, you should - see a Calendar below.

- -

- -

- - diff --git a/includes/js/dojo/tests/_base/_loader/bootstrap.js b/includes/js/dojo/tests/_base/_loader/bootstrap.js deleted file mode 100644 index c2605cb..0000000 --- a/includes/js/dojo/tests/_base/_loader/bootstrap.js +++ /dev/null @@ -1,86 +0,0 @@ -if(!dojo._hasResource["tests._base._loader.bootstrap"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests._base._loader.bootstrap"] = true; -dojo.provide("tests._base._loader.bootstrap"); - -tests.register("tests._base._loader.bootstrap", - [ - - function hasConsole(t){ - t.assertTrue("console" in dojo.global); - t.assertTrue("assert" in console); - t.assertEqual("function", typeof console.assert); - }, - - { - name: "getObject", - setUp: function(){ - //Set an object in global scope. - dojo.global.globalValue = { - color: "blue", - size: 20 - }; - - //Set up an object in a specific scope. - this.foo = { - bar: { - color: "red", - size: 100 - } - }; - }, - runTest: function(t){ - //Test for existing object using global as root path. - var globalVar = dojo.getObject("globalValue"); - t.is("object", (typeof globalVar)); - t.assertEqual("blue", globalVar.color); - t.assertEqual(20, globalVar.size); - t.assertEqual("blue", dojo.getObject("globalValue.color")); - - //Test for non-existent object using global as root path. - //Then create it. - t.assertFalse(dojo.getObject("something.thatisNew")); - t.assertTrue(typeof(dojo.getObject("something.thatisNew", true)) == "object"); - - //Test for existing object using another object as root path. - var scopedVar = dojo.getObject("foo.bar", false, this); - t.assertTrue(typeof(scopedVar) == "object"); - t.assertEqual("red", scopedVar.color); - t.assertEqual(100, scopedVar.size); - t.assertEqual("red", dojo.getObject("foo.bar.color", true, this)); - - //Test for existing object using another object as root path. - //Then create it. - t.assertFalse(dojo.getObject("something.thatisNew", false, this)); - t.assertTrue(typeof(dojo.getObject("something.thatisNew", true, this)) == "object"); - }, - tearDown: function(){ - //Clean up global object that should not exist if - //the test is re-run. - try{ - delete dojo.global.something; - delete this.something; - }catch(e){} - } - }, - - { - name: "exists", - setUp: function(){ - this.foo = { - bar: {} - }; - }, - runTest: function(t){ - t.assertTrue(dojo.exists("foo.bar", this)); - t.assertFalse(dojo.exists("foo.bar")); - } - }, - - function evalWorks(t){ - t.assertTrue(dojo.eval("(true)")); - t.assertFalse(dojo.eval("(false)")); - } - ] -); - -} diff --git a/includes/js/dojo/tests/_base/_loader/getText.txt b/includes/js/dojo/tests/_base/_loader/getText.txt deleted file mode 100644 index 054e8e8..0000000 --- a/includes/js/dojo/tests/_base/_loader/getText.txt +++ /dev/null @@ -1 +0,0 @@ -dojo._getText() test data \ No newline at end of file diff --git a/includes/js/dojo/tests/_base/_loader/hostenv_browser.js b/includes/js/dojo/tests/_base/_loader/hostenv_browser.js deleted file mode 100644 index 255fca5..0000000 --- a/includes/js/dojo/tests/_base/_loader/hostenv_browser.js +++ /dev/null @@ -1,15 +0,0 @@ -if(!dojo._hasResource["tests._base._loader.hostenv_browser"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests._base._loader.hostenv_browser"] = true; -dojo.provide("tests._base._loader.hostenv_browser"); - -tests.register("tests._base._loader.hostenv_browser", - [ - function getText(t){ - var filePath = dojo.moduleUrl("tests._base._loader", "getText.txt"); - var text = dojo._getText(filePath); - t.assertEqual("dojo._getText() test data", text); - } - ] -); - -} diff --git a/includes/js/dojo/tests/_base/_loader/hostenv_rhino.js b/includes/js/dojo/tests/_base/_loader/hostenv_rhino.js deleted file mode 100644 index c121576..0000000 --- a/includes/js/dojo/tests/_base/_loader/hostenv_rhino.js +++ /dev/null @@ -1,17 +0,0 @@ -if(!dojo._hasResource["tests._base._loader.hostenv_rhino"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests._base._loader.hostenv_rhino"] = true; -dojo.provide("tests._base._loader.hostenv_rhino"); - -tests.register("tests._base._loader.hostenv_rhino", - [ - function getText(t){ - var filePath = dojo.moduleUrl("tests._base._loader", "getText.txt"); - var text = (new String(readText(filePath))); - //The Java file read seems to add a line return. - text = text.replace(/[\r\n]+$/, ""); - t.assertEqual("dojo._getText() test data", text); - } - ] -); - -} diff --git a/includes/js/dojo/tests/_base/_loader/hostenv_spidermonkey.js b/includes/js/dojo/tests/_base/_loader/hostenv_spidermonkey.js deleted file mode 100644 index 980d624..0000000 --- a/includes/js/dojo/tests/_base/_loader/hostenv_spidermonkey.js +++ /dev/null @@ -1,15 +0,0 @@ -if(!dojo._hasResource["tests._base._loader.hostenv_spidermonkey"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests._base._loader.hostenv_spidermonkey"] = true; -dojo.provide("tests._base._loader.hostenv_spidermonkey"); - -tests.register("tests._base._loader.hostenv_spidermonkey", - [ - function getText(t){ - var filePath = dojo.moduleUrl("tests._base._loader", "getText.txt"); - var text = readText(filePath); - t.assertEqual("dojo._getText() test data", text); - } - ] -); - -} diff --git a/includes/js/dojo/tests/_base/_loader/loader.js b/includes/js/dojo/tests/_base/_loader/loader.js deleted file mode 100644 index af1a338..0000000 --- a/includes/js/dojo/tests/_base/_loader/loader.js +++ /dev/null @@ -1,52 +0,0 @@ -if(!dojo._hasResource["tests._base._loader.loader"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests._base._loader.loader"] = true; -dojo.provide("tests._base._loader.loader"); - -tests.register("tests._base._loader.loader", - [ - function baseUrl(t){ - var originalBaseUrl = dojo.config["baseUrl"] || "./"; - - t.assertEqual(originalBaseUrl, dojo.baseUrl); - }, - - function modulePaths(t){ - dojo.registerModulePath("mycoolmod", "../some/path/mycoolpath"); - dojo.registerModulePath("mycoolmod.widget", "http://some.domain.com/another/path/mycoolpath/widget"); - - t.assertEqual("../some/path/mycoolpath/util", dojo._getModuleSymbols("mycoolmod.util").join("/")); - t.assertEqual("http://some.domain.com/another/path/mycoolpath/widget", dojo._getModuleSymbols("mycoolmod.widget").join("/")); - t.assertEqual("http://some.domain.com/another/path/mycoolpath/widget/thingy", dojo._getModuleSymbols("mycoolmod.widget.thingy").join("/")); - }, - - function moduleUrls(t){ - dojo.registerModulePath("mycoolmod", "some/path/mycoolpath"); - dojo.registerModulePath("mycoolmod2", "/some/path/mycoolpath2"); - dojo.registerModulePath("mycoolmod.widget", "http://some.domain.com/another/path/mycoolpath/widget"); - - - var basePrefix = dojo.baseUrl; - //dojo._Uri will strip off "./" characters, so do the same here - if(basePrefix == "./"){ - basePrefix = ""; - } - - t.assertEqual(basePrefix + "some/path/mycoolpath/my/favorite.html", - dojo.moduleUrl("mycoolmod", "my/favorite.html").toString()); - t.assertEqual(basePrefix + "some/path/mycoolpath/my/favorite.html", - dojo.moduleUrl("mycoolmod.my", "favorite.html").toString()); - - t.assertEqual("/some/path/mycoolpath2/my/favorite.html", - dojo.moduleUrl("mycoolmod2", "my/favorite.html").toString()); - t.assertEqual("/some/path/mycoolpath2/my/favorite.html", - dojo.moduleUrl("mycoolmod2.my", "favorite.html").toString()); - - t.assertEqual("http://some.domain.com/another/path/mycoolpath/widget/my/favorite.html", - dojo.moduleUrl("mycoolmod.widget", "my/favorite.html").toString()); - t.assertEqual("http://some.domain.com/another/path/mycoolpath/widget/my/favorite.html", - dojo.moduleUrl("mycoolmod.widget.my", "favorite.html").toString()); - } - ] -); - -} diff --git a/includes/js/dojo/tests/_base/_loader/scope/scope04.html b/includes/js/dojo/tests/_base/_loader/scope/scope04.html deleted file mode 100644 index 1866e4a..0000000 --- a/includes/js/dojo/tests/_base/_loader/scope/scope04.html +++ /dev/null @@ -1,80 +0,0 @@ - - - - Multiversion Dojo: 0.4.3 and 1.0 - - - - - - - - - - - - - -

Multiversion Dojo: 0.4.3 and 1.0

- -

NOTE: This test only works with a built version of Dojo

- -

This page loads Dojo 0.4.3 and Dojo 1.0.

- -

Dojo 0.4.3 version:

- -

Dojo 1.0 version:

- -

dojo.addClass should be undefined:

- -

- -

- -

- -

- - - - diff --git a/includes/js/dojo/tests/_base/_loader/scope/scopeContained.html b/includes/js/dojo/tests/_base/_loader/scope/scopeContained.html deleted file mode 100644 index 0acea5b..0000000 --- a/includes/js/dojo/tests/_base/_loader/scope/scopeContained.html +++ /dev/null @@ -1,71 +0,0 @@ - - - - Multiversion Dojo: 0.4.3 and 1.0 - - - - - - - - - - - - - -

Multiversion Dojo: 0.4.3 and 1.0

- -

NOTE: This test only works with a built version of Dojo, and it must be built with the scopeMap parameter (the backslashes below are required):

- -

build.sh profile=standard action=release scopeMap=[[\"dojo\",\"jodo\"],[\"dijit\",\"jidit\"],[\"dojox\",\"jodox\"]]

- -

This page loads Dojo 0.4.3 and Dojo 1.0 (under the jodo scope)

- -

Dojo 0.4.3 version:

- -

Jodo version:

- -

- -

- -

- -

- - - - diff --git a/includes/js/dojo/tests/_base/_loader/scope/scopeContainedXd.html b/includes/js/dojo/tests/_base/_loader/scope/scopeContainedXd.html deleted file mode 100644 index c4c2eda..0000000 --- a/includes/js/dojo/tests/_base/_loader/scope/scopeContainedXd.html +++ /dev/null @@ -1,84 +0,0 @@ - - - - Multiversion Dojo: 0.4.3 and 1.0 - - - - - - - - - - - - - -

XDomain Multiversion Dojo: 0.4.3 and 1.0

- -

NOTE: This test only works with a built, xdomain version of Dojo, and it must be built with the scopeMap parameter (the backslashes below are required):

- -

build.sh profile=standard action=release scopeMap=[[\"dojo\",\"jodo\"],[\"dijit\",\"jidit\"],[\"dojox\",\"jodox\"]] xdDojoScopeName=jodo loader=xdomain

- -

Only load this page from an http:// URL. Otherwise, the xd loading will not happen.

- -

This page xdomain loads Dojo 0.4.3 and Dojo 1.0 (under the jodo scope)

- -

Dojo 0.4.3 version:

- -

Jodo version:

- -

- -

- -

- -

- - - - diff --git a/includes/js/dojo/tests/_base/_loader/scope/scopeDjConfig.html b/includes/js/dojo/tests/_base/_loader/scope/scopeDjConfig.html deleted file mode 100644 index 0ef5daa..0000000 --- a/includes/js/dojo/tests/_base/_loader/scope/scopeDjConfig.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - Multiversion Dojo: 0.4.3 and 1.0 (scoped djConfig) - - - - - - - - - - - - -

Multiversion Dojo: 0.4.3 and 1.0 (scoped djConfig)

- -

NOTE: This test only works with a built version of Dojo, and it must be built with the scopeDjConfig parameter (the backslashes below are required):

- -

build.sh profile=standard action=release scopeDjConfig=\{parseOnLoad:true,baseUrl:\"../../../../\",foo:\"bar\",scopeMap:[[\"dojo\",\"jodo\"],[\"dijit\",\"jidit\"],[\"dojox\",\"jodox\"]]\}

- -

This page loads Dojo 0.4.3 and Dojo 1.0 (under the jodo scope)

- -

djConfig.baseUrl should not exist:

- -

jodo.baseUrl should be "../../../../":

- -

- -

- -

- -

- - - - diff --git a/includes/js/dojo/tests/_base/_loader/scope/scopeSingle.html b/includes/js/dojo/tests/_base/_loader/scope/scopeSingle.html deleted file mode 100644 index 759fcbe..0000000 --- a/includes/js/dojo/tests/_base/_loader/scope/scopeSingle.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - Using scope names inside dojo.require/dojoType - - - - - - - - - - - -

Using scope names inside dojo.require/dojoType

- -

NOTE: This test only works with a built version of Dojo.

- -

Jodo version:

- -

typeof dojo, dijit and dojox should be undefined:

- -

- -

- - - - diff --git a/includes/js/dojo/tests/_base/_loader/scope/scopeSingleDaac.html b/includes/js/dojo/tests/_base/_loader/scope/scopeSingleDaac.html deleted file mode 100644 index 8f9d7d8..0000000 --- a/includes/js/dojo/tests/_base/_loader/scope/scopeSingleDaac.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - Using scope names inside dojo.require/dojoType - - - - - - - - - - - -

Using scope names inside dojo.require/dojoType

- -

NOTE: This test only works with a built version of Dojo.

- -

Jodo version:

- -

typeof dojo, dijit and dojox should be object, since debugAtAllCosts is ON:

- -

- -

- - - - diff --git a/includes/js/dojo/tests/_base/array.js b/includes/js/dojo/tests/_base/array.js deleted file mode 100644 index 6611257..0000000 --- a/includes/js/dojo/tests/_base/array.js +++ /dev/null @@ -1,301 +0,0 @@ -if(!dojo._hasResource["tests._base.array"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests._base.array"] = true; -dojo.provide("tests._base.array"); - -tests.register("tests._base.array", - [ - function testIndexOf(t){ - var foo = [128, 256, 512]; - var bar = ["aaa", "bbb", "ccc"]; - - t.assertEqual(1, dojo.indexOf([45, 56, 85], 56)); - t.assertEqual(1, dojo.indexOf([Number, String, Date], String)); - t.assertEqual(1, dojo.indexOf(foo, foo[1])); - t.assertEqual(2, dojo.indexOf(foo, foo[2])); - t.assertEqual(1, dojo.indexOf(bar, bar[1])); - t.assertEqual(2, dojo.indexOf(bar, bar[2])); - t.assertEqual(-1, dojo.indexOf({a:1}, "a")); - - foo.push(bar); - t.assertEqual(3, dojo.indexOf(foo, bar)); - }, - - function testIndexOfFromIndex(t){ - var foo = [128, 256, 512]; - var bar = ["aaa", "bbb", "ccc"]; - - t.assertEqual(-1, dojo.indexOf([45, 56, 85], 56, 2)); - t.assertEqual(1, dojo.indexOf([45, 56, 85], 56, 1)); - t.assertEqual(1, dojo.indexOf([45, 56, 85], 56, -1)); - // Make sure going out of bounds doesn't throw us in an infinite loop - t.assertEqual(-1, dojo.indexOf([45, 56, 85], 56, 3)); - }, - - function testLastIndexOf(t){ - var foo = [128, 256, 512]; - var bar = ["aaa", "bbb", "aaa", "ccc"]; - - t.assertEqual(1, dojo.indexOf([45, 56, 85], 56)); - t.assertEqual(1, dojo.indexOf([Number, String, Date], String)); - t.assertEqual(1, dojo.lastIndexOf(foo, foo[1])); - t.assertEqual(2, dojo.lastIndexOf(foo, foo[2])); - t.assertEqual(1, dojo.lastIndexOf(bar, bar[1])); - t.assertEqual(2, dojo.lastIndexOf(bar, bar[2])); - t.assertEqual(2, dojo.lastIndexOf(bar, bar[0])); - }, - - function testLastIndexOfFromIndex(t){ - t.assertEqual(1, dojo.lastIndexOf([45, 56, 85], 56, 1)); - t.assertEqual(-1, dojo.lastIndexOf([45, 56, 85], 85, 1)); - t.assertEqual(-1, dojo.lastIndexOf([45, 56, 85], 85, -1)); - t.assertEqual(0, dojo.lastIndexOf([45, 56, 45], 45, 0)); - }, - - function testForEach(t){ - var foo = [128, "bbb", 512]; - dojo.forEach(foo, function(elt, idx, array){ - switch(idx){ - case 0: t.assertEqual(128, elt); break; - case 1: t.assertEqual("bbb", elt); break; - case 2: t.assertEqual(512, elt); break; - default: t.assertTrue(false); - } - }); - - var noException = true; - try{ - dojo.forEach(undefined, function(){}); - }catch(e){ - noException = false; - } - t.assertTrue(noException); - }, - - function testForEach_str(t){ - var bar = 'abc'; - dojo.forEach(bar, function(elt, idx, array){ - switch(idx){ - case 0: t.assertEqual("a", elt); break; - case 1: t.assertEqual("b", elt); break; - case 2: t.assertEqual("c", elt); break; - default: t.assertTrue(false); - } - }); - }, - // FIXME: test forEach w/ a NodeList()? - - function testForEach_string_callback(t){ - // Test using strings as callback", which accept the parameters with - // the names "item", "index" and "array"! - var foo = [128, "bbb", 512]; - // Test that the variable "item" contains the value of each item. - this._res = ""; - dojo.forEach(foo, 'this._res+=item', this); - t.assertEqual(this._res, "128bbb512"); - // Test that the variable "index" contains each index. - this._res = []; - dojo.forEach(foo, 'this._res.push(index)', this); - t.assertEqual(this._res, [0,1,2]); - // Test that the variable "array" always contains the entire array. - this._res = []; - dojo.forEach(foo, 'this._res.push(array)', this); - t.assertEqual(this._res, [[128, "bbb", 512],[128, "bbb", 512],[128, "bbb", 512]]); - // Catch undefined variable usage (I used to use "i" :-)). - var caughtException = false; - try{ - dojo.forEach(foo, 'this._res+=i', this); - }catch(e){ - caughtException = true; - } - t.assertTrue(caughtException); - }, - - // FIXME: test forEach w/ a NodeList()? - function testEvery(t){ - var foo = [128, "bbb", 512]; - - t.assertTrue( - dojo.every(foo, function(elt, idx, array){ - t.assertEqual(Array, array.constructor); - t.assertTrue(dojo.isArray(array)); - t.assertTrue(typeof idx == "number"); - if(idx == 1){ t.assertEqual("bbb" , elt); } - return true; - }) - ); - - t.assertTrue( - dojo.every(foo, function(elt, idx, array){ - switch(idx){ - case 0: t.assertEqual(128, elt); return true; - case 1: t.assertEqual("bbb", elt); return true; - case 2: t.assertEqual(512, elt); return true; - default: return false; - } - }) - ); - - t.assertFalse( - dojo.every(foo, function(elt, idx, array){ - switch(idx){ - case 0: t.assertEqual(128, elt); return true; - case 1: t.assertEqual("bbb", elt); return true; - case 2: t.assertEqual(512, elt); return false; - default: return true; - } - }) - ); - - }, - - function testEvery_str(t){ - var bar = 'abc'; - t.assertTrue( - dojo.every(bar, function(elt, idx, array){ - switch(idx){ - case 0: t.assertEqual("a", elt); return true; - case 1: t.assertEqual("b", elt); return true; - case 2: t.assertEqual("c", elt); return true; - default: return false; - } - }) - ); - - t.assertFalse( - dojo.every(bar, function(elt, idx, array){ - switch(idx){ - case 0: t.assertEqual("a", elt); return true; - case 1: t.assertEqual("b", elt); return true; - case 2: t.assertEqual("c", elt); return false; - default: return true; - } - }) - ); - }, - // FIXME: test NodeList for every()? - - function testSome(t){ - var foo = [128, "bbb", 512]; - t.assertTrue( - dojo.some(foo, function(elt, idx, array){ - t.assertEqual(3, array.length); - return true; - }) - ); - - t.assertTrue( - dojo.some(foo, function(elt, idx, array){ - if(idx < 1){ return true; } - return false; - }) - ); - - t.assertFalse( - dojo.some(foo, function(elt, idx, array){ - return false; - }) - ); - - t.assertTrue( - dojo.some(foo, function(elt, idx, array){ - t.assertEqual(Array, array.constructor); - t.assertTrue(dojo.isArray(array)); - t.assertTrue(typeof idx == "number"); - if(idx == 1){ t.assertEqual("bbb" , elt); } - return true; - }) - ); - }, - - function testSome_str(t){ - var bar = 'abc'; - t.assertTrue( - dojo.some(bar, function(elt, idx, array){ - t.assertEqual(3, array.length); - switch(idx){ - case 0: t.assertEqual("a", elt); return true; - case 1: t.assertEqual("b", elt); return true; - case 2: t.assertEqual("c", elt); return true; - default: return false; - } - }) - ); - - t.assertTrue( - dojo.some(bar, function(elt, idx, array){ - switch(idx){ - case 0: t.assertEqual("a", elt); return true; - case 1: t.assertEqual("b", elt); return true; - case 2: t.assertEqual("c", elt); return false; - default: return true; - } - }) - ); - - t.assertFalse( - dojo.some(bar, function(elt, idx, array){ - return false; - }) - ); - }, - // FIXME: need to add scoping tests for all of these!!! - - function testFilter(t){ - var foo = ["foo", "bar", 10]; - - t.assertEqual(["foo"], - dojo.filter(foo, function(elt, idx, array){ - return idx < 1; - }) - ); - - t.assertEqual(["foo"], - dojo.filter(foo, function(elt, idx, array){ - return elt == "foo"; - }) - ); - - t.assertEqual([], - dojo.filter(foo, function(elt, idx, array){ - return false; - }) - ); - - t.assertEqual([10], - dojo.filter(foo, function(elt, idx, array){ - return typeof elt == "number"; - }) - ); - }, - - function testFilter_str(t){ - var foo = "thinger blah blah blah"; - t.assertEqual(["t", "h", "i"], - dojo.filter(foo, function(elt, idx, array){ - return idx < 3; - }) - ); - - t.assertEqual([], - dojo.filter(foo, function(elt, idx, array){ - return false; - }) - ); - }, - - function testMap(t){ - t.assertEqual([], - dojo.map([], function(){ return true; }) - ); - - t.assertEqual([1, 2, 3], - dojo.map(["cat", "dog", "mouse"], function(elt, idx, array){ - return idx+1; - }) - ); - } - ] -); - - -} diff --git a/includes/js/dojo/tests/_base/connect.js b/includes/js/dojo/tests/_base/connect.js deleted file mode 100644 index 3761861..0000000 --- a/includes/js/dojo/tests/_base/connect.js +++ /dev/null @@ -1,225 +0,0 @@ -if(!dojo._hasResource["tests._base.connect"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests._base.connect"] = true; -dojo.provide("tests._base.connect"); - -hub = function(){ -} - -failures = 0; -bad = function(){ - failures++; -} - -good = function(){ -} - -// make 'iterations' connections to hub -// roughly half of which will be to 'good' and -// half to 'bad' -// all connections to 'bad' are disconnected -// test can then be performed on the values -// 'failures' and 'successes' -markAndSweepTest = function(iterations){ - var marked = []; - // connections - for(var i=0; i - - testing Core FX - - - - - - - -

testing Core FX

-
- - -
-
-

- Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean - semper sagittis velit. Cras in mi. Duis porta mauris ut ligula. - Proin porta rutrum lacus. Etiam consequat scelerisque quam. Nulla - facilisi. Maecenas luctus venenatis nulla. In sit amet dui non mi - semper iaculis. Sed molestie tortor at ipsum. Morbi dictum rutrum - magna. Sed vitae risus. -

-

- Aliquam vitae enim. Duis scelerisque metus auctor est venenatis - imperdiet. Fusce dignissim porta augue. Nulla vestibulum. Integer - lorem nunc, ullamcorper a, commodo ac, malesuada sed, dolor. Aenean - id mi in massa bibendum suscipit. Integer eros. Nullam suscipit - mauris. In pellentesque. Mauris ipsum est, pharetra semper, - pharetra in, viverra quis, tellus. Etiam purus. Quisque egestas, - tortor ac cursus lacinia, felis leo adipiscing nisi, et rhoncus - elit dolor eget eros. Fusce ut quam. Suspendisse eleifend leo vitae - ligula. Nulla facilisi. Nulla rutrum, erat vitae lacinia dictum, - pede purus imperdiet lacus, ut semper velit ante id metus. Praesent - massa dolor, porttitor sed, pulvinar in, consequat ut, leo. Nullam - nec est. Aenean id risus blandit tortor pharetra congue. - Suspendisse pulvinar. -

-
- - - - - - diff --git a/includes/js/dojo/tests/_base/fx.js b/includes/js/dojo/tests/_base/fx.js deleted file mode 100644 index acb1ca3..0000000 --- a/includes/js/dojo/tests/_base/fx.js +++ /dev/null @@ -1,8 +0,0 @@ -if(!dojo._hasResource["tests._base.fx"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests._base.fx"] = true; -dojo.provide("tests._base.fx"); -if(dojo.isBrowser){ - doh.registerUrl("tests._base.fx", dojo.moduleUrl("tests", "_base/fx.html"), 15000); -} - -} diff --git a/includes/js/dojo/tests/_base/fx_delay.html b/includes/js/dojo/tests/_base/fx_delay.html deleted file mode 100644 index c2a1cd9..0000000 --- a/includes/js/dojo/tests/_base/fx_delay.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - -
- - diff --git a/includes/js/dojo/tests/_base/html.html b/includes/js/dojo/tests/_base/html.html deleted file mode 100644 index 912c8a6..0000000 --- a/includes/js/dojo/tests/_base/html.html +++ /dev/null @@ -1,556 +0,0 @@ - - - - - testing Core HTML/DOM/CSS/Style utils - - - - - - -

testing Core HTML/DOM/CSS/Style utils

-
- 100px square, abs -
-
- 100px square, abs, 10px margin -
-
- 100px square, abs, 10px margin, 10px padding -
-
- 100px square, abs, 10px padding -
-
- 100px square, abs, 10px left and top padding -
-
- 100px square, abs, 10px left and top padding, 10px bottom and right margin -
-
- 100px square, abs, 10px yellow border -
-
- 100px square, abs, 10px yellow border, 10px margin -
-
- 100px square, abs, 10px yellow border, 10px margin, 10px padding -
-
- 100px square, no positioning -
- - -
-
-
-
- -
- - - - - - -
- - - diff --git a/includes/js/dojo/tests/_base/html.js b/includes/js/dojo/tests/_base/html.js deleted file mode 100644 index 99fe80b..0000000 --- a/includes/js/dojo/tests/_base/html.js +++ /dev/null @@ -1,12 +0,0 @@ -if(!dojo._hasResource["tests._base.html"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests._base.html"] = true; -dojo.provide("tests._base.html"); -if(dojo.isBrowser){ - doh.registerUrl("tests._base.html", dojo.moduleUrl("tests", "_base/html.html"), 15000); - doh.registerUrl("tests._base.html_rtl", dojo.moduleUrl("tests", "_base/html_rtl.html"), 15000); - doh.registerUrl("tests._base.html_quirks", dojo.moduleUrl("tests", "_base/html_quirks.html"), 15000); - doh.registerUrl("tests._base.html_box", dojo.moduleUrl("tests", "_base/html_box.html"), 35000); - doh.registerUrl("tests._base.html_box_quirks", dojo.moduleUrl("tests", "_base/html_box_quirks.html"), 35000); -} - -} diff --git a/includes/js/dojo/tests/_base/html_box.html b/includes/js/dojo/tests/_base/html_box.html deleted file mode 100644 index fd7ec53..0000000 --- a/includes/js/dojo/tests/_base/html_box.html +++ /dev/null @@ -1,207 +0,0 @@ - - - - - test html.js Box utils - - - - - - - - - diff --git a/includes/js/dojo/tests/_base/html_box_quirks.html b/includes/js/dojo/tests/_base/html_box_quirks.html deleted file mode 100644 index f87ca44..0000000 --- a/includes/js/dojo/tests/_base/html_box_quirks.html +++ /dev/null @@ -1,205 +0,0 @@ - - - - test html.js Box utils - - - - - - - - - diff --git a/includes/js/dojo/tests/_base/html_quirks.html b/includes/js/dojo/tests/_base/html_quirks.html deleted file mode 100644 index ddc7825..0000000 --- a/includes/js/dojo/tests/_base/html_quirks.html +++ /dev/null @@ -1,322 +0,0 @@ - - - - testing Core HTML/DOM/CSS/Style utils in quirks mode - - - - - - -

testing Core HTML/DOM/CSS/Style utils

-
- 100px square, abs -
-
- 100px square, abs, 10px margin -
-
- 100px square, abs, 10px margin, 10px padding -
-
- 100px square, abs, 10px padding -
-
- 100px square, abs, 10px left and top padding -
-
- 100px square, abs, 10px left and top padding, 10px bottom and right margin -
-
- 100px square, abs, 10px yellow border -
-
- 100px square, abs, 10px yellow border, 10px margin -
-
- 100px square, abs, 10px yellow border, 10px margin, 10px padding -
-
- 100px square, no positioning -
- - - diff --git a/includes/js/dojo/tests/_base/html_rtl.html b/includes/js/dojo/tests/_base/html_rtl.html deleted file mode 100644 index 8d74afa..0000000 --- a/includes/js/dojo/tests/_base/html_rtl.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - testing Core HTML/DOM/CSS/Style utils - - - - - - -

testing Core HTML/DOM/CSS/Style utils

-
- 100px rect, abs, - mouse point is at top-left after the test "eventClientXY" -
- - - - - diff --git a/includes/js/dojo/tests/_base/json.js b/includes/js/dojo/tests/_base/json.js deleted file mode 100644 index 3a9a24c..0000000 --- a/includes/js/dojo/tests/_base/json.js +++ /dev/null @@ -1,37 +0,0 @@ -if(!dojo._hasResource["tests._base.json"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests._base.json"] = true; -dojo.provide("tests._base.json"); - -tests.register("tests._base.json", - [ - //Not testing dojo.toJson() on its own since Rhino will output the object properties in a different order. - //Still valid json, but just in a different order than the source string. - - // take a json-compatible object, convert it to a json string, then put it back into json. - function toAndFromJson(t){ - var testObj = {a:"a", b:1, c:"c", d:"d", e:{e1:"e1", e2:2}, f:[1,2,3], g:"g",h:{h1:{h2:{h3:"h3"}}}}; - - var mirrorObj = dojo.fromJson(dojo.toJson(testObj)); - t.assertEqual("a", mirrorObj.a); - t.assertEqual(1, mirrorObj.b); - t.assertEqual("c", mirrorObj.c); - t.assertEqual("d", mirrorObj.d); - t.assertEqual("e1", mirrorObj.e.e1); - t.assertEqual(2, mirrorObj.e.e2); - t.assertEqual(1, mirrorObj.f[0]); - t.assertEqual(2, mirrorObj.f[1]); - t.assertEqual(3, mirrorObj.f[2]); - t.assertEqual("g", mirrorObj.g); - t.assertEqual("h3", mirrorObj.h.h1.h2.h3); - var badJson; - try{ - badJson = dojo.fromJson("bad json"); // this should throw an exception, and not set badJson - }catch(e){ - } - t.assertEqual(undefined,badJson); - } - ] -); - - -} diff --git a/includes/js/dojo/tests/_base/lang.js b/includes/js/dojo/tests/_base/lang.js deleted file mode 100644 index 38acbff..0000000 --- a/includes/js/dojo/tests/_base/lang.js +++ /dev/null @@ -1,180 +0,0 @@ -if(!dojo._hasResource["tests._base.lang"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests._base.lang"] = true; -dojo.provide("tests._base.lang"); - -tests.register("tests._base.lang", - [ - function mixin(t){ - var src = { - foo: function(){ - t.debug("foo"); - }, - bar: "bar" - }; - var dest = {}; - dojo.mixin(dest, src); - t.assertEqual("function", typeof dest["foo"]); - t.assertEqual("string", typeof dest["bar"]); - }, - - function extend(t){ - var src = { - foo: function(){ - t.debug("foo"); - }, - bar: "bar" - }; - function dest(){} - dojo.extend(dest, src); - var test = new dest(); - t.assertEqual("function", typeof test["foo"]); - t.assertEqual("string", typeof test["bar"]); - }, - - function isObject(t){ - t.assertFalse(dojo.isObject(true)); - t.assertFalse(dojo.isObject(false)); - t.assertFalse(dojo.isObject("foo")); - t.assertTrue(dojo.isObject(new String("foo"))); - t.assertTrue(dojo.isObject(null)); - t.assertTrue(dojo.isObject({})); - t.assertTrue(dojo.isObject([])); - t.assertTrue(dojo.isObject(new Array())); - }, - - function isArray(t){ - t.assertTrue(dojo.isArray([])); - t.assertTrue(dojo.isArray(new Array())); - t.assertFalse(dojo.isArray({})); - }, - - function isArrayLike(t){ - t.assertFalse(dojo.isArrayLike("thinger")); - t.assertTrue(dojo.isArrayLike(new Array())); - t.assertFalse(dojo.isArrayLike({})); - t.assertTrue(dojo.isArrayLike(arguments)); - }, - - function isString(t){ - t.assertFalse(dojo.isString(true)); - t.assertFalse(dojo.isString(false)); - t.assertTrue(dojo.isString("foo")); - t.assertTrue(dojo.isString(new String("foo"))); - t.assertFalse(dojo.isString(null)); - t.assertFalse(dojo.isString({})); - t.assertFalse(dojo.isString([])); - }, - - function partial(t){ - var scope = { foo: "bar" }; - var scope2 = { foo: "baz" }; - function thinger(arg1, arg2){ - return [this.foo, arg1, arg2]; - } - - var st1 = dojo.partial(thinger); - t.assertEqual("bar", st1.call(scope)[0]); - t.assertEqual(undefined, st1()[0]); - var st2 = dojo.partial(thinger, "foo", "bar"); - t.assertEqual("bar", st2()[2]); - var st3 = dojo.partial(thinger, "foo", "bar"); - }, - - function nestedPartial(t){ - function thinger(arg1, arg2){ - return [arg1, arg2]; - } - - var st1 = dojo.partial(thinger, "foo"); - t.assertEqual(undefined, st1()[1]); - t.assertEqual("bar", st1("bar")[1]); - - // partials can accumulate - var st2 = dojo.partial(st1, "thud"); - t.assertEqual("foo", st2()[0]); - t.assertEqual("thud", st2()[1]); - }, - - function hitch(t){ - var scope = { foo: "bar" }; - var scope2 = { foo: "baz" }; - function thinger(){ - return [this.foo, arguments.length]; - } - - var st1 = dojo.hitch(scope, thinger); - t.assertEqual("bar", st1()[0]); - t.assertEqual(0, st1()[1]); - - var st2 = dojo.hitch(scope2, thinger); - t.assertEqual("baz", st2()[0]); - t.assertEqual(0, st1()[1]); - t.assertEqual(1, st1("blah")[1]); - - // st2 should be "scope proof" - t.assertEqual("baz", st2.call(scope)[0]); - }, - - function hitchWithArgs(t){ - var scope = { foo: "bar" }; - var scope2 = { foo: "baz" }; - function thinger(){ - return [this.foo, arguments.length]; - } - - var st1 = dojo.hitch(scope, thinger, "foo", "bar"); - t.assertEqual("bar", st1()[0]); - t.assertEqual(2, st1()[1]); - var st2 = dojo.hitch(scope2, thinger, "foo", "bar"); - t.assertEqual("baz", st2()[0]); - t.assertEqual(2, st2()[1]); - }, - - function hitchAsPartial(t){ - var scope = { foo: "bar" }; - var scope2 = { foo: "baz" }; - function thinger(arg1, arg2){ - return [this.foo, arg1, arg2]; - } - - var st1 = dojo.hitch(null, thinger); - t.assertEqual("bar", st1.call(scope)[0]); - t.assertEqual(undefined, st1()[0]); - var st2 = dojo.hitch(null, thinger, "foo", "bar"); - t.assertEqual("bar", st2()[2]); - var st3 = dojo.hitch(null, thinger, "foo", "bar"); - }, - - function _toArray(t){ - var obj1 = [ 'foo', 'bar', 'spam', 'ham' ]; - - function thinger(){ - return dojo._toArray(arguments); - } - var obj2 = thinger.apply(this, obj1); - t.assertEqual(obj1[0], obj2[0]); - }, - - function clone(t) { - var obj1 = {foo: 'bar', answer: 42, jan102007: new Date(2007, 0, 10), - baz: { - a: null, - b: [ - 1, "b", 2.3, true, false - //, function(){ return 4; }, /\d+/gm - ] - } - }; - var obj2 = dojo.clone(obj1); - t.assertEqual(obj1.foo, obj2.foo); - t.assertEqual(obj1.answer, obj2.answer); - t.assertEqual(obj1.jan102007, obj2.jan102007); - t.assertEqual(obj1.baz.a, obj2.baz.a); - for(var i = 0; i < obj1.baz.b.length; ++i){ - t.assertEqual(obj1.baz.b[i], obj2.baz.b[i]); - } - } - ] -); - -} diff --git a/includes/js/dojo/tests/_base/query.html b/includes/js/dojo/tests/_base/query.html deleted file mode 100644 index 5c92221..0000000 --- a/includes/js/dojo/tests/_base/query.html +++ /dev/null @@ -1,154 +0,0 @@ - - - testing dojo.query() - - - - - - -

testing dojo.query()

-
-

h3 span endh3

- -
-

h3

- - -
-

h3

-

h3

- - - - - -
-
-
-
-
-
- - -
- - - diff --git a/includes/js/dojo/tests/_base/query.js b/includes/js/dojo/tests/_base/query.js deleted file mode 100644 index 20d2fc4..0000000 --- a/includes/js/dojo/tests/_base/query.js +++ /dev/null @@ -1,9 +0,0 @@ -if(!dojo._hasResource["tests._base.query"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests._base.query"] = true; -dojo.provide("tests._base.query"); -if(dojo.isBrowser){ - doh.registerUrl("tests._base.query", dojo.moduleUrl("tests", "_base/query.html")); - doh.registerUrl("tests._base.NodeList", dojo.moduleUrl("tests", "_base/NodeList.html")); -} - -} diff --git a/includes/js/dojo/tests/_base/timeout.php b/includes/js/dojo/tests/_base/timeout.php deleted file mode 100644 index 560b0d3..0000000 --- a/includes/js/dojo/tests/_base/timeout.php +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/includes/js/dojo/tests/_base/xhr.html b/includes/js/dojo/tests/_base/xhr.html deleted file mode 100644 index ddc1bb4..0000000 --- a/includes/js/dojo/tests/_base/xhr.html +++ /dev/null @@ -1,404 +0,0 @@ - - - - testing form and xhr utils - - - - - - -
- - - -
-
- - - - - -
-
- -
-
- -
-
- - - -
- - - diff --git a/includes/js/dojo/tests/_base/xhr.js b/includes/js/dojo/tests/_base/xhr.js deleted file mode 100644 index 885bbfe..0000000 --- a/includes/js/dojo/tests/_base/xhr.js +++ /dev/null @@ -1,8 +0,0 @@ -if(!dojo._hasResource["tests._base.xhr"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests._base.xhr"] = true; -dojo.provide("tests._base.xhr"); -if(dojo.isBrowser){ - doh.registerUrl("tests._base.xhr", dojo.moduleUrl("tests", "_base/xhr.html")); -} - -} diff --git a/includes/js/dojo/tests/_base/xhrDummyMethod.php b/includes/js/dojo/tests/_base/xhrDummyMethod.php deleted file mode 100644 index c9206fe..0000000 --- a/includes/js/dojo/tests/_base/xhrDummyMethod.php +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/includes/js/dojo/tests/back-hash.js b/includes/js/dojo/tests/back-hash.js deleted file mode 100644 index 3fef2c5..0000000 --- a/includes/js/dojo/tests/back-hash.js +++ /dev/null @@ -1,33 +0,0 @@ -if(!dojo._hasResource["tests.back-hash"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests.back-hash"] = true; -dojo.provide("tests.back-hash"); - -dojo.require("dojo.back"); - -(function(){ - tests.register("tests.back.hash", [ - function getAndSet(t) { - var cases = [ - "test", - "test with spaces", - "test%20with%20encoded", - "test+with+pluses", - " leading", - "trailing ", - "under_score", - "extra#mark", - "extra?instring", - "extra&instring", - "#leadinghash" - ]; - var b = dojo.back; - function verify(s){ - dojo.back.setHash(s); - t.is(s, dojo.back.getHash(s)); - } - dojo.forEach(cases, verify); - } - ]); -})(); - -} diff --git a/includes/js/dojo/tests/back.html b/includes/js/dojo/tests/back.html deleted file mode 100644 index 1b9ca1c..0000000 --- a/includes/js/dojo/tests/back.html +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - - - -
-

dojo.back test

- - -

This page tests the dojo.back back/forward code.

- -

The buttons that start with "Link" on them don't use any dojo.xhr* calls, - just JS data already in the page.

- -
    -
  • Don't test this page using local disk for MSIE. MSIE will not - create a history list for iframe_history.html if served from a file: - URL. Serve the test pages from a web server to test in that browser.
  • -
  • Safari 2.0.3+ (and probably 1.3.2+): Only the back button works OK - (not the forward button).
  • -
  • Opera 8.5.3: Does not work.
  • -
  • Konqueror: Unknown. The latest may have Safari's behavior.
  • -
-
-
-
-
-
-
-
-
-
-
-
-
-
- Data Output:
-
-
- Back/Forward Info:
-
-
- - diff --git a/includes/js/dojo/tests/back.js b/includes/js/dojo/tests/back.js deleted file mode 100644 index 0565716..0000000 --- a/includes/js/dojo/tests/back.js +++ /dev/null @@ -1,8 +0,0 @@ -if(!dojo._hasResource["tests.back"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests.back"] = true; -dojo.provide("tests.back"); -if(dojo.isBrowser){ - doh.registerUrl("tests.back", dojo.moduleUrl("tests", "back.html")); -} - -} diff --git a/includes/js/dojo/tests/behavior.html b/includes/js/dojo/tests/behavior.html deleted file mode 100644 index 280fc29..0000000 --- a/includes/js/dojo/tests/behavior.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - Testing dojo.behavior - - - - - -
- .foo > span -
- .foo > .bar > span -
-
- - - diff --git a/includes/js/dojo/tests/behavior.js b/includes/js/dojo/tests/behavior.js deleted file mode 100644 index e09de9d..0000000 --- a/includes/js/dojo/tests/behavior.js +++ /dev/null @@ -1,8 +0,0 @@ -if(!dojo._hasResource["tests.behavior"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests.behavior"] = true; -dojo.provide("tests.behavior"); -if(dojo.isBrowser){ - doh.registerUrl("tests.behavior", dojo.moduleUrl("tests", "behavior.html")); -} - -} diff --git a/includes/js/dojo/tests/cldr.js b/includes/js/dojo/tests/cldr.js deleted file mode 100644 index e9edfad..0000000 --- a/includes/js/dojo/tests/cldr.js +++ /dev/null @@ -1,19 +0,0 @@ -if(!dojo._hasResource["tests.cldr"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests.cldr"] = true; -dojo.provide("tests.cldr"); - -dojo.require("dojo.cldr.supplemental"); -dojo.require("dojo.cldr.monetary"); - -tests.register("tests.cldr", - [ - function test_date_getWeekend(t){ - t.is(6, dojo.cldr.supplemental.getWeekend('en-us').start); - t.is(0, dojo.cldr.supplemental.getWeekend('en-us').end); - t.is(5, dojo.cldr.supplemental.getWeekend('he-il').start); - t.is(6, dojo.cldr.supplemental.getWeekend('he-il').end); - } - ] -); - -} diff --git a/includes/js/dojo/tests/colors.js b/includes/js/dojo/tests/colors.js deleted file mode 100644 index 7f3808e..0000000 --- a/includes/js/dojo/tests/colors.js +++ /dev/null @@ -1,48 +0,0 @@ -if(!dojo._hasResource["tests.colors"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests.colors"] = true; -dojo.provide("tests.colors"); -dojo.require("dojo.colors"); - -(function(){ - var verifyColor = function(t, source, expected){ - var source = new dojo.Color(source); - var expected = new dojo.Color(expected); - t.is(expected.toRgba(), source.toRgba()); - dojo.forEach(source.toRgba(), function(n){ t.is("number", typeof(n)); }); - } - - doh.register("tests.colors", - [ - // all tests below are taken from #4.2 of the CSS3 Color Module - function testColorEx01(t){ verifyColor(t, "black", [0, 0, 0]); }, - function testColorEx02(t){ verifyColor(t, "white", [255, 255, 255]); }, - function testColorEx03(t){ verifyColor(t, "maroon", [128, 0, 0]); }, - function testColorEx04(t){ verifyColor(t, "olive", [128, 128, 0]); }, - function testColorEx05(t){ verifyColor(t, "#f00", "red"); }, - function testColorEx06(t){ verifyColor(t, "#ff0000", "red"); }, - function testColorEx07(t){ verifyColor(t, "rgb(255, 0, 0)", "red"); }, - function testColorEx08(t){ verifyColor(t, "rgb(100%, 0%, 0%)", "red"); }, - function testColorEx09(t){ verifyColor(t, "rgb(300, 0, 0)", "red"); }, - function testColorEx10(t){ verifyColor(t, "rgb(255, -10, 0)", "red"); }, - function testColorEx11(t){ verifyColor(t, "rgb(110%, 0%, 0%)", "red"); }, - function testColorEx12(t){ verifyColor(t, "rgba(255, 0, 0, 1)", "red"); }, - function testColorEx13(t){ verifyColor(t, "rgba(100%, 0%, 0%, 1)", "red"); }, - function testColorEx14(t){ verifyColor(t, "rgba(0, 0, 255, 0.5)", [0, 0, 255, 0.5]); }, - function testColorEx15(t){ verifyColor(t, "rgba(100%, 50%, 0%, 0.1)", [255, 128, 0, 0.1]); }, - function testColorEx16(t){ verifyColor(t, "hsl(0, 100%, 50%)", "red"); }, - function testColorEx17(t){ verifyColor(t, "hsl(120, 100%, 50%)", "lime"); }, - function testColorEx18(t){ verifyColor(t, "hsl(120, 100%, 25%)", "green"); }, - function testColorEx19(t){ verifyColor(t, "hsl(120, 100%, 75%)", "#80ff80"); }, - function testColorEx20(t){ verifyColor(t, "hsl(120, 50%, 50%)", "#40c040"); }, - function testColorEx21(t){ verifyColor(t, "hsla(120, 100%, 50%, 1)", "lime"); }, - function testColorEx22(t){ verifyColor(t, "hsla(240, 100%, 50%, 0.5)", [0, 0, 255, 0.5]); }, - function testColorEx23(t){ verifyColor(t, "hsla(30, 100%, 50%, 0.1)", [255, 128, 0, 0.1]); }, - function testColorEx24(t){ verifyColor(t, "transparent", [0, 0, 0, 0]); }, - // all tests below test greyscale colors - function testColorEx25(t){ verifyColor(t, dojo.colors.makeGrey(5), [5, 5, 5, 1]); }, - function testColorEx26(t){ verifyColor(t, dojo.colors.makeGrey(2, 0.3), [2, 2, 2, 0.3]); } - ] - ); -})(); - -} diff --git a/includes/js/dojo/tests/cookie.html b/includes/js/dojo/tests/cookie.html deleted file mode 100644 index a89b0f8..0000000 --- a/includes/js/dojo/tests/cookie.html +++ /dev/null @@ -1,84 +0,0 @@ - - - testing Cookies - - - - - - - - diff --git a/includes/js/dojo/tests/cookie.js b/includes/js/dojo/tests/cookie.js deleted file mode 100644 index 46cd519..0000000 --- a/includes/js/dojo/tests/cookie.js +++ /dev/null @@ -1,8 +0,0 @@ -if(!dojo._hasResource["tests.cookie"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests.cookie"] = true; -dojo.provide("tests.cookie"); -if(dojo.isBrowser){ - doh.registerUrl("tests.cookie", dojo.moduleUrl("tests", "cookie.html")); -} - -} diff --git a/includes/js/dojo/tests/currency.js b/includes/js/dojo/tests/currency.js deleted file mode 100644 index 8375725..0000000 --- a/includes/js/dojo/tests/currency.js +++ /dev/null @@ -1,48 +0,0 @@ -if(!dojo._hasResource["tests.currency"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests.currency"] = true; -dojo.provide("tests.currency"); - -dojo.require("dojo.currency"); - -tests.register("tests.currency", - [ - { - // Test formatting and parsing of currencies in various locales pre-built in dojo.cldr - // NOTE: we can't set djConfig.extraLocale before bootstrapping unit tests, so directly - // load resources here for specific locales: - - name: "currency", - setUp: function(){ - var partLocaleList = ["en-us", "en-ca", "de-de"]; - for(var i = 0 ; i < partLocaleList.length; i ++){ - dojo.requireLocalization("dojo.cldr","currency",partLocaleList[i], "zh,en-ca,pt,en-us,de,ja,en,en-au,ROOT,fr,es,ko,zh-tw,it"); - dojo.requireLocalization("dojo.cldr","number",partLocaleList[i], "zh-cn,zh,ko-kr,pt,en-us,en-gb,de,ja,ja-jp,en,ROOT,en-au,fr,es,ko,zh-tw,it,es-es,de-de"); - } - }, - runTest: function(t){ - t.is("\u20ac123.45", dojo.currency.format(123.45, {currency: "EUR", locale: "en-us"})); - t.is("$123.45", dojo.currency.format(123.45, {currency: "USD", locale: "en-us"})); - t.is("$1,234.56", dojo.currency.format(1234.56, {currency: "USD", locale: "en-us"})); - t.is("US$123.45", dojo.currency.format(123.45, {currency: "USD", locale: "en-ca"})); - t.is("$123.45", dojo.currency.format(123.45, {currency: "CAD", locale: "en-ca"})); - t.is("Can$123.45", dojo.currency.format(123.45, {currency: "CAD", locale: "en-us"})); - t.is("123,45 \u20ac", dojo.currency.format(123.45, {currency: "EUR", locale: "de-de"})); - t.is("1.234,56 \u20ac", dojo.currency.format(1234.56, {currency: "EUR", locale: "de-de"})); - // There is no special currency symbol for ADP, so expect the ISO code instead - t.is("ADP123", dojo.currency.format(123, {currency: "ADP", locale: "en-us"})); - - t.is(123.45, dojo.currency.parse("$123.45", {currency: "USD", locale: "en-us"})); - t.is(1234.56, dojo.currency.parse("$1,234.56", {currency: "USD", locale: "en-us"})); - t.is(123.45, dojo.currency.parse("123,45 \u20ac", {currency: "EUR", locale: "de-de"})); - t.is(1234.56, dojo.currency.parse("1.234,56 \u20ac", {currency: "EUR", locale: "de-de"})); - t.is(1234.56, dojo.currency.parse("1.234,56\u20ac", {currency: "EUR", locale: "de-de"})); - - t.is(1234, dojo.currency.parse("$1,234", {currency: "USD", locale: "en-us"})); - t.is(1234, dojo.currency.parse("$1,234", {currency: "USD", fractional: false, locale: "en-us"})); - t.t(isNaN(dojo.currency.parse("$1,234", {currency: "USD", fractional: true, locale: "en-us"}))); - } - } - ] -); - -} diff --git a/includes/js/dojo/tests/data.js b/includes/js/dojo/tests/data.js deleted file mode 100644 index 6556236..0000000 --- a/includes/js/dojo/tests/data.js +++ /dev/null @@ -1,12 +0,0 @@ -if(!dojo._hasResource["tests.data"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests.data"] = true; -dojo.provide("tests.data"); -//Squelch any json comment messages for now, since the UT allows for both. -dojo.config.usePlainJson = true; -dojo.require("tests.data.utils"); -dojo.require("tests.data.ItemFileReadStore"); -dojo.require("tests.data.ItemFileWriteStore"); - - - -} diff --git a/includes/js/dojo/tests/data/ItemFileReadStore.js b/includes/js/dojo/tests/data/ItemFileReadStore.js deleted file mode 100644 index 19d37da..0000000 --- a/includes/js/dojo/tests/data/ItemFileReadStore.js +++ /dev/null @@ -1,10 +0,0 @@ -if(!dojo._hasResource["tests.data.ItemFileReadStore"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests.data.ItemFileReadStore"] = true; -dojo.provide("tests.data.ItemFileReadStore"); -dojo.require("tests.data.readOnlyItemFileTestTemplates"); -dojo.require("dojo.data.ItemFileReadStore"); - -tests.data.readOnlyItemFileTestTemplates.registerTestsForDatastore("dojo.data.ItemFileReadStore"); - - -} diff --git a/includes/js/dojo/tests/data/ItemFileWriteStore.js b/includes/js/dojo/tests/data/ItemFileWriteStore.js deleted file mode 100644 index 9dd938e..0000000 --- a/includes/js/dojo/tests/data/ItemFileWriteStore.js +++ /dev/null @@ -1,1402 +0,0 @@ -if(!dojo._hasResource["tests.data.ItemFileWriteStore"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests.data.ItemFileWriteStore"] = true; -dojo.provide("tests.data.ItemFileWriteStore"); -dojo.require("tests.data.readOnlyItemFileTestTemplates"); - -dojo.require("dojo.data.ItemFileWriteStore"); -dojo.require("dojo.data.api.Read"); -dojo.require("dojo.data.api.Identity"); -dojo.require("dojo.data.api.Write"); -dojo.require("dojo.data.api.Notification"); - - -// First, make sure ItemFileWriteStore can still pass all the same unit tests -// that we use for its superclass, ItemFileReadStore: -tests.data.readOnlyItemFileTestTemplates.registerTestsForDatastore("dojo.data.ItemFileWriteStore"); - -tests.data.ItemFileWriteStore.getTestData = function(name){ - var data = {}; - if(name === "reference_integrity"){ - if(dojo.isBrowser){ - data = {url: dojo.moduleUrl("tests", "data/reference_integrity.json").toString() }; - }else{ - data = - { data: { - "identifier": "id", - "label": "name", - "items": [ - {"id": 1, "name": "Item 1"}, - {"id": 2, "name": "Item 2"}, - {"id": 3, "name": "Item 3"}, - {"id": 4, "name": "Item 4"}, - {"id": 5, "name": "Item 5"}, - {"id": 6, "name": "Item 6"}, - {"id": 7, "name": "Item 7"}, - {"id": 8, "name": "Item 8"}, - {"id": 9, "name": "Item 9"}, - {"id": 10, "name": "Item 10", "friends": [{"_reference": 1},{"_reference": 3},{"_reference": 5}]}, - {"id": 11, "name": "Item 11", "friends": [{"_reference": 10}], "siblings": [{"_reference": 10}]}, - {"id": 12, "name": "Item 12", "friends": [{"_reference": 3},{"_reference": 7}], "enemies": [{"_reference": 10}]}, - {"id": 13, "name": "Item 13", "friends": [{"_reference": 10}]}, - {"id": 14, "name": "Item 14", "friends": [{"_reference": 11}]}, - {"id": 15, "name": "item 15", "friends": [{"id": 16, "name": "Item 16"}]} - ] - } - } - } - } - return data; -}; - - -// Now run some tests that are specific to the write-access features: -doh.register("tests.data.ItemFileWriteStore", - [ - function test_getFeatures(){ - // summary: - // Simple test of the getFeatures function of the store - // description: - // Simple test of the getFeatures function of the store - var store = new dojo.data.ItemFileWriteStore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries")); - - var features = store.getFeatures(); - - // make sure we have the expected features: - doh.assertTrue(features["dojo.data.api.Read"] != null); - doh.assertTrue(features["dojo.data.api.Identity"] != null); - doh.assertTrue(features["dojo.data.api.Write"] != null); - doh.assertTrue(features["dojo.data.api.Notification"] != null); - doh.assertFalse(features["iggy"]); - - // and only the expected features: - var count = 0; - for(var i in features){ - doh.assertTrue((i === "dojo.data.api.Read" || - i === "dojo.data.api.Identity" || - i === "dojo.data.api.Write" || - i === "dojo.data.api.Notification")); - count++; - } - doh.assertEqual(count, 4); - }, - function testWriteAPI_setValue(){ - // summary: - // Simple test of the setValue API - // description: - // Simple test of the setValue API - var store = new dojo.data.ItemFileWriteStore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries")); - - var deferred = new doh.Deferred(); - function onComplete(items, request){ - doh.assertEqual(1, items.length); - var item = items[0]; - doh.assertTrue(store.containsValue(item, "capital", "Cairo")); - - // FIXME: - // Okay, so this seems very odd. Maybe I'm just being dense. - // These tests works: - doh.assertEqual(store.isDirty(item), false); - doh.assertTrue(store.isDirty(item) == false); - // But these seemingly equivalent tests will not work: - // doh.assertFalse(store.isDirty(item)); - // doh.assertTrue(!(store.isDirty(item))); - // - // All of which seems especially weird, given that this *does* work: - doh.assertFalse(store.isDirty()); - - - doh.assertTrue(store.isDirty(item) == false); - doh.assertTrue(!store.isDirty()); - store.setValue(item, "capital", "New Cairo"); - doh.assertTrue(store.isDirty(item)); - doh.assertTrue(store.isDirty()); - doh.assertEqual(store.getValue(item, "capital").toString(), "New Cairo"); - deferred.callback(true); - } - function onError(error, request){ - deferred.errback(error); - } - store.fetch({query:{name:"Egypt"}, onComplete: onComplete, onError: onError}); - return deferred; //Object - }, - function testWriteAPI_setValues(){ - // summary: - // Simple test of the setValues API - // description: - // Simple test of the setValues API - var store = new dojo.data.ItemFileWriteStore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries")); - - var deferred = new doh.Deferred(); - function onComplete(items, request){ - doh.assertEqual(1, items.length); - var item = items[0]; - doh.assertTrue(store.containsValue(item, "name", "Egypt")); - doh.assertTrue(store.isDirty(item) == false); - doh.assertTrue(!store.isDirty()); - store.setValues(item, "name", ["Egypt 1", "Egypt 2"]); - doh.assertTrue(store.isDirty(item)); - doh.assertTrue(store.isDirty()); - var values = store.getValues(item, "name"); - doh.assertTrue(values[0] == "Egypt 1"); - doh.assertTrue(values[1] == "Egypt 2"); - deferred.callback(true); - } - function onError(error, request){ - deferred.errback(error); - } - store.fetch({query:{name:"Egypt"}, onComplete: onComplete, onError: onError}); - return deferred; //Object - }, - function testWriteAPI_unsetAttribute(){ - // summary: - // Simple test of the unsetAttribute API - // description: - // Simple test of the unsetAttribute API - var store = new dojo.data.ItemFileWriteStore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries")); - - var deferred = new doh.Deferred(); - function onComplete(items, request) { - doh.assertEqual(1, items.length); - var item = items[0]; - doh.assertTrue(store.containsValue(item, "name", "Egypt")); - doh.assertTrue(store.isDirty(item) == false); - doh.assertTrue(!store.isDirty()); - store.unsetAttribute(item, "name"); - doh.assertTrue(store.isDirty(item)); - doh.assertTrue(store.isDirty()); - doh.assertTrue(!store.hasAttribute(item, "name")); - deferred.callback(true); - } - function onError(error, request) { - deferred.errback(error); - } - store.fetch({query:{name:"Egypt"}, onComplete: onComplete, onError: onError}); - return deferred; //Object - }, - function testWriteAPI_newItem(){ - // summary: - // Simple test of the newItem API - // description: - // Simple test of the newItem API - var store = new dojo.data.ItemFileWriteStore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries")); - - var deferred = new doh.Deferred(); - doh.assertTrue(!store.isDirty()); - - var onNewInvoked = false; - store.onNew = function(newItem, parentInfo){ - - doh.assertTrue(newItem !== null); - doh.assertTrue(parentInfo === null); - doh.assertTrue(store.isItem(newItem)); - onNewInvoked = true; - }; - var canada = store.newItem({name: "Canada", abbr:"ca", capital:"Ottawa"}); - doh.assertTrue(onNewInvoked); - - doh.assertTrue(store.isDirty(canada)); - doh.assertTrue(store.isDirty()); - doh.assertTrue(store.getValues(canada, "name") == "Canada"); - function onComplete(items, request){ - doh.assertEqual(1, items.length); - var item = items[0]; - doh.assertTrue(store.containsValue(item, "name", "Canada")); - deferred.callback(true); - } - function onError(error, request){ - deferred.errback(error); - } - store.fetch({query:{name:"Canada"}, onComplete: onComplete, onError: onError}); - return deferred; //Object - }, - function testWriteAPI_newItem_withParent(){ - // summary: - // Simple test of the newItem API with a parent assignment - // description: - // Simple test of the newItem API with a parent assignment - var store = new dojo.data.ItemFileWriteStore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries")); - - var deferred = new doh.Deferred(); - doh.assertTrue(!store.isDirty()); - function onComplete(items, request){ - doh.assertEqual(1, items.length); - var item = items[0]; - doh.assertTrue(store.containsValue(item, "name", "Egypt")); - - //Attach an onNew to validate we get expected values. - var onNewInvoked = false; - store.onNew = function(newItem, parentInfo){ - doh.assertEqual(item, parentInfo.item); - doh.assertEqual("cities", parentInfo.attribute); - doh.assertTrue(parentInfo.oldValue === undefined); - doh.assertTrue(parentInfo.newValue === newItem); - onNewInvoked = true; - }; - - //Attach an onSet and verify onSet is NOT called in this case. - store.onSet = function(item, attribute, oldValue, newValue){ - doh.assertTrue(false); - }; - - //See if we can add in a new item representing the city of Cairo. - //This should also call the onNew set above.... - var newItem = store.newItem({name: "Cairo", abbr: "Cairo"}, {parent: item, attribute: "cities"}); - doh.assertTrue(onNewInvoked); - - function onCompleteNewItemShallow(items, request){ - doh.assertEqual(0, items.length); - function onCompleteNewItemDeep(items, request){ - doh.assertEqual(1, items.length); - var item = items[0]; - doh.assertEqual("Cairo", store.getValue(item, "name")); - deferred.callback(true); - } - //Do a deep search now, should find the new item of the city with name attribute Cairo. - store.fetch({query:{name:"Cairo"}, onComplete: onCompleteNewItemDeep, onError: onError, queryOptions: {deep:true}}); - } - //Do a shallow search first, should find nothing. - store.fetch({query:{name:"Cairo"}, onComplete: onCompleteNewItemShallow, onError: onError}); - } - function onError(error, request){ - deferred.errback(error); - } - store.fetch({query:{name:"Egypt"}, onComplete: onComplete, onError: onError}); - return deferred; //Object - }, - - function testWriteAPI_newItem_multiple_withParent(){ - // summary: - // Simple test of the newItem API with a parent assignment multiple times. - // description: - // Simple test of the newItem API with a parent assignment multiple times. - var store = new dojo.data.ItemFileWriteStore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries")); - - var deferred = new doh.Deferred(); - - doh.assertTrue(!store.isDirty()); - - function onComplete(items, request){ - doh.assertEqual(1, items.length); - var item = items[0]; - doh.assertTrue(store.containsValue(item, "name", "Egypt")); - - //Attach an onNew to validate we get expected values. - store.onNew = function(newItem, parentInfo){ - doh.assertEqual(item, parentInfo.item); - doh.assertEqual("cities", parentInfo.attribute); - - doh.assertTrue(parentInfo.oldValue === undefined); - - doh.assertTrue(parentInfo.newValue === newItem); - }; - - //See if we can add in a new item representing the city of Cairo. - //This should also call the onNew set above.... - var newItem1 = store.newItem({name: "Cairo", abbr: "Cairo"}, {parent: item, attribute: "cities"}); - - //Attach a new onNew to validate we get expected values. - store.onNew = function(newItem, parentInfo){ - doh.assertEqual(item, parentInfo.item); - doh.assertEqual("cities", parentInfo.attribute); - - console.log(parentInfo.oldValue); - doh.assertTrue(parentInfo.oldValue == newItem1); - - doh.assertTrue(parentInfo.newValue[0] == newItem1); - doh.assertTrue(parentInfo.newValue[1] == newItem); - }; - var newItem2 = store.newItem({name: "Banha", abbr: "Banha"}, {parent: item, attribute: "cities"}); - - //Attach a new onNew to validate we get expected values. - store.onNew = function(newItem, parentInfo){ - doh.assertEqual(item, parentInfo.item); - doh.assertEqual("cities", parentInfo.attribute); - - doh.assertTrue(parentInfo.oldValue[0] == newItem1); - doh.assertTrue(parentInfo.oldValue[1] == newItem2); - - doh.assertTrue(parentInfo.newValue[0] == newItem1); - doh.assertTrue(parentInfo.newValue[1] == newItem2); - doh.assertTrue(parentInfo.newValue[2] == newItem); - }; - var newItem3 = store.newItem({name: "Damanhur", abbr: "Damanhur"}, {parent: item, attribute: "cities"}); - deferred.callback(true); - } - function onError(error, request){ - deferred.errback(error); - } - store.fetch({query:{name:"Egypt"}, onComplete: onComplete, onError: onError}); - return deferred; //Object - }, - - function testWriteAPI_deleteItem(){ - // summary: - // Simple test of the deleteItem API - // description: - // Simple test of the deleteItem API - var store = new dojo.data.ItemFileWriteStore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries")); - - var deferred = new doh.Deferred(); - function onComplete(items, request){ - doh.assertEqual(1, items.length); - var item = items[0]; - doh.assertTrue(store.containsValue(item, "name", "Egypt")); - doh.assertTrue(store.isDirty(item) == false); - doh.assertTrue(!store.isDirty()); - store.deleteItem(item); - doh.assertTrue(store.isDirty(item)); - doh.assertTrue(store.isDirty()); - function onCompleteToo(itemsToo, requestToo) { - doh.assertEqual(0, itemsToo.length); - deferred.callback(true); - } - store.fetch({query:{name:"Egypt"}, onComplete: onCompleteToo, onError: onError}); - } - function onError(error, request){ - deferred.errback(error); - } - store.fetch({query:{name:"Egypt"}, onComplete: onComplete, onError: onError}); - return deferred; //Object - }, - function testWriteAPI_isDirty(){ - // summary: - // Simple test of the isDirty API - // description: - // Simple test of the isDirty API - var store = new dojo.data.ItemFileWriteStore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries")); - - var deferred = new doh.Deferred(); - function onComplete(items, request) { - doh.assertEqual(1, items.length); - var item = items[0]; - doh.assertTrue(store.containsValue(item, "name", "Egypt")); - store.setValue(item, "name", "Egypt 2"); - doh.assertTrue(store.getValue(item, "name") == "Egypt 2"); - doh.assertTrue(store.isDirty(item)); - deferred.callback(true); - } - function onError(error, request) { - deferred.errback(error); - } - store.fetch({query:{name:"Egypt"}, onComplete: onComplete, onError: onError}); - return deferred; //Object - }, - function testWriteAPI_revert(){ - // summary: - // Simple test of the revert API - // description: - // Simple test of the revert API - var store = new dojo.data.ItemFileWriteStore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries")); - - var deferred = new doh.Deferred(); - function onComplete(items, request) { - doh.assertEqual(1, items.length); - var item = items[0]; - doh.assertTrue(store.containsValue(item, "name", "Egypt")); - doh.assertTrue(store.isDirty(item) == false); - doh.assertTrue(!store.isDirty()); - store.setValue(item, "name", "Egypt 2"); - doh.assertTrue(store.getValue(item, "name") == "Egypt 2"); - doh.assertTrue(store.isDirty(item)); - doh.assertTrue(store.isDirty()); - store.revert(); - - //Fetch again to see if it reset the state. - function onCompleteToo(itemsToo, requestToo){ - doh.assertEqual(1, itemsToo.length); - var itemToo = itemsToo[0]; - doh.assertTrue(store.containsValue(itemToo, "name", "Egypt")); - deferred.callback(true); - } - store.fetch({query:{name:"Egypt"}, onComplete: onCompleteToo, onError: onError}); - } - function onError(error, request){ - deferred.errback(error); - } - store.fetch({query:{name:"Egypt"}, onComplete: onComplete, onError: onError}); - return deferred; //Object - }, - function testWriteAPI_save(){ - // summary: - // Simple test of the save API - // description: - // Simple test of the save API - var store = new dojo.data.ItemFileWriteStore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries")); - - var deferred = new doh.Deferred(); - function onError(error){ - deferred.errback(error); - } - function onItem(item){ - store.setValue(item, "capital", "New Cairo"); - function onComplete() { - deferred.callback(true); - } - store.save({onComplete:onComplete, onError:onError}); - } - store.fetchItemByIdentity({identity:"eg", onItem:onItem, onError:onError}); - return deferred; //Object - }, - function testWriteAPI_saveVerifyState(){ - // summary: - // Simple test of the save API - // description: - // Simple test of the save API - var store = new dojo.data.ItemFileWriteStore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries")); - - var deferred = new doh.Deferred(); - function onError(error){ - deferred.errback(error); - } - function onItem(item){ - store.setValue(item, "capital", "New Cairo"); - function onComplete() { - //Check internal state. Note: Users should NOT do this, this is a UT verification - //of internals in this case. Ref tracker: #4394 - doh.assertTrue(!store._saveInProgress); - deferred.callback(true); - } - store.save({onComplete:onComplete, onError:onError}); - } - store.fetchItemByIdentity({identity:"eg", onItem:onItem, onError:onError}); - return deferred; //Object - }, - function testWriteAPI_saveEverything(){ - // summary: - // Simple test of the save API - // description: - // Simple test of the save API - var store = new dojo.data.ItemFileWriteStore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries")); - var egypt; - store._saveEverything = function(saveCompleteCallback, saveFailedCallback, newFileContentString){ - var struct = dojo.fromJson(newFileContentString); - doh.assertEqual(struct.identifier, store.getIdentityAttributes(egypt)[0]); - doh.assertEqual(struct.label, store.getLabelAttributes(egypt)[0]); - doh.assertEqual(struct.items.length, 7); - - var cloneStore = new dojo.data.ItemFileWriteStore({data:struct}); - function onItemClone(itemClone){ - var egyptClone = itemClone; - doh.assertEqual(store.getIdentityAttributes(egypt)[0], cloneStore.getIdentityAttributes(egyptClone)[0]); - doh.assertEqual(store.getLabelAttributes(egypt)[0], cloneStore.getLabelAttributes(egyptClone)[0]); - doh.assertEqual(store.getValue(egypt, "name"), cloneStore.getValue(egyptClone, "name")); - } - cloneStore.fetchItemByIdentity({identity:"eg", onItem:onItemClone, onError:onError}); - - saveCompleteCallback(); - }; - - var deferred = new doh.Deferred(); - function onError(error){ - deferred.errback(error); - } - function onItem(item){ - egypt = item; - function onComplete() { - deferred.callback(true); - } - store.setValue(egypt, "capital", "New Cairo"); - store.save({onComplete:onComplete, onError:onError}); - } - store.fetchItemByIdentity({identity:"eg", onItem:onItem, onError:onError}); - return deferred; //Object - }, - function testWriteAPI_saveEverything_withDateType(){ - // summary: - // Simple test of the save API with a non-atomic type (Date) that has a type mapping. - // description: - // Simple test of the save API with a non-atomic type (Date) that has a type mapping. - var store = new dojo.data.ItemFileWriteStore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries")); - store._saveEverything = function(saveCompleteCallback, saveFailedCallback, newFileContentString){ - - //Now load the new data into a datastore and validate that it stored the date right. - var dataset = dojo.fromJson(newFileContentString); - var newStore = new dojo.data.ItemFileWriteStore({data: dataset}); - - function gotItem(item){ - var independenceDate = newStore.getValue(item,"independence"); - doh.assertTrue(independenceDate instanceof Date); - doh.assertTrue(dojo.date.compare(new Date(1993,04,24), independenceDate, "date") === 0); - saveCompleteCallback(); - } - function failed(error, request){ - deferred.errback(error); - saveFailedCallback(); - } - newStore.fetchItemByIdentity({identity:"eg", onItem:gotItem, onError:failed}); - }; - - var deferred = new doh.Deferred(); - function onError(error){ - deferred.errback(error); - } - function onItem(item){ - function onComplete() { - deferred.callback(true); - } - store.setValue(item, "independence", new Date(1993,04,24)); - store.save({onComplete:onComplete, onError:onError}); - } - store.fetchItemByIdentity({identity:"eg", onItem:onItem, onError:onError}); - return deferred; //Object - }, - function testWriteAPI_saveEverything_withCustomColorTypeSimple(){ - // summary: - // Simple test of the save API with a non-atomic type (dojo.Color) that has a type mapping. - // description: - // Simple test of the save API with a non-atomic type (dojo.Color) that has a type mapping. - - //Set up the store basics: What data it has, and what to do when save is called for saveEverything - //And how to map the 'Color' type in and out of the format. - //(Test of saving all to a some location...) - var dataset = { - identifier:'name', - items: [ - { name:'Kermit', species:'frog', color:{_type:'Color', _value:'green'} }, - { name:'Beaker', hairColor:{_type:'Color', _value:'red'} } - ] - }; - - var customTypeMap = {'Color': dojo.Color }; - - var store = new dojo.data.ItemFileWriteStore({ - data:dataset, - typeMap: customTypeMap - }); - - store._saveEverything = function(saveCompleteCallback, saveFailedCallback, newFileContentString){ - //Now load the new data into a datastore and validate that it stored the Color right. - var dataset = dojo.fromJson(newFileContentString); - var newStore = new dojo.data.ItemFileWriteStore({data: dataset, typeMap: customTypeMap}); - - function gotItem(item){ - var hairColor = newStore.getValue(item,"hairColor"); - doh.assertTrue(hairColor instanceof dojo.Color); - doh.assertEqual("rgba(255, 255, 0, 1)", hairColor.toString()); - saveCompleteCallback(); - } - function failed(error, request){ - deferred.errback(error); - saveFailedCallback(); - } - newStore.fetchItemByIdentity({identity:"Animal", onItem:gotItem, onError:failed}); - }; - - //Add a new item with a color type, then save it. - var deferred = new doh.Deferred(); - function onError(error){ - deferred.errback(error); - } - function onComplete() { - deferred.callback(true); - } - - var animal = store.newItem({name: "Animal", hairColor: new dojo.Color("yellow")}); - store.save({onComplete:onComplete, onError:onError}); - return deferred; //Object - }, - function testWriteAPI_saveEverything_withCustomColorTypeGeneral(){ - // summary: - // Simple test of the save API with a non-atomic type (dojo.Color) that has a type mapping. - // description: - // Simple test of the save API with a non-atomic type (dojo.Color) that has a type mapping. - - //Set up the store basics: What data it has, and what to do when save is called for saveEverything - //And how to map the 'Color' type in and out of the format. - //(Test of saving all to a some location...) - var dataset = { - identifier:'name', - items: [ - { name:'Kermit', species:'frog', color:{_type:'Color', _value:'green'} }, - { name:'Beaker', hairColor:{_type:'Color', _value:'red'} } - ] - }; - - var customTypeMap = {'Color': { - type: dojo.Color, - deserialize: function(value){ - return new dojo.Color(value); - }, - serialize: function(obj){ - return obj.toString(); - } - } - } - var store = new dojo.data.ItemFileWriteStore({ - data:dataset, - typeMap: customTypeMap - }); - store._saveEverything = function(saveCompleteCallback, saveFailedCallback, newFileContentString){ - //Now load the new data into a datastore and validate that it stored the Color right. - var dataset = dojo.fromJson(newFileContentString); - var newStore = new dojo.data.ItemFileWriteStore({data: dataset, typeMap: customTypeMap}); - - function gotItem(item){ - var hairColor = newStore.getValue(item,"hairColor"); - doh.assertTrue(hairColor instanceof dojo.Color); - doh.assertEqual("rgba(255, 255, 0, 1)", hairColor.toString()); - saveCompleteCallback(); - } - function failed(error, request){ - deferred.errback(error); - saveFailedCallback(); - } - newStore.fetchItemByIdentity({identity:"Animal", onItem:gotItem, onError:failed}); - }; - - //Add a new item with a color type, then save it. - var deferred = new doh.Deferred(); - function onError(error){ - deferred.errback(error); - } - function onComplete() { - deferred.callback(true); - } - - var animal = store.newItem({name: "Animal", hairColor: new dojo.Color("yellow")}); - store.save({onComplete:onComplete, onError:onError}); - return deferred; //Object - }, - function testWriteAPI_newItem_revert(){ - // summary: - // Test for bug #5357. Ensure that the revert properly nulls the identity position - // for a new item after revert. - var args = {data: { - label:"name", - items:[ - {name:'Ecuador', capital:'Quito'}, - {name:'Egypt', capital:'Cairo'}, - {name:'El Salvador', capital:'San Salvador'}, - {name:'Equatorial Guinea', capital:'Malabo'}, - {name:'Eritrea', capital:'Asmara'}, - {name:'Estonia', capital:'Tallinn'}, - {name:'Ethiopia', capital:'Addis Ababa'} - ] - } }; - var store = new dojo.data.ItemFileWriteStore(args); - - var newCountry = store.newItem({name: "Utopia", capitol: "Perfect"}); - - //DO NOT ACCESS THIS WAY. THESE ARE INTERNAL VARIABLES. DOING THIS FOR TEST PURPOSES. - var itemEntryNum = newCountry[store._itemNumPropName]; - doh.assertTrue(store._arrayOfAllItems[itemEntryNum] === newCountry); - store.revert(); - doh.assertTrue(store._arrayOfAllItems[itemEntryNum] === null); - }, - function testNotificationAPI_onSet(){ - // summary: - // Simple test of the onSet API - // description: - // Simple test of the onSet API - var store = new dojo.data.ItemFileWriteStore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries")); - - var deferred = new doh.Deferred(); - function onError(error){ - deferred.errback(error); - } - function onItem(fetchedItem){ - var egypt = fetchedItem; - var connectHandle = null; - function setValueHandler(item, attribute, oldValue, newValue){ - doh.assertTrue(store.isItem(item)); - doh.assertTrue(item == egypt); - doh.assertTrue(attribute == "capital"); - doh.assertTrue(oldValue == "Cairo"); - doh.assertTrue(newValue == "New Cairo"); - deferred.callback(true); - dojo.disconnect(connectHandle); - } - connectHandle = dojo.connect(store, "onSet", setValueHandler); - store.setValue(egypt, "capital", "New Cairo"); - } - store.fetchItemByIdentity({identity:"eg", onItem:onItem, onError:onError}); - }, - function testNotificationAPI_onNew(){ - // summary: - // Simple test of the onNew API - // description: - // Simple test of the onNew API - var store = new dojo.data.ItemFileWriteStore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries")); - - var deferred = new doh.Deferred(); - var connectHandle = null; - function newItemHandler(item){ - doh.assertTrue(store.isItem(item)); - doh.assertTrue(store.getValue(item, "name") == "Canada"); - deferred.callback(true); - dojo.disconnect(connectHandle); - } - connectHandle = dojo.connect(store, "onNew", newItemHandler); - var canada = store.newItem({name:"Canada", abbr:"ca", capital:"Ottawa"}); - }, - function testNotificationAPI_onDelete(){ - // summary: - // Simple test of the onDelete API - // description: - // Simple test of the onDelete API - var store = new dojo.data.ItemFileWriteStore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries")); - - var deferred = new doh.Deferred(); - function onError(error){ - deferred.errback(error); - } - function onItem(fetchedItem){ - var egypt = fetchedItem; - var connectHandle = null; - function deleteItemHandler(item){ - doh.assertTrue(store.isItem(item) == false); - doh.assertTrue(item == egypt); - deferred.callback(true); - dojo.disconnect(connectHandle); - } - connectHandle = dojo.connect(store, "onDelete", deleteItemHandler); - store.deleteItem(egypt); - } - store.fetchItemByIdentity({identity:"eg", onItem:onItem, onError:onError}); - }, - function testReadAPI_functionConformanceToo(){ - // summary: - // Simple test read API conformance. Checks to see all declared functions are actual functions on the instances. - // description: - // Simple test read API conformance. Checks to see all declared functions are actual functions on the instances. - var testStore = new dojo.data.ItemFileWriteStore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries")); - var readApi = new dojo.data.api.Read(); - var passed = true; - - for(var functionName in readApi){ - var member = readApi[functionName]; - //Check that all the 'Read' defined functions exist on the test store. - if(typeof member === "function"){ - var testStoreMember = testStore[functionName]; - if(!(typeof testStoreMember === "function")){ - passed = false; - break; - } - } - } - doh.assertTrue(passed); - }, - function testWriteAPI_functionConformance(){ - // summary: - // Simple test write API conformance. Checks to see all declared functions are actual functions on the instances. - // description: - // Simple test write API conformance. Checks to see all declared functions are actual functions on the instances. - var testStore = new dojo.data.ItemFileWriteStore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries")); - var writeApi = new dojo.data.api.Write(); - var passed = true; - - for(var functionName in writeApi){ - var member = writeApi[functionName]; - //Check that all the 'Write' defined functions exist on the test store. - if(typeof member === "function"){ - var testStoreMember = testStore[functionName]; - if(!(typeof testStoreMember === "function")){ - passed = false; - break; - } - } - } - doh.assertTrue(passed); - }, - function testNotificationAPI_functionConformance(){ - // summary: - // Simple test Notification API conformance. Checks to see all declared functions are actual functions on the instances. - // description: - // Simple test Notification API conformance. Checks to see all declared functions are actual functions on the instances. - var testStore = new dojo.data.ItemFileWriteStore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries")); - var api = new dojo.data.api.Notification(); - var passed = true; - - for(var functionName in api){ - var member = api[functionName]; - //Check that all the 'Write' defined functions exist on the test store. - if(typeof member === "function"){ - var testStoreMember = testStore[functionName]; - if(!(typeof testStoreMember === "function")){ - passed = false; - break; - } - } - } - doh.assertTrue(passed); - }, - function testIdentityAPI_noIdentifierSpecified(){ - // summary: - // Test for bug #3873. Given a datafile that does not specify an - // identifier, make sure ItemFileWriteStore auto-creates identities - // that are unique even after calls to deleteItem() and newItem() - var args = {data: { - label:"name", - items:[ - {name:'Ecuador', capital:'Quito'}, - {name:'Egypt', capital:'Cairo'}, - {name:'El Salvador', capital:'San Salvador'}, - {name:'Equatorial Guinea', capital:'Malabo'}, - {name:'Eritrea', capital:'Asmara'}, - {name:'Estonia', capital:'Tallinn'}, - {name:'Ethiopia', capital:'Addis Ababa'} - ] - } }; - var store = new dojo.data.ItemFileWriteStore(args); - var deferred = new doh.Deferred(); - - var onError = function(error, request){ - deferred.errback(error); - } - var onComplete = function(items, request){ - doh.assertEqual(7, items.length); - - var lastItem = items[(items.length - 1)]; - var idOfLastItem = store.getIdentity(lastItem); - store.deleteItem(lastItem); - store.newItem({name:'Canada', capital:'Ottawa'}); - - var onCompleteAgain = function(itemsAgain, requestAgain){ - doh.assertEqual(7, itemsAgain.length); - var identitiesInUse = {}; - for(var i = 0; i < itemsAgain.length; ++i){ - var item = itemsAgain[i]; - var id = store.getIdentity(item); - if(identitiesInUse.hasOwnProperty(id)){ - // there should not already be an entry for this id - doh.assertTrue(false); - }else{ - // we want to add the entry now - identitiesInUse[id] = item; - } - } - deferred.callback(true); - } - store.fetch({onComplete:onCompleteAgain, onError:onError}); - } - - store.fetch({onComplete:onComplete, onError:onError}); - return deferred; - }, - function testIdentityAPI_noIdentifierSpecified_revert(){ - // summary: - // Test for bug #4691 Given a datafile that does not specify an - // identifier, make sure ItemFileWriteStore auto-creates identities - // that are unique even after calls to deleteItem() and newItem() - var args = {data: { - label:"name", - items:[ - {name:'Ecuador', capital:'Quito'}, - {name:'Egypt', capital:'Cairo'}, - {name:'El Salvador', capital:'San Salvador'}, - {name:'Equatorial Guinea', capital:'Malabo'}, - {name:'Eritrea', capital:'Asmara'}, - {name:'Estonia', capital:'Tallinn'}, - {name:'Ethiopia', capital:'Addis Ababa'} - ] - } }; - var store = new dojo.data.ItemFileWriteStore(args); - var deferred = new doh.Deferred(); - - var onError = function(error, request){ - deferred.errback(error); - } - var onComplete = function(items, request){ - doh.assertEqual(7, items.length); - - var lastItem = items[(items.length - 1)]; - var idOfLastItem = store.getIdentity(lastItem); - store.deleteItem(lastItem); - store.newItem({name:'Canada', capital:'Ottawa'}); - - var onCompleteAgain = function(itemsAgain, requestAgain){ - doh.assertEqual(7, itemsAgain.length); - var identitiesInUse = {}; - for(var i = 0; i < itemsAgain.length; ++i){ - var item = itemsAgain[i]; - var id = store.getIdentity(item); - if(identitiesInUse.hasOwnProperty(id)){ - // there should not already be an entry for this id - doh.assertTrue(false); - }else{ - // we want to add the entry now - identitiesInUse[id] = item; - } - } - //Last test, revert everything and check item sizes. - store.revert(); - - //Now call fetch again and verify store state. - var revertComplete = function(itemsReverted, request){ - doh.assertEqual(7, itemsReverted.length); - deferred.callback(true); - } - store.fetch({onComplete:revertComplete, onError:onError}); - } - store.fetch({onComplete:onCompleteAgain, onError:onError}); - } - store.fetch({onComplete:onComplete, onError:onError}); - return deferred; - }, - function testReferenceIntegrity_checkReferences(){ - // summary: - // Simple test to verify the references were properly resolved. - // description: - // Simple test to verify the references were properly resolved. - - var store = new dojo.data.ItemFileWriteStore(tests.data.ItemFileWriteStore.getTestData("reference_integrity")); - - var deferred = new doh.Deferred(); - function onError(error, request){ - deferred.errback(error); - } - function onComplete(items, request){ - - var item10 = null; - var item1 = null; - var item3 = null; - var item5 = null; - - for (var i = 0; i < items.length; i++) { - var ident = store.getIdentity(items[i]); - if (ident === 10) { - item10 = items[i]; - }else if (ident === 1) { - item1 = items[i]; - }else if (ident === 3) { - item3 = items[i]; - }else if (ident === 5) { - item5 = items[i]; - } - } - var friends = store.getValues(item10, "friends"); - doh.assertTrue(friends !== null); - doh.assertTrue(friends !== undefined); - - doh.assertTrue(store.isItem(item10)); - doh.assertTrue(store.isItem(item1)); - doh.assertTrue(store.isItem(item3)); - doh.assertTrue(store.isItem(item5)); - var found = 0; - try{ - for (var i = 0; i < friends.length; i++) { - if (i === 0) { - doh.assertTrue(store.isItem(friends[i])); - doh.assertEqual(friends[i], item1); - doh.assertEqual(store.getIdentity(friends[i]), 1); - found++; - }else if (i === 1) { - doh.assertTrue(store.isItem(friends[i])); - doh.assertEqual(friends[i], item3); - doh.assertEqual(store.getIdentity(friends[i]), 3); - found++; - }else if (i === 2) { - doh.assertTrue(store.isItem(friends[i])); - doh.assertEqual(friends[i], item5); - doh.assertEqual(store.getIdentity(friends[i]), 5); - found++; - } - } - }catch(e){ - doh.errback(e); - } - doh.assertEqual(3, found); - deferred.callback(true); - } - store.fetch({onError: onError, onComplete: onComplete}); - return deferred; - }, - function testReferenceIntegrity_deleteReferencedItem(){ - // summary: - // Simple test to verify the references were properly deleted. - // description: - // Simple test to verify the references were properly deleted. - - var store = new dojo.data.ItemFileWriteStore(tests.data.ItemFileWriteStore.getTestData("reference_integrity")); - - var deferred = new doh.Deferred(); - var passed = true; - function onError(error, request){ - deferred.errback(error); - } - function onItem(item, request){ - try{ - console.log("Before delete map state is: " + dojo.toJson(item[store._reverseRefMap])); - store.deleteItem(item); - console.log("After delete map state is: " + dojo.toJson(item[store._reverseRefMap])); - function verifyRefDelete(items, request){ - var passed = true; - for(var i = 0; i < items.length; i++){ - var curItem = items[i]; - var attributes = store.getAttributes(curItem); - for(var j = 0; j < attributes.length; j++){ - var values = store.getValues(curItem, attributes[j]); - var badRef = false; - for(var k = 0; k < values.length; k++){ - var value = values[k]; - try{ - var id = store.getIdentity(value); - if(id == 10){ - badRef = true; - break; - } - }catch(e){/*Not an item, even a dead one, just eat it.*/} - } - if(badRef){ - deferred.errback(new Error("Found a reference remaining to a deleted item. Failure.")); - passed = false; - break; - } - } - } - if(passed){ - deferred.callback(true); - } - } - store.fetch({onComplete: verifyRefDelete, onError: onError}); - }catch(error){ - deferred.errback(error); - } - } - store.fetchItemByIdentity({identity: 10, onError: onError, onItem: onItem}); - return deferred; - }, - function testReferenceIntegrity_deleteReferencedItemThenRevert(){ - // summary: - // Simple test to verify the references were properly deleted. - // description: - // Simple test to verify the references were properly deleted. - - var store = new dojo.data.ItemFileWriteStore(tests.data.ItemFileWriteStore.getTestData("reference_integrity")); - - var deferred = new doh.Deferred(); - var passed = true; - function onError(error, request){ - deferred.errback(error); - } - function onItem(item, request){ - try{ - //DO NOT EVER ACCESS THESE VARIABLES LIKE THIS! - //THIS IS FOR TESTING INTERNAL STATE! - console.log("Map before delete:"); - store._dumpReferenceMap(); - var beforeDelete = dojo.toJson(item[store._reverseRefMap]); - store.deleteItem(item); - console.log("Map after delete:"); - store._dumpReferenceMap(); - var afterDelete = dojo.toJson(item[store._reverseRefMap]); - store.revert(); - console.log("Map after revert:"); - store._dumpReferenceMap(); - var afterRevert = dojo.toJson(item[store._reverseRefMap]); - doh.assertTrue(afterRevert === beforeDelete); - }catch(e){ - deferred.errback(e); - passed = false; - } - if(passed){ - deferred.callback(true); - } - } - store.fetchItemByIdentity({identity: 10, onError: onError, onItem: onItem}); - return deferred; - }, - function testReferenceIntegrity_deleteMultipleItemsWithReferencesAndRevert(){ - // summary: - // Simple test to verify that a flow of deleting items with references and reverting does not damage the internal structure. - // Created for tracker bug: #5743 - // description: - // Simple test to verify that a flow of deleting items with references and reverting does not damage the internal structure. - // Created for tracker bug: #5743 - - var store = new dojo.data.ItemFileWriteStore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries_references")); - - var deferred = new doh.Deferred(); - var passed = true; - function onError(error, request){ - deferred.errback(error); - doh.assertTrue(false); - } - function onItem(item, request){ - //Save off the located item, then locate another one (peer to Egypt) - doh.assertTrue(store.isItem(item)); - var egypt = item; - - function onItem2(item, request){ - doh.assertTrue(store.isItem(item)); - var nairobi = item; - - //Delete them - store.deleteItem(egypt); - store.deleteItem(nairobi); - try{ - //Revert, then do a fetch. If the internals have been damaged, this will generally - //cause onError to fire instead of onComplete. - store.revert(); - function onComplete(items, request){ - deferred.callback(true); - } - store.fetch({query: {name: "*"}, start: 0, count: 20, onComplete: onComplete, onError: onError}); - }catch(e){ - deferred.errback(e) - } - } - store.fetchItemByIdentity({identity: "Nairobi", onError: onError, onItem: onItem2}); - } - store.fetchItemByIdentity({identity: "Egypt", onError: onError, onItem: onItem}); - return deferred; - }, - function testReferenceIntegrity_removeReferenceFromAttribute(){ - // summary: - // Simple test to verify the reference removal updates the internal map. - // description: - // Simple test to verify the reference removal updates the internal map. - - var store = new dojo.data.ItemFileWriteStore(tests.data.ItemFileWriteStore.getTestData("reference_integrity")); - - var deferred = new doh.Deferred(); - var passed = true; - function onError(error, request){ - deferred.errback(error); - doh.assertTrue(false); - } - function onItem(item, request){ - try{ - store.setValues(item, "friends", [null]); - - function onItem2(item10, request){ - //DO NOT EVER ACCESS THESE VARIABLES LIKE THIS! - //THIS IS FOR TESTING INTERNAL STATE! - var refMap = item10[store._reverseRefMap]; - store._dumpReferenceMap(); - - console.log("MAP for Item 10 is: " + dojo.toJson(refMap)); - - //Assert there is no reference to item 10 in item 11's attribute 'friends'. - doh.assertTrue(!refMap["11"]["friends"]); - store.setValues(item, "siblings", [0, 1, 2]); - //Assert there are no more references to 10 in 11. Ergo, "11" should be a 'undefined' attribute for the map of items referencing '10'.. - doh.assertTrue(!refMap["11"]); - deferred.callback(true); - } - store.fetchItemByIdentity({identity: 10, onError: onError, onItem: onItem2}); - - }catch(e){ - console.debug(e); - deferred.errback(e); - doh.assertTrue(false); - } - } - store.fetchItemByIdentity({identity: 11, onError: onError, onItem: onItem}); - return deferred; - }, - function testReferenceIntegrity_deleteReferencedItemNonParent(){ - // summary: - // Simple test to verify the references to a non-parent item was properly deleted. - // description: - // Simple test to verify the references to a non-parent item was properly deleted. - - var store = new dojo.data.ItemFileWriteStore(tests.data.ItemFileWriteStore.getTestData("reference_integrity")); - - var deferred = new doh.Deferred(); - var passed = true; - function onError(error, request){ - deferred.errback(error); - } - function onItem(item, request){ - try{ - console.log("Reference state for item 16 is: " + dojo.toJson(item[store._reverseRefMap])); - store.deleteItem(item); - function verifyRefDelete(items, request){ - var passed = true; - for(var i = 0; i < items.length; i++){ - var curItem = items[i]; - var attributes = store.getAttributes(curItem); - for(var j = 0; j < attributes.length; j++){ - var values = store.getValues(curItem, attributes[j]); - var badRef = false; - for(var k = 0; k < values.length; k++){ - var value = values[k]; - try{ - var id = store.getIdentity(value); - if(id == 16){ - badRef = true; - break; - } - }catch(e){/*Not an item, even a dead one, just eat it.*/} - } - if(badRef){ - deferred.errback(new Error("Found a reference remaining to a deleted item. Failure.")); - passed = false; - break; - } - } - } - if(passed){ - deferred.callback(true); - } - } - store.fetch({onComplete: verifyRefDelete, onError: onError}); - }catch(error){ - deferred.errback(error); - } - } - store.fetchItemByIdentity({identity: 16, onError: onError, onItem: onItem}); - return deferred; - }, - function testReferenceIntegrity_addReferenceToAttribute(){ - // summary: - // Simple test to verify the reference additions can happen. - // description: - // Simple test to verify the reference additions can happen. - - var store = new dojo.data.ItemFileWriteStore(tests.data.ItemFileWriteStore.getTestData("reference_integrity")); - - var deferred = new doh.Deferred(); - var passed = true; - function onError(error, request){ - deferred.errback(error); - doh.assertTrue(false); - } - function onComplete(items, request){ - - doh.assertTrue(items.length > 2); - - var item1 = items[0]; - var item2 = items[1]; - - //DO NOT EVER ACCESS THESE VARIABLES LIKE THIS! - //THIS IS FOR TESTING INTERNAL STATE! - console.log("Map state for Item 1 is: " + dojo.toJson(item1[store._reverseRefMap])); - console.log("Map state for Item 2 is: " + dojo.toJson(item2[store._reverseRefMap])); - - store.setValue(item1, "siblings", item2); - - //Emit the current map state for inspection. - console.log("Map state for Item 1 is: " + dojo.toJson(item1[store._reverseRefMap])); - console.log("Map state for Item 2 is: " + dojo.toJson(item2[store._reverseRefMap])); - - doh.assertTrue(item2[store._reverseRefMap] != null); - - //Assert there is a recorded reference to item 2 in item 1's attribute 'sibling'. - doh.assertTrue(item2[store._reverseRefMap][store.getIdentity(item1)]["siblings"]); - - deferred.callback(true); - } - store.fetch({onError: onError, onComplete: onComplete}); - return deferred; - }, - function testReferenceIntegrity_newItemWithParentReference(){ - // summary: - // Simple test to verify that newItems with a parent properly record the parent's reference in the map. - // description: - // Simple test to verify that newItems with a parent properly record the parent's reference in the map. - - var store = new dojo.data.ItemFileWriteStore(tests.data.ItemFileWriteStore.getTestData("reference_integrity")); - - var deferred = new doh.Deferred(); - var passed = true; - function onError(error, request){ - deferred.errback(error); - doh.assertTrue(false); - } - function onItem(item, request){ - try{ - //Create a new item and set its parent to item 10's uncle attribute. - var newItem = store.newItem({id: 17, name: "Item 17"}, {parent: item, attribute: "uncles"}); - - //DO NOT EVER ACCESS THESE VARIABLES LIKE THIS! - //THIS IS FOR TESTING INTERNAL STATE! - //Look up the references to 17, as item 10 has one now on attribute 'uncles' - var refs = newItem[store._reverseRefMap]; - - //Assert there is a reference from 10 to item 17, on attribute uncle - doh.assertTrue(refs["10"]["uncles"]); - - console.log("State of map of item 17 after newItem: " + dojo.toJson(refs)); - }catch(e){ - console.debug(e); - deferred.errback(e); - doh.assertTrue(false); - passed = false; - } - if(passed){ - deferred.callback(true); - } - } - store.fetchItemByIdentity({identity: 10, onError: onError, onItem: onItem}); - return deferred; - }, - function testReferenceIntegrity_newItemWithReferenceToExistingItem(){ - // summary: - // Simple test to verify that a new item with references to existing items properly record the references in the map. - // description: - // Simple test to verify that a new item with references to existing items properly record the references in the map. - - var store = new dojo.data.ItemFileWriteStore(tests.data.ItemFileWriteStore.getTestData("reference_integrity")); - - var deferred = new doh.Deferred(); - var passed = true; - function onError(error, request){ - deferred.errback(error); - doh.assertTrue(false); - } - function onItem(item, request){ - try{ - //DO NOT EVER ACCESS THESE VARIABLES LIKE THIS! - //THIS IS FOR TESTING INTERNAL STATE! - console.log("State of reference map to item 10 before newItem: " + dojo.toJson(item[store._reverseRefMap])); - - //Create a new item and set its parent to item 10's uncle attribute. - var newItem = store.newItem({id: 17, name: "Item 17", friends: [item]}); - - //DO NOT EVER ACCESS THESE VARIABLES LIKE THIS! - //THIS IS FOR TESTING INTERNAL STATE! - //Look up the references to 10, as item 17 has one on friends now. - var refs = item[store._reverseRefMap]; - - //Assert there is a reference from 15 to item 10, on attribute friends - doh.assertTrue(refs["17"]["friends"]); - - console.log("State of reference map to item 10 after newItem: " + dojo.toJson(refs)); - }catch(e){ - console.debug(e); - deferred.errback(e); - doh.assertTrue(false); - passed = false; - } - if(passed){ - deferred.callback(true); - } - } - store.fetchItemByIdentity({identity: 10, onError: onError, onItem: onItem}); - return deferred; - }, - function testReferenceIntegrity_disableReferenceIntegrity(){ - // summary: - // Simple test to verify reference integrity can be disabled. - // description: - // Simple test to verify reference integrity can be disabled. - - var params = tests.data.ItemFileWriteStore.getTestData("reference_integrity"); - params.referenceIntegrity = false; - var store = new dojo.data.ItemFileWriteStore(params); - - var deferred = new doh.Deferred(); - function onError(error, request){ - deferred.errback(error); - doh.assertTrue(false); - } - function onItem(item, request){ - //DO NOT EVER ACCESS THESE VARIABLES LIKE THIS! - //THIS IS FOR TESTING INTERNAL STATE! - if(item[store._reverseRefMap] === undefined){ - deferred.callback(true); - }else{ - deferred.errback(new Error("Disabling of reference integrity failed.")); - } - } - store.fetchItemByIdentity({identity: 10, onError: onError, onItem: onItem}); - return deferred; - } - ] -); - - - -} diff --git a/includes/js/dojo/tests/data/countries.json b/includes/js/dojo/tests/data/countries.json deleted file mode 100644 index 71631da..0000000 --- a/includes/js/dojo/tests/data/countries.json +++ /dev/null @@ -1,11 +0,0 @@ -{ identifier: 'abbr', - label: 'name', - items: [ - { abbr:'ec', name:'Ecuador', capital:'Quito' }, - { abbr:'eg', name:'Egypt', capital:'Cairo' }, - { abbr:'sv', name:'El Salvador', capital:'San Salvador' }, - { abbr:'gq', name:'Equatorial Guinea', capital:'Malabo' }, - { abbr:'er', name:'Eritrea', capital:'Asmara' }, - { abbr:'ee', name:'Estonia', capital:'Tallinn' }, - { abbr:'et', name:'Ethiopia', capital:'Addis Ababa' } -]} diff --git a/includes/js/dojo/tests/data/countries_commentFiltered.json b/includes/js/dojo/tests/data/countries_commentFiltered.json deleted file mode 100644 index 319e429..0000000 --- a/includes/js/dojo/tests/data/countries_commentFiltered.json +++ /dev/null @@ -1,12 +0,0 @@ -/* -{ identifier: 'abbr', - items: [ - { abbr:'ec', name:'Ecuador', capital:'Quito' }, - { abbr:'eg', name:'Egypt', capital:'Cairo' }, - { abbr:'sv', name:'El Salvador', capital:'San Salvador' }, - { abbr:'gq', name:'Equatorial Guinea', capital:'Malabo' }, - { abbr:'er', name:'Eritrea', capital:'Asmara' }, - { abbr:'ee', name:'Estonia', capital:'Tallinn' }, - { abbr:'et', name:'Ethiopia', capital:'Addis Ababa' } -]} -*/ diff --git a/includes/js/dojo/tests/data/countries_idcollision.json b/includes/js/dojo/tests/data/countries_idcollision.json deleted file mode 100644 index a0c4a7b..0000000 --- a/includes/js/dojo/tests/data/countries_idcollision.json +++ /dev/null @@ -1,10 +0,0 @@ -{ identifier: 'abbr', - items: [ - { abbr:'ec', name:'Ecuador', capital:'Quito' }, - { abbr:'sv', name:'El Salvador', capital:'San Salvador' }, - { abbr:'gq', name:'Equatorial Guinea', capital:'Malabo' }, - { abbr:'er', name:'Eritrea', capital:'Asmara' }, - { abbr:'ec', name:'Egypt', capital:'Cairo' }, - { abbr:'ee', name:'Estonia', capital:'Tallinn' }, - { abbr:'et', name:'Ethiopia', capital:'Addis Ababa' } -]} diff --git a/includes/js/dojo/tests/data/countries_references.json b/includes/js/dojo/tests/data/countries_references.json deleted file mode 100644 index 136f3c2..0000000 --- a/includes/js/dojo/tests/data/countries_references.json +++ /dev/null @@ -1,44 +0,0 @@ -{ 'identifier': 'name', - 'label': 'name', - 'items': [ - { 'name':'Africa', 'type':'continent', - 'children':[{'_reference':'Egypt'}, {'_reference':'Kenya'}, {'_reference':'Sudan'}] }, - { 'name':'Egypt', 'type':'country' }, - { 'name':'Kenya', 'type':'country', - 'children':[{'_reference':'Nairobi'}, {'_reference':'Mombasa'}] }, - { 'name':'Nairobi', 'type':'city' }, - { 'name':'Mombasa', 'type':'city' }, - { 'name':'Sudan', 'type':'country', - 'children':{'_reference':'Khartoum'} }, - { 'name':'Khartoum', 'type':'city' }, - { 'name':'Asia', 'type':'continent', - 'children':[{'_reference':'China'}, {'_reference':'India'}, {'_reference':'Russia'}, {'_reference':'Mongolia'}] }, - { 'name':'China', 'type':'country' }, - { 'name':'India', 'type':'country' }, - { 'name':'Russia', 'type':'country' }, - { 'name':'Mongolia', 'type':'country' }, - { 'name':'Australia', 'type':'continent', 'population':'21 million', - 'children':{'_reference':'Commonwealth of Australia'}}, - { 'name':'Commonwealth of Australia', 'type':'country', 'population':'21 million'}, - { 'name':'Europe', 'type':'continent', - 'children':[{'_reference':'Germany'}, {'_reference':'France'}, {'_reference':'Spain'}, {'_reference':'Italy'}] }, - { 'name':'Germany', 'type':'country' }, - { 'name':'France', 'type':'country' }, - { 'name':'Spain', 'type':'country' }, - { 'name':'Italy', 'type':'country' }, - { 'name':'North America', 'type':'continent', - 'children':[{'_reference':'Mexico'}, {'_reference':'Canada'}, {'_reference':'United States of America'}] }, - { 'name':'Mexico', 'type':'country', 'population':'108 million', area:'1,972,550 sq km', - 'children':[{'_reference':'Mexico City'}, {'_reference':'Guadalajara'}] }, - { 'name':'Mexico City', 'type':'city', 'population':'19 million', 'timezone':'-6 UTC'}, - { 'name':'Guadalajara', 'type':'city', 'population':'4 million', 'timezone':'-6 UTC' }, - { 'name':'Canada', 'type':'country', 'population':'33 million', area:'9,984,670 sq km', - 'children':[{'_reference':'Ottawa'}, {'_reference':'Toronto'}] }, - { 'name':'Ottawa', 'type':'city', 'population':'0.9 million', 'timezone':'-5 UTC'}, - { 'name':'Toronto', 'type':'city', 'population':'2.5 million', 'timezone':'-5 UTC' }, - { 'name':'United States of America', 'type':'country' }, - { 'name':'South America', 'type':'continent', - 'children':[{'_reference':'Brazil'}, {'_reference':'Argentina'}] }, - { 'name':'Brazil', 'type':'country', 'population':'186 million' }, - { 'name':'Argentina', 'type':'country', 'population':'40 million' } -]} diff --git a/includes/js/dojo/tests/data/countries_withBoolean.json b/includes/js/dojo/tests/data/countries_withBoolean.json deleted file mode 100644 index 783d8a8..0000000 --- a/includes/js/dojo/tests/data/countries_withBoolean.json +++ /dev/null @@ -1,11 +0,0 @@ -{ identifier: 'abbr', - items: [ - { abbr:'ec', name:'Ecuador', capital:'Quito', real:true}, - { abbr:'eg', name:'Egypt', capital:'Cairo', real:true}, - { abbr:'sv', name:'El Salvador', capital:'San Salvador', real:true}, - { abbr:'gq', name:'Equatorial Guinea', capital:'Malabo', real:true}, - { abbr:'er', name:'Eritrea', capital:'Asmara', real:true}, - { abbr:'ee', name:'Estonia', capital:'Tallinn', real:true}, - { abbr:'et', name:'Ethiopia', capital:'Addis Ababa', real:true}, - { abbr:'ut', name:'Utopia', capital:'Paradise', real:false} -]} diff --git a/includes/js/dojo/tests/data/countries_withDates.json b/includes/js/dojo/tests/data/countries_withDates.json deleted file mode 100644 index fdd2153..0000000 --- a/includes/js/dojo/tests/data/countries_withDates.json +++ /dev/null @@ -1,21 +0,0 @@ -{ identifier: 'abbr', - label: 'name', - items: [ - { abbr:'ec', name:'Ecuador', capital:'Quito' }, - { abbr:'eg', name:'Egypt', capital:'Cairo' }, - { abbr:'sv', name:'El Salvador', capital:'San Salvador' }, - { abbr:'gq', name:'Equatorial Guinea', capital:'Malabo' }, - { abbr:'er', - name:'Eritrea', - capital:'Asmara', - independence:{_type:'Date', _value:"1993-05-24T00:00:00Z"} // May 24, 1993 in ISO-8601 standard - }, - { abbr:'ee', - name:'Estonia', - capital:'Tallinn', - independence:{_type:'Date', _value:"1991-08-20T00:00:00Z"} // August 20, 1991 in ISO-8601 standard - }, - { abbr:'et', - name:'Ethiopia', - capital:'Addis Ababa' } -]} diff --git a/includes/js/dojo/tests/data/countries_withNull.json b/includes/js/dojo/tests/data/countries_withNull.json deleted file mode 100644 index a0a7a3f..0000000 --- a/includes/js/dojo/tests/data/countries_withNull.json +++ /dev/null @@ -1,10 +0,0 @@ -{ identifier: 'abbr', - items: [ - { abbr:'ec', name:null, capital:'Quito' }, - { abbr:'eg', name:null, capital:'Cairo' }, - { abbr:'sv', name:'El Salvador', capital:'San Salvador' }, - { abbr:'gq', name:'Equatorial Guinea', capital:'Malabo' }, - { abbr:'er', name:'Eritrea', capital:'Asmara' }, - { abbr:'ee', name:null, capital:'Tallinn' }, - { abbr:'et', name:'Ethiopia', capital:'Addis Ababa' } -]} diff --git a/includes/js/dojo/tests/data/countries_withoutid.json b/includes/js/dojo/tests/data/countries_withoutid.json deleted file mode 100644 index 8db3046..0000000 --- a/includes/js/dojo/tests/data/countries_withoutid.json +++ /dev/null @@ -1,10 +0,0 @@ -{ label: 'name', - items: [ - { abbr:'ec', name:'Ecuador', capital:'Quito' }, - { abbr:'eg', name:'Egypt', capital:'Cairo' }, - { abbr:'sv', name:'El Salvador', capital:'San Salvador' }, - { abbr:'gq', name:'Equatorial Guinea', capital:'Malabo' }, - { abbr:'er', name:'Eritrea', capital:'Asmara' }, - { abbr:'ee', name:'Estonia', capital:'Tallinn' }, - { abbr:'et', name:'Ethiopia', capital:'Addis Ababa' } -]} diff --git a/includes/js/dojo/tests/data/data_multitype.json b/includes/js/dojo/tests/data/data_multitype.json deleted file mode 100644 index 449995a..0000000 --- a/includes/js/dojo/tests/data/data_multitype.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "identifier": "count", - "label": "count", - "items": [ - { "count": 1, "value": "true" }, - { "count": 2, "value": true }, - { "count": 3, "value": "false"}, - { "count": 4, "value": false }, - { "count": 5, "value": true }, - { "count": 6, "value": true }, - { "count": 7, "value": "true" }, - { "count": 8, "value": "true" }, - { "count": 9, "value": "false"}, - { "count": 10, "value": false }, - { "count": 11, "value": [false, false]}, - { "count": "12", "value": [false, "true"]} - ] -} diff --git a/includes/js/dojo/tests/data/geography_hierarchy_large.json b/includes/js/dojo/tests/data/geography_hierarchy_large.json deleted file mode 100644 index 71fd29b..0000000 --- a/includes/js/dojo/tests/data/geography_hierarchy_large.json +++ /dev/null @@ -1,44 +0,0 @@ -{ identifier: 'name', - items: [ - { name:'Africa', type:'continent', children:[ - { name:'Egypt', type:'country' }, - { name:'Kenya', type:'country', children:[ - { name:'Nairobi', type:'city' }, - { name:'Mombasa', type:'city' } ] - }, - { name:'Sudan', type:'country', children: - { name:'Khartoum', type:'city' } - } ] - }, - { name:'Asia', type:'continent', children:[ - { name:'China', type:'country' }, - { name:'India', type:'country' }, - { name:'Russia', type:'country' }, - { name:'Mongolia', type:'country' } ] - }, - { name:'Australia', type:'continent', population:'21 million', children: - { name:'Commonwealth of Australia', type:'country', population:'21 million'} - }, - { name:'Europe', type:'continent', children:[ - { name:'Germany', type:'country' }, - { name:'France', type:'country' }, - { name:'Spain', type:'country' }, - { name:'Italy', type:'country' } ] - }, - { name:'North America', type:'continent', children:[ - { name:'Mexico', type:'country', population:'108 million', area:'1,972,550 sq km', children:[ - { name:'Mexico City', type:'city', population:'19 million', timezone:'-6 UTC'}, - { name:'Guadalajara', type:'city', population:'4 million', timezone:'-6 UTC' } ] - }, - { name:'Canada', type:'country', population:'33 million', area:'9,984,670 sq km', children:[ - { name:'Ottawa', type:'city', population:'0.9 million', timezone:'-5 UTC'}, - { name:'Toronto', type:'city', population:'2.5 million', timezone:'-5 UTC' }] - }, - { name:'United States of America', type:'country' } ] - }, - { name:'South America', type:'continent', children:[ - { name:'Brazil', type:'country', population:'186 million' }, - { name:'Argentina', type:'country', population:'40 million' } ] - } ] -} - diff --git a/includes/js/dojo/tests/data/geography_hierarchy_small.json b/includes/js/dojo/tests/data/geography_hierarchy_small.json deleted file mode 100644 index 989e5f7..0000000 --- a/includes/js/dojo/tests/data/geography_hierarchy_small.json +++ /dev/null @@ -1,19 +0,0 @@ -{ items:[ - { name:'Africa', countries:[ - { name:'Egypt', capital:'Cairo' }, - { name:'Kenya', capital:'Nairobi' }, - { name:'Sudan', capital:'Khartoum' }]}, - { name:'Australia', capital:'Canberra' }, - { name:'North America', countries:[ - { name:'Canada', population:'33 million', cities:[ - { name:'Toronto', population:'2.5 million' }, - { name:'Alberta', population:'1 million' } - ]}, - { name: 'United States of America', capital: 'Washington DC', states:[ - { name: 'Missouri'}, - { name: 'Arkansas'} - ]} - ]} - ] -} - diff --git a/includes/js/dojo/tests/data/readOnlyItemFileTestTemplates.js b/includes/js/dojo/tests/data/readOnlyItemFileTestTemplates.js deleted file mode 100644 index 7e194b4..0000000 --- a/includes/js/dojo/tests/data/readOnlyItemFileTestTemplates.js +++ /dev/null @@ -1,2260 +0,0 @@ -if(!dojo._hasResource["tests.data.readOnlyItemFileTestTemplates"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests.data.readOnlyItemFileTestTemplates"] = true; -dojo.provide("tests.data.readOnlyItemFileTestTemplates"); -dojo.require("dojo.data.api.Read"); -dojo.require("dojo.data.api.Identity"); -dojo.require("dojo.date"); -dojo.require("dojo.date.stamp"); - - -tests.data.readOnlyItemFileTestTemplates.registerTestsForDatastore = function(/* String */ datastoreClassName){ - // summary: - // Given the name of a datastore class to use, this function creates - // a set of unit tests for that datastore, and registers the new test - // group with the doh test framework. The new unit tests are based - // on a set of "template" unit tests. - var datastoreClass = dojo.getObject(datastoreClassName); - var testTemplates = tests.data.readOnlyItemFileTestTemplates.testTemplates; - var testsForDatastore = []; - var makeNewTestFunction = function(template){ - return function(t){return template.runTest(datastoreClass, t);}; - }; - for(var i = 0; i < testTemplates.length; ++i) { - var testTemplate = testTemplates[i]; - var test = {}; - test.name = testTemplate.name; - test.runTest = makeNewTestFunction(testTemplate); - testsForDatastore.push(test); - } - var testGroupName = "tests.data.readOnlyItemFileTestTemplates, with datastore " + datastoreClassName; - doh.register(testGroupName, testsForDatastore); -}; - - -//----------------------------------------------------- -// testFile data-sets -tests.data.readOnlyItemFileTestTemplates.getTestData = function(name){ - var data = null; - if(name === "countries"){ - if(dojo.isBrowser){ - data = {url: dojo.moduleUrl("tests", "data/countries.json").toString() }; - }else{ - data = {data: { - identifier:"abbr", - label:"name", - items:[ - {abbr:"ec", name:"Ecuador", capital:"Quito"}, - {abbr:'eg', name:'Egypt', capital:'Cairo'}, - {abbr:'sv', name:'El Salvador', capital:'San Salvador'}, - {abbr:'gq', name:'Equatorial Guinea', capital:'Malabo'}, - {abbr:'er', name:'Eritrea', capital:'Asmara'}, - {abbr:'ee', name:'Estonia', capital:'Tallinn'}, - {abbr:'et', name:'Ethiopia', capital:'Addis Ababa'} - ] - } }; - } - }else if(name === "countries_withNull"){ - if(dojo.isBrowser){ - data = {url: dojo.moduleUrl("tests", "data/countries_withNull.json").toString() }; - }else{ - data = {data: { - identifier:"abbr", - items:[ - {abbr:"ec", name:null, capital:"Quito"}, - {abbr:'eg', name:null, capital:'Cairo'}, - {abbr:'sv', name:'El Salvador', capital:'San Salvador'}, - {abbr:'gq', name:'Equatorial Guinea', capital:'Malabo'}, - {abbr:'er', name:'Eritrea', capital:'Asmara'}, - {abbr:'ee', name:null, capital:'Tallinn'}, - {abbr:'et', name:'Ethiopia', capital:'Addis Ababa'} - ] - } }; - } - }else if(name === "countries_withoutid"){ - if(dojo.isBrowser){ - data = {url: dojo.moduleUrl("tests", "data/countries_withoutid.json").toString() }; - }else{ - data = {data: { - label: "name", - items:[ - {abbr:"ec", name:null, capital:"Quito"}, - {abbr:'eg', name:null, capital:'Cairo'}, - {abbr:'sv', name:'El Salvador', capital:'San Salvador'}, - {abbr:'gq', name:'Equatorial Guinea', capital:'Malabo'}, - {abbr:'er', name:'Eritrea', capital:'Asmara'}, - {abbr:'ee', name:null, capital:'Tallinn'}, - {abbr:'et', name:'Ethiopia', capital:'Addis Ababa'} - ] - } }; - } - }else if (name === "countries_withBoolean"){ - if(dojo.isBrowser){ - data = {url: dojo.moduleUrl("tests", "data/countries_withBoolean.json").toString() }; - }else{ - data = {data: { - identifier:"abbr", - items:[ - {abbr:"ec", name:"Ecuador", capital:"Quito", real:true}, - {abbr:'eg', name:'Egypt', capital:'Cairo', real:true}, - {abbr:'sv', name:'El Salvador', capital:'San Salvador', real:true}, - {abbr:'gq', name:'Equatorial Guinea', capital:'Malabo', real:true}, - {abbr:'er', name:'Eritrea', capital:'Asmara', real:true}, - {abbr:'ee', name:'Estonia', capital:'Tallinn', real:true}, - {abbr:'et', name:'Ethiopia', capital:'Addis Ababa', real:true}, - {abbr:'ut', name:'Utopia', capital:'Paradise', real:false} - ] - } }; - } - }else if (name === "countries_withDates"){ - if(dojo.isBrowser){ - data = {url: dojo.moduleUrl("tests", "data/countries_withDates.json").toString() }; - }else{ - data = {data: { - identifier:"abbr", - items:[ - {abbr:"ec", name:"Ecuador", capital:"Quito"}, - {abbr:'eg', name:'Egypt', capital:'Cairo'}, - {abbr:'sv', name:'El Salvador', capital:'San Salvador'}, - {abbr:'gq', name:'Equatorial Guinea', capital:'Malabo'}, - {abbr:'er', name:'Eritrea', capital:'Asmara', independence:{_type:'Date', _value:"1993-05-24T00:00:00Z"}}, // May 24, 1993, - {abbr:'ee', name:'Estonia', capital:'Tallinn', independence:{_type:'Date', _value:"1991-08-20T00:00:00Z"}}, // August 20, 1991 - {abbr:'et', name:'Ethiopia', capital:'Addis Ababa'} - ] - } }; - } - }else if (name === "geography_hierarchy_small"){ - if(dojo.isBrowser){ - data = {url: dojo.moduleUrl("tests", "data/geography_hierarchy_small.json").toString() }; - }else{ - data = {data: { - items:[ - { name:'Africa', countries:[ - { name:'Egypt', capital:'Cairo' }, - { name:'Kenya', capital:'Nairobi' }, - { name:'Sudan', capital:'Khartoum' }]}, - { name:'Australia', capital:'Canberra' }, - { name:'North America', countries:[ - { name:'Canada', population:'33 million', cities:[ - { name:'Toronto', population:'2.5 million' }, - { name:'Alberta', population:'1 million' } - ]}, - { name: 'United States of America', capital: 'Washington DC', states:[ - { name: 'Missouri'}, - { name: 'Arkansas'} - ]} - ]} - ] - }}; - } - }else if (name === "data_multitype"){ - if(dojo.isBrowser){ - data = {url: dojo.moduleUrl("tests", "data/data_multitype.json").toString() }; - }else{ - data = {data: { - "identifier": "count", - "label": "count", - items: [ - { count: 1, value: "true" }, - { count: 2, value: true }, - { count: 3, value: "false"}, - { count: 4, value: false }, - { count: 5, value: true }, - { count: 6, value: true }, - { count: 7, value: "true" }, - { count: 8, value: "true" }, - { count: 9, value: "false"}, - { count: 10, value: false }, - { count: 11, value: [false, false]}, - { count: "12", value: [false, "true"]} - ] - } - }; - } - }else if (name === "countries_references"){ - if(dojo.isBrowser){ - data = {url: dojo.moduleUrl("tests", "data/countries_references.json").toString() }; - }else{ - data = {data: { identifier: 'name', - label: 'name', - items: [ - { name:'Africa', type:'continent', - children:[{_reference:'Egypt'}, {_reference:'Kenya'}, {_reference:'Sudan'}] }, - { name:'Egypt', type:'country' }, - { name:'Kenya', type:'country', - children:[{_reference:'Nairobi'}, {_reference:'Mombasa'}] }, - { name:'Nairobi', type:'city' }, - { name:'Mombasa', type:'city' }, - { name:'Sudan', type:'country', - children:{_reference:'Khartoum'} }, - { name:'Khartoum', type:'city' }, - { name:'Asia', type:'continent', - children:[{_reference:'China'}, {_reference:'India'}, {_reference:'Russia'}, {_reference:'Mongolia'}] }, - { name:'China', type:'country' }, - { name:'India', type:'country' }, - { name:'Russia', type:'country' }, - { name:'Mongolia', type:'country' }, - { name:'Australia', type:'continent', population:'21 million', - children:{_reference:'Commonwealth of Australia'}}, - { name:'Commonwealth of Australia', type:'country', population:'21 million'}, - { name:'Europe', type:'continent', - children:[{_reference:'Germany'}, {_reference:'France'}, {_reference:'Spain'}, {_reference:'Italy'}] }, - { name:'Germany', type:'country' }, - { name:'France', type:'country' }, - { name:'Spain', type:'country' }, - { name:'Italy', type:'country' }, - { name:'North America', type:'continent', - children:[{_reference:'Mexico'}, {_reference:'Canada'}, {_reference:'United States of America'}] }, - { name:'Mexico', type:'country', population:'108 million', area:'1,972,550 sq km', - children:[{_reference:'Mexico City'}, {_reference:'Guadalajara'}] }, - { name:'Mexico City', type:'city', population:'19 million', timezone:'-6 UTC'}, - { name:'Guadalajara', type:'city', population:'4 million', timezone:'-6 UTC' }, - { name:'Canada', type:'country', population:'33 million', area:'9,984,670 sq km', - children:[{_reference:'Ottawa'}, {_reference:'Toronto'}] }, - { name:'Ottawa', type:'city', population:'0.9 million', timezone:'-5 UTC'}, - { name:'Toronto', type:'city', population:'2.5 million', timezone:'-5 UTC' }, - { name:'United States of America', type:'country' }, - { name:'South America', type:'continent', - children:[{_reference:'Brazil'}, {_reference:'Argentina'}] }, - { name:'Brazil', type:'country', population:'186 million' }, - { name:'Argentina', type:'country', population:'40 million' } - ] - } - }; - } - } - return data; -}; - -//----------------------------------------------------- -// testTemplates -tests.data.readOnlyItemFileTestTemplates.testTemplates = [ - { - name: "Identity API: fetchItemByIdentity()", - runTest: function(datastore, t){ - // summary: - // Simple test of the fetchItemByIdentity function of the store. - var store = new datastore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries")); - - var d = new doh.Deferred(); - function onItem(item){ - t.assertTrue(item !== null); - if(item !== null){ - var name = store.getValue(item,"name"); - t.assertEqual(name, "El Salvador"); - } - d.callback(true); - } - function onError(errData){ - t.assertTrue(false); - d.errback(errData); - } - store.fetchItemByIdentity({identity: "sv", onItem: onItem, onError: onError}); - return d; // Deferred - } - }, - { - name: "Identity API: fetchItemByIdentity() notFound", - runTest: function(datastore, t){ - // summary: - // Simple test of the fetchItemByIdentity function of the store. - // description: - // Simple test of the fetchItemByIdentity function of the store. - var store = new datastore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries")); - - var d = new doh.Deferred(); - function onItem(item){ - t.assertTrue(item === null); - d.callback(true); - } - function onError(errData){ - t.assertTrue(false); - d.errback(errData); - } - store.fetchItemByIdentity({identity: "sv_not", onItem: onItem, onError: onError}); - return d; // Deferred - } - }, - { - name: "Identity API: getIdentityAttributes()", - runTest: function(datastore, t){ - // summary: - // Simple test of the getIdentityAttributes function. - // description: - // Simple test of the getIdentityAttributes function. - var store = new datastore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries")); - - var d = new doh.Deferred(); - function onItem(item){ - t.assertTrue(item !== null) - var identifiers = store.getIdentityAttributes(item); - t.assertTrue(dojo.isArray(identifiers)); - t.assertEqual(1, identifiers.length); - t.assertEqual("abbr", identifiers[0]); - d.callback(true); - } - function onError(errData){ - t.assertTrue(false); - d.errback(errData); - } - store.fetchItemByIdentity({identity: "sv", onItem: onItem, onError: onError}); - return d; // Deferred - } - }, - { - name: "Identity API: fetchItemByIdentity() commentFilteredJson", - runTest: function(datastore, t){ - // summary: - // Simple test of the fetchItemByIdentity function of the store. - // description: - // Simple test of the fetchItemByIdentity function of the store. - // This tests loading a comment-filtered json file so that people using secure - // data with this store can bypass the JavaSceipt hijack noted in Fortify's - // paper. - - if(dojo.isBrowser){ - var store = new datastore({url: dojo.moduleUrl("tests", "data/countries_commentFiltered.json").toString()}); - - var d = new doh.Deferred(); - function onItem(item){ - t.assertTrue(item !== null); - var name = store.getValue(item,"name"); - t.assertEqual(name, "El Salvador"); - d.callback(true); - } - function onError(errData){ - t.assertTrue(false); - d.errback(errData); - } - store.fetchItemByIdentity({identity: "sv", onItem: onItem, onError: onError}); - return d; // Deferred - } - } - }, - { - name: "Identity API: fetchItemByIdentity() nullValue", - runTest: function(datastore, t){ - // summary: - // Simple test of the fetchItemByIdentity function of the store, checling a null value. - // description: - // Simple test of the fetchItemByIdentity function of the store, checking a null value. - // This tests handling attributes in json that were defined as null properly. - // Introduced because of tracker: #3153 - var store = new datastore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries_withNull")); - - var d = new doh.Deferred(); - function onItem(item){ - t.assertTrue(item !== null); - var name = store.getValue(item,"name"); - t.assertEqual(name, null); - d.callback(true); - } - function onError(errData){ - t.assertTrue(false); - d.errback(errData); - } - store.fetchItemByIdentity({identity: "ec", onItem: onItem, onError: onError}); - return d; // Deferred - } - }, - { - name: "Identity API: fetchItemByIdentity() booleanValue", - runTest: function(datastore, t){ - // summary: - // Simple test of the fetchItemByIdentity function of the store, checking a boolean value. - // description: - // Simple test of the fetchItemByIdentity function of the store, checking a boolean value. - var store = new datastore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries_withBoolean")); - - var d = new doh.Deferred(); - function onItem(item){ - t.assertTrue(item !== null); - var name = store.getValue(item,"name"); - t.assertEqual(name, "Utopia"); - var real = store.getValue(item,"real"); - t.assertEqual(real, false); - d.callback(true); - } - function onError(errData){ - t.assertTrue(false); - d.errback(errData); - } - store.fetchItemByIdentity({identity: "ut", onItem: onItem, onError: onError}); - return d; // Deferred - } - }, - { - name: "Identity API: fetchItemByIdentity() withoutSpecifiedIdInData", - runTest: function(datastore, t){ - // summary: - // Simple test of bug #4691, looking up something by assigned id, not one specified in the JSON data. - // description: - // Simple test of bug #4691, looking up something by assigned id, not one specified in the JSON data. - var store = new datastore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries_withoutid")); - - var d = new doh.Deferred(); - function onItem(item){ - t.assertTrue(item !== null); - var name = store.getValue(item,"name"); - t.assertEqual(name, "El Salvador"); - d.callback(true); - } - function onError(errData){ - t.assertTrue(false); - d.errback(errData); - } - store.fetchItemByIdentity({identity: "2", onItem: onItem, onError: onError}); - return d; // Deferred - } - }, - { - name: "Identity API: getIdentity()", - runTest: function(datastore, t){ - // summary: - // Simple test of the getIdentity function of the store. - // description: - // Simple test of the getIdentity function of the store. - var store = new datastore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries")); - - var d = new doh.Deferred(); - function onItem(item){ - t.assertTrue(item !== null); - t.assertTrue(store.getIdentity(item) === "sv"); - d.callback(true); - } - function onError(errData){ - t.assertTrue(false); - d.errback(errData); - } - store.fetchItemByIdentity({identity: "sv", onItem: onItem, onError: onError}); - return d; // Deferred - } - }, - { - name: "Identity API: getIdentity() withoutSpecifiedId", - runTest: function(datastore, t){ - // summary: - // Simple test of the #4691 bug - // description: - // Simple test of the #4691 bug - var store = new datastore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries_withoutid")); - - var d = new doh.Deferred(); - function onItem(item, request){ - t.assertTrue(item !== null); - t.assertTrue(store.getIdentity(item) === 2); - d.callback(true); - } - function onError(errData, request){ - t.assertTrue(false); - d.errback(errData); - } - store.fetch({ query:{abbr: "sv"}, onItem: onItem, onError: onError}); - return d; // Deferred - } - }, - { - name: "Read API: fetch() all", - runTest: function(datastore, t){ - // summary: - // Simple test of a basic fetch on ItemFileReadStore. - // description: - // Simple test of a basic fetch on ItemFileReadStore. - var store = new datastore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries")); - - var d = new doh.Deferred(); - function completedAll(items, request){ - t.is(7, items.length); - d.callback(true); - } - function error(errData, request){ - t.assertTrue(false); - d.errback(errData); - } - - //Get everything... - store.fetch({ onComplete: completedAll, onError: error}); - return d; - } - }, - { - name: "Read API: fetch() one", - runTest: function(datastore, t){ - // summary: - // Simple test of a basic fetch on ItemFileReadStore of a single item. - // description: - // Simple test of a basic fetch on ItemFileReadStore of a single item. - var store = new datastore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries")); - - var d = new doh.Deferred(); - function onComplete(items, request){ - t.assertEqual(items.length, 1); - d.callback(true); - } - function onError(errData, request){ - t.assertTrue(false); - d.errback(errData); - } - store.fetch({ query: {abbr: "ec"}, - onComplete: onComplete, - onError: onError - }); - return d; - } - }, - { - name: "Read API: fetch() shallow", - runTest: function(datastore, t){ - // summary: - // Simple test of a basic fetch on ItemFileReadStore of only toplevel items - // description: - // Simple test of a basic fetch on ItemFileReadStore of only toplevel items. - var store = new datastore(tests.data.readOnlyItemFileTestTemplates.getTestData("geography_hierarchy_small")); - - var d = new doh.Deferred(); - function onComplete(items, request){ - t.assertEqual(items.length, 2); - d.callback(true); - } - function onError(errData, request){ - t.assertTrue(false); - d.errback(errData); - } - //Find all items starting with A, only toplevel (root) items. - store.fetch({ query: {name: "A*"}, - onComplete: onComplete, - onError: onError - }); - return d; - } - }, - { - name: "Read API: fetch() Multiple", - runTest: function(datastore, t){ - // summary: - // Tests that multiple fetches at the same time queue up properly and do not clobber each other on initial load. - // description: - // Tests that multiple fetches at the same time queue up properly and do not clobber each other on initial load. - var store = new datastore(tests.data.readOnlyItemFileTestTemplates.getTestData("geography_hierarchy_small")); - - var d = new doh.Deferred(); - var done = [false, false]; - - function onCompleteOne(items, request){ - done[0] = true; - t.assertEqual(items.length, 2); - if(done[0] && done[1]){ - d.callback(true); - } - } - function onCompleteTwo(items, request){ - done[1] = true; - if(done[0] && done[1]){ - d.callback(true); - } - } - function onError(errData, request){ - t.assertTrue(false); - d.errback(errData); - } - //Find all items starting with A, only toplevel (root) items. - store.fetch({ query: {name: "A*"}, - onComplete: onCompleteOne, - onError: onError - }); - - //Find all items starting with A, only toplevel (root) items. - store.fetch({ query: {name: "N*"}, - onComplete: onCompleteTwo, - onError: onError - }); - - return d; - } - }, - { - name: "Read API: fetch() MultipleMixedFetch", - runTest: function(datastore, t){ - // summary: - // Tests that multiple fetches at the same time queue up properly and do not clobber each other on initial load. - // description: - // Tests that multiple fetches at the same time queue up properly and do not clobber each other on initial load. - // Tests an item fetch and an identity fetch. - var store = new datastore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries")); - - var d = new doh.Deferred(); - var done = [false, false]; - - function onComplete(items, request){ - done[0] = true; - t.assertEqual(items.length, 1); - if(done[0] && done[1]){ - d.callback(true); - } - } - function onItem(item){ - done[1] = true; - t.assertTrue(item !== null); - var name = store.getValue(item,"name"); - t.assertEqual(name, "El Salvador"); - - if(done[0] && done[1]){ - d.callback(true); - } - } - function onError(errData){ - t.assertTrue(false); - d.errback(errData); - } - - //Find all items starting with A, only toplevel (root) items. - store.fetch({ query: {name: "El*"}, - onComplete: onComplete, - onError: onError - }); - - store.fetchItemByIdentity({identity: "sv", onItem: onItem, onError: onError}); - return d; - } - }, - { - name: "Read API: fetch() deep", - runTest: function(datastore, t){ - // summary: - // Simple test of a basic fetch on ItemFileReadStore of all items (including children (nested)) - // description: - // Simple test of a basic fetch on ItemFileReadStore of all items (including children (nested)) - var store = new datastore(tests.data.readOnlyItemFileTestTemplates.getTestData("geography_hierarchy_small")); - - var d = new doh.Deferred(); - function onComplete(items, request){ - t.assertEqual(items.length, 4); - d.callback(true); - } - function onError(errData, request){ - t.assertTrue(false); - d.errback(errData); - } - //Find all items starting with A, including child (nested) items. - store.fetch({ query: {name: "A*"}, - onComplete: onComplete, - onError: onError, - queryOptions: {deep:true} - }); - return d; - } - }, - { - name: "Read API: fetch() one_commentFilteredJson", - runTest: function(datastore, t){ - // summary: - // Simple test of a basic fetch on ItemFileReadStore of a single item. - // description: - // Simple test of a basic fetch on ItemFileReadStore of a single item. - // This tests loading a comment-filtered json file so that people using secure - // data with this store can bypass the JavaSceipt hijack noted in Fortify's - // paper. - if(dojo.isBrowser){ - var store = new datastore({url: dojo.moduleUrl("tests", "data/countries_commentFiltered.json").toString()}); - - var d = new doh.Deferred(); - function onComplete(items, request){ - t.assertEqual(items.length, 1); - d.callback(true); - } - function onError(errData, request){ - t.assertTrue(false); - d.errback(errData); - } - store.fetch({ query: {abbr: "ec"}, - onComplete: onComplete, - onError: onError - }); - return d; - } - } - }, - { - name: "Read API: fetch() withNull", - runTest: function(datastore, t){ - // summary: - // Simple test of a basic fetch on ItemFileReadStore of a single item where some attributes are null. - // description: - // Simple test of a basic fetch on ItemFileReadStore of a single item where some attributes are null. - // Introduced because of tracker: #3153 - var store = new datastore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries_withNull")); - - var d = new doh.Deferred(); - function onComplete(items, request){ - t.assertEqual(4, items.length); - d.callback(true); - } - function onError(errData, request){ - t.assertTrue(false); - d.errback(errData); - } - store.fetch({ query: {name: "E*"}, - onComplete: onComplete, - onError: onError - }); - return d; - } - }, - { - name: "Read API: fetch() all_streaming", - runTest: function(datastore, t){ - // summary: - // Simple test of a basic fetch on ItemFileReadStore. - // description: - // Simple test of a basic fetch on ItemFileReadStore. - var store = new datastore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries")); - - var d = new doh.Deferred(); - count = 0; - - function onBegin(size, requestObj){ - t.assertEqual(size, 7); - } - function onItem(item, requestObj){ - t.assertTrue(store.isItem(item)); - count++; - } - function onComplete(items, request){ - t.assertEqual(count, 7); - t.assertTrue(items === null); - d.callback(true); - } - function onError(errData, request){ - t.assertTrue(false); - d.errback(errData); - } - - //Get everything... - store.fetch({ onBegin: onBegin, - onItem: onItem, - onComplete: onComplete, - onError: onError - }); - return d; - } - }, - { - name: "Read API: fetch() paging", - runTest: function(datastore, t){ - // summary: - // Test of multiple fetches on a single result. Paging, if you will. - // description: - // Test of multiple fetches on a single result. Paging, if you will. - var store = new datastore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries")); - - var d = new doh.Deferred(); - function dumpFirstFetch(items, request){ - t.assertEqual(items.length, 5); - request.start = 3; - request.count = 1; - request.onComplete = dumpSecondFetch; - store.fetch(request); - } - - function dumpSecondFetch(items, request){ - t.assertEqual(items.length, 1); - request.start = 0; - request.count = 5; - request.onComplete = dumpThirdFetch; - store.fetch(request); - } - - function dumpThirdFetch(items, request){ - t.assertEqual(items.length, 5); - request.start = 2; - request.count = 20; - request.onComplete = dumpFourthFetch; - store.fetch(request); - } - - function dumpFourthFetch(items, request){ - t.assertEqual(items.length, 5); - request.start = 9; - request.count = 100; - request.onComplete = dumpFifthFetch; - store.fetch(request); - } - - function dumpFifthFetch(items, request){ - t.assertEqual(items.length, 0); - request.start = 2; - request.count = 20; - request.onComplete = dumpSixthFetch; - store.fetch(request); - } - - function dumpSixthFetch(items, request){ - t.assertEqual(items.length, 5); - d.callback(true); - } - - function completed(items, request){ - t.assertEqual(items.length, 7); - request.start = 1; - request.count = 5; - request.onComplete = dumpFirstFetch; - store.fetch(request); - } - - function error(errData, request){ - t.assertTrue(false); - d.errback(errData); - } - store.fetch({onComplete: completed, onError: error}); - return d; - } - }, - { - name: "Read API: fetch() with MultiType Match", - runTest: function(datastore, t){ - // summary: - // Simple test of a basic fetch againct an attribute that has different types for the value across items - // description: - // Simple test of a basic fetch againct an attribute that has different types for the value across items - // Introduced because of tracker: #4931 - var store = new datastore(tests.data.readOnlyItemFileTestTemplates.getTestData("data_multitype")); - - var d = new doh.Deferred(); - function onComplete(items, request){ - t.assertEqual(4, items.length); - d.callback(true); - } - function onError(errData, request){ - t.assertTrue(false); - d.errback(errData); - } - store.fetch({ query: {count: "1*"}, - onComplete: onComplete, - onError: onError - }); - return d; - } - }, - { - name: "Read API: fetch() with MultiType, MultiValue Match", - runTest: function(datastore, t){ - // summary: - // Simple test of a basic fetch againct an attribute that has different types for the value across items - // description: - // Simple test of a basic fetch againct an attribute that has different types for the value across items - // Introduced because of tracker: #4931 - var store = new datastore(tests.data.readOnlyItemFileTestTemplates.getTestData("data_multitype")); - - var d = new doh.Deferred(); - function onComplete(items, request){ - t.assertEqual(7, items.length); - d.callback(true); - } - function onError(errData, request){ - t.assertTrue(false); - d.errback(errData); - } - store.fetch({ query: {value: "true"}, - onComplete: onComplete, - onError: onError - }); - return d; - } - }, - { - name: "Read API: getLabel()", - runTest: function(datastore, t){ - // summary: - // Simple test of the getLabel function against a store set that has a label defined. - // description: - // Simple test of the getLabel function against a store set that has a label defined. - var store = new datastore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries")); - - var d = new doh.Deferred(); - function onComplete(items, request){ - t.assertEqual(items.length, 1); - var label = store.getLabel(items[0]); - t.assertTrue(label !== null); - t.assertEqual("Ecuador", label); - d.callback(true); - } - function onError(errData, request){ - t.assertTrue(false); - d.errback(errData); - } - store.fetch({ query: {abbr: "ec"}, - onComplete: onComplete, - onError: onError - }); - return d; - } - }, - { - name: "Read API: getLabelAttributes()", - runTest: function(datastore, t){ - // summary: - // Simple test of the getLabelAttributes function against a store set that has a label defined. - // description: - // Simple test of the getLabelAttributes function against a store set that has a label defined. - var store = new datastore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries")); - - var d = new doh.Deferred(); - function onComplete(items, request){ - t.assertEqual(items.length, 1); - var labelList = store.getLabelAttributes(items[0]); - t.assertTrue(dojo.isArray(labelList)); - t.assertEqual("name", labelList[0]); - d.callback(true); - } - function onError(errData, request){ - t.assertTrue(false); - d.errback(errData); - } - store.fetch({ query: {abbr: "ec"}, - onComplete: onComplete, - onError: onError - }); - return d; - } - }, - { - name: "Read API: getValue()", - runTest: function(datastore, t){ - // summary: - // Simple test of the getValue function of the store. - // description: - // Simple test of the getValue function of the store. - var store = new datastore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries")); - - var d = new doh.Deferred(); - function onItem(item){ - t.assertTrue(item !== null); - var name = store.getValue(item,"name"); - t.assertTrue(name === "El Salvador"); - d.callback(true); - } - function onError(errData){ - t.assertTrue(false); - d.errback(errData); - } - store.fetchItemByIdentity({identity: "sv", onItem: onItem, onError: onError}); - return d; // Deferred - } - }, - { - name: "Read API: getValues()", - runTest: function(datastore, t){ - // summary: - // Simple test of the getValues function of the store. - // description: - // Simple test of the getValues function of the store. - var store = new datastore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries")); - - var d = new doh.Deferred(); - function onItem(item){ - t.assertTrue(item !== null); - var names = store.getValues(item,"name"); - t.assertTrue(dojo.isArray(names)); - t.assertEqual(names.length, 1); - t.assertEqual(names[0], "El Salvador"); - d.callback(true); - } - function onError(errData){ - t.assertTrue(false); - d.errback(errData); - } - store.fetchItemByIdentity({identity: "sv", onItem: onItem, onError: onError}); - return d; // Deferred - } - }, - { - name: "Read API: isItem()", - runTest: function(datastore, t){ - // summary: - // Simple test of the isItem function of the store - // description: - // Simple test of the isItem function of the store - var store = new datastore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries")); - - var d = new doh.Deferred(); - function onItem(item){ - t.assertTrue(item !== null); - t.assertTrue(store.isItem(item)); - t.assertTrue(!store.isItem({})); - d.callback(true); - } - function onError(errData){ - t.assertTrue(false); - d.errback(errData); - } - store.fetchItemByIdentity({identity: "sv", onItem: onItem, onError: onError}); - return d; // Deferred - } - }, - { - name: "Read API: isItem() multistore", - runTest: function(datastore, t){ - // summary: - // Simple test of the isItem function of the store - // to verify two different store instances do not accept - // items from each other. - // description: - // Simple test of the isItem function of the store - // to verify two different store instances do not accept - // items from each other. - - // Two different instances, even if they read from the same URL - // should not accept items between each other! - var store1 = new datastore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries")); - var store2 = new datastore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries")); - - var d = new doh.Deferred(); - function onItem1(item1){ - t.assertTrue(item1 !== null); - - function onItem2(item2){ - t.assertTrue(item1 !== null); - t.assertTrue(item2 !== null); - t.assertTrue(store1.isItem(item1)); - t.assertTrue(store2.isItem(item2)); - t.assertTrue(!store1.isItem(item2)); - t.assertTrue(!store2.isItem(item1)); - d.callback(true); - } - store2.fetchItemByIdentity({identity: "sv", onItem: onItem2, onError: onError}); - - } - function onError(errData){ - t.assertTrue(false); - d.errback(errData); - } - store1.fetchItemByIdentity({identity: "sv", onItem: onItem1, onError: onError}); - return d; // Deferred - } - }, - { - name: "Read API: hasAttribute()", - runTest: function(datastore, t){ - // summary: - // Simple test of the hasAttribute function of the store - // description: - // Simple test of the hasAttribute function of the store - var store = new datastore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries")); - - var d = new doh.Deferred(); - function onItem(item){ - t.assertTrue(item !== null); - t.assertTrue(store.hasAttribute(item, "abbr")); - t.assertTrue(!store.hasAttribute(item, "abbr_not")); - - //Test that null attributes throw an exception - var passed = false; - try{ - store.hasAttribute(item, null); - }catch (e){ - passed = true; - } - t.assertTrue(passed); - d.callback(true); - } - function onError(errData){ - t.assertTrue(false); - d.errback(errData); - } - store.fetchItemByIdentity({identity: "sv", onItem: onItem, onError: onError}); - return d; // Deferred - } - }, - { - name: "Read API: containsValue()", - runTest: function(datastore, t){ - // summary: - // Simple test of the containsValue function of the store - // description: - // Simple test of the containsValue function of the store - var store = new datastore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries")); - - var d = new doh.Deferred(); - function onItem(item){ - t.assertTrue(item !== null); - t.assertTrue(store.containsValue(item, "abbr", "sv")); - t.assertTrue(!store.containsValue(item, "abbr", "sv1")); - t.assertTrue(!store.containsValue(item, "abbr", null)); - - //Test that null attributes throw an exception - var passed = false; - try{ - store.containsValue(item, null, "foo"); - }catch (e){ - passed = true; - } - t.assertTrue(passed); - d.callback(true); - } - function onError(errData){ - t.assertTrue(false); - d.errback(errData); - } - store.fetchItemByIdentity({identity: "sv", onItem: onItem, onError: onError}); - return d; // Deferred - } - }, - { - name: "Read API: getAttributes()", - runTest: function(datastore, t){ - // summary: - // Simple test of the getAttributes function of the store - // description: - // Simple test of the getAttributes function of the store - var store = new datastore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries")); - - var d = new doh.Deferred(); - function onItem(item){ - t.assertTrue(item !== null); - t.assertTrue(store.isItem(item)); - - var attributes = store.getAttributes(item); - t.assertEqual(attributes.length, 3); - for(var i = 0; i < attributes.length; i++){ - t.assertTrue((attributes[i] === "name" || attributes[i] === "abbr" || attributes[i] === "capital")); - } - d.callback(true); - } - function onError(errData){ - t.assertTrue(false); - d.errback(errData); - } - store.fetchItemByIdentity({identity: "sv", onItem: onItem, onError: onError}); - return d; // Deferred - } - }, - { - name: "Read API: getFeatures()", - runTest: function(datastore, t){ - // summary: - // Simple test of the getFeatures function of the store - // description: - // Simple test of the getFeatures function of the store - var store = new datastore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries")); - - var features = store.getFeatures(); - t.assertTrue(features["dojo.data.api.Read"] != null); - t.assertTrue(features["dojo.data.api.Identity"] != null); - } - }, - { - name: "Read API: fetch() patternMatch0", - runTest: function(datastore, t){ - // summary: - // Function to test pattern matching of everything starting with lowercase e - // description: - // Function to test pattern matching of everything starting with lowercase e - var store = new datastore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries")); - - var d = new doh.Deferred(); - function completed(items, request) { - t.assertEqual(items.length, 5); - var passed = true; - for(var i = 0; i < items.length; i++){ - var value = store.getValue(items[i], "abbr"); - if(!(value === "ec" || value === "eg" || value === "er" || value === "ee" || value === "et")){ - passed=false; - break; - } - } - t.assertTrue(passed); - if (passed){ - d.callback(true); - }else{ - d.errback(new Error("Unexpected abbreviation found, match failure.")); - } - } - function error(error, request) { - t.assertTrue(false); - d.errback(error); - } - store.fetch({query: {abbr: "e*"}, onComplete: completed, onError: error}); - return d; - } - }, - { - name: "Read API: fetch() patternMatch1", - runTest: function(datastore, t){ - // summary: - // Function to test pattern matching of everything with $ in it. - // description: - // Function to test pattern matching of everything with $ in it. - - var store = new datastore({data: { identifier: "uniqueId", - items: [ {uniqueId: 1, value:"foo*bar"}, - {uniqueId: 2, value:"bar*foo"}, - {uniqueId: 3, value:"boomBam"}, - {uniqueId: 4, value:"bit$Bite"}, - {uniqueId: 5, value:"ouagadogou"}, - {uniqueId: 6, value:"BaBaMaSaRa***Foo"}, - {uniqueId: 7, value:"squawl"}, - {uniqueId: 8, value:"seaweed"}, - {uniqueId: 9, value:"jfq4@#!$!@Rf14r14i5u"} - ] - } - }); - - var d = new doh.Deferred(); - function completed(items, request){ - t.assertEqual(items.length, 2); - var passed = true; - for(var i = 0; i < items.length; i++){ - var value = store.getValue(items[i], "value"); - if(!(value === "bit$Bite" || value === "jfq4@#!$!@Rf14r14i5u")){ - passed=false; - break; - } - } - t.assertTrue(passed); - if (passed){ - d.callback(true); - }else{ - d.errback(new Error("Unexpected pattern matched. Filter failure.")); - } - } - function error(error, request){ - t.assertTrue(false); - d.errback(error); - } - store.fetch({query: {value: "*$*"}, onComplete: completed, onError: error}); - return d; - } - }, - { - name: "Read API: fetch() patternMatch2", - runTest: function(datastore, t){ - // summary: - // Function to test exact pattern match - // description: - // Function to test exact pattern match - - var store = new datastore({data: { identifier: "uniqueId", - items: [ {uniqueId: 1, value:"foo*bar"}, - {uniqueId: 2, value:"bar*foo"}, - {uniqueId: 3, value:"boomBam"}, - {uniqueId: 4, value:"bit$Bite"}, - {uniqueId: 5, value:"ouagadogou"}, - {uniqueId: 6, value:"BaBaMaSaRa***Foo"}, - {uniqueId: 7, value:"squawl"}, - {uniqueId: 8, value:"seaweed"}, - {uniqueId: 9, value:"jfq4@#!$!@Rf14r14i5u"} - ] - } - }); - - var d = new doh.Deferred(); - function completed(items, request){ - t.assertEqual(items.length, 1); - var passed = true; - for(var i = 0; i < items.length; i++){ - var value = store.getValue(items[i], "value"); - if(!(value === "bar*foo")){ - passed=false; - break; - } - } - t.assertTrue(passed); - if (passed){ - d.callback(true); - }else{ - d.errback(new Error("Unexpected abbreviation found, match failure.")); - } - } - function error(error, request){ - t.assertTrue(false); - d.errback(error); - } - store.fetch({query: {value: "bar\*foo"}, onComplete: completed, onError: error}); - return d; - } - }, - { - name: "Read API: fetch() patternMatch_caseSensitive", - runTest: function(datastore, t){ - // summary: - // Function to test pattern matching of a pattern case-sensitively - // description: - // Function to test pattern matching of a pattern case-sensitively - - var store = new datastore({data: { identifier: "uniqueId", - items: [ {uniqueId: 1, value:"foo*bar"}, - {uniqueId: 2, value:"bar*foo"}, - {uniqueId: 3, value:"BAR*foo"}, - {uniqueId: 4, value:"BARBananafoo"} - ] - } - }); - - var d = new doh.Deferred(); - function completed(items, request){ - t.assertEqual(1, items.length); - var passed = true; - for(var i = 0; i < items.length; i++){ - var value = store.getValue(items[i], "value"); - if(!(value === "bar*foo")){ - passed=false; - break; - } - } - t.assertTrue(passed); - if (passed){ - d.callback(true); - }else{ - d.errback(new Error("Unexpected pattern matched. Filter failure.")); - } - } - function error(error, request){ - t.assertTrue(false); - d.errback(error); - } - store.fetch({query: {value: "bar\\*foo"}, queryOptions: {ignoreCase: false} , onComplete: completed, onError: error}); - return d; - } - }, - { - name: "Read API: fetch() patternMatch_caseInsensitive", - runTest: function(datastore, t){ - // summary: - // Function to test pattern matching of a pattern case-insensitively - // description: - // Function to test pattern matching of a pattern case-insensitively - - var store = new datastore({data: { identifier: "uniqueId", - items: [ {uniqueId: 1, value:"foo*bar"}, - {uniqueId: 2, value:"bar*foo"}, - {uniqueId: 3, value:"BAR*foo"}, - {uniqueId: 4, value:"BARBananafoo"} - ] - } - }); - - var d = new doh.Deferred(); - function completed(items, request){ - t.assertEqual(items.length, 2); - var passed = true; - for(var i = 0; i < items.length; i++){ - var value = store.getValue(items[i], "value"); - if(!(value === "BAR*foo" || value === "bar*foo")){ - passed=false; - break; - } - } - t.assertTrue(passed); - if (passed){ - d.callback(true); - }else{ - d.errback(new Error("Unexpected pattern matched. Filter failure.")); - } - } - function error(error, request){ - t.assertTrue(false); - d.errback(error); - } - store.fetch({query: {value: "bar\\*foo"}, queryOptions: {ignoreCase: true}, onComplete: completed, onError: error}); - return d; - } - }, - { - name: "Read API: fetch() sortNumeric", - runTest: function(datastore, t){ - // summary: - // Function to test sorting numerically. - // description: - // Function to test sorting numerically. - - var store = new datastore({data: { identifier: "uniqueId", - items: [ {uniqueId: 0, value:"fo|o*b.ar"}, - {uniqueId: 1, value:"ba|r*foo"}, - {uniqueId: 2, value:"boomBam"}, - {uniqueId: 3, value:"bit$Bite"}, - {uniqueId: 4, value:"ouagadogou"}, - {uniqueId: 5, value:"jfq4@#!$!@|f1.$4r14i5u"}, - {uniqueId: 6, value:"BaB{aMa|SaRa***F}oo"}, - {uniqueId: 7, value:"squawl"}, - {uniqueId: 9, value:"seaweed"}, - {uniqueId: 10, value:"zulu"}, - {uniqueId: 8, value:"seaweed"} - ] - } - }); - - var d = new doh.Deferred(); - function completed(items, request){ - t.assertEqual(items.length, 11); - var passed = true; - for(var i = 0; i < items.length; i++){ - var value = store.getValue(items[i], "value"); - if(!(store.getValue(items[i], "uniqueId") === i)){ - passed=false; - break; - } - } - t.assertTrue(passed); - if (passed){ - d.callback(true); - }else{ - d.errback(new Error("Unexpected sorting order found, sort failure.")); - } - } - - function error(error, request){ - t.assertTrue(false); - d.errback(error); - } - - var sortAttributes = [{attribute: "uniqueId"}]; - store.fetch({onComplete: completed, onError: error, sort: sortAttributes}); - return d; - } - }, - { - name: "Read API: fetch() sortNumericDescending", - runTest: function(datastore, t){ - // summary: - // Function to test sorting numerically. - // description: - // Function to test sorting numerically. - - var store = new datastore({data: { identifier: "uniqueId", - items: [ {uniqueId: 0, value:"fo|o*b.ar"}, - {uniqueId: 1, value:"ba|r*foo"}, - {uniqueId: 2, value:"boomBam"}, - {uniqueId: 3, value:"bit$Bite"}, - {uniqueId: 4, value:"ouagadogou"}, - {uniqueId: 5, value:"jfq4@#!$!@|f1.$4r14i5u"}, - {uniqueId: 6, value:"BaB{aMa|SaRa***F}oo"}, - {uniqueId: 7, value:"squawl"}, - {uniqueId: 9, value:"seaweed"}, - {uniqueId: 10, value:"zulu"}, - {uniqueId: 8, value:"seaweed"} - ] - } - }); - var d = new doh.Deferred(); - function completed(items, request){ - t.assertEqual(items.length, 11); - var passed = true; - for(var i = 0; i < items.length; i++){ - var value = store.getValue(items[i], "value"); - if(!((items.length - (store.getValue(items[i], "uniqueId") + 1)) === i)){ - passed=false; - break; - } - } - t.assertTrue(passed); - if (passed){ - d.callback(true); - }else{ - d.errback(new Error("Unexpected sorting order found, sort failure.")); - } - } - - function error(error, request){ - t.assertTrue(false); - d.errback(error); - } - - var sortAttributes = [{attribute: "uniqueId", descending: true}]; - store.fetch({onComplete: completed, onError: error, sort: sortAttributes}); - return d; - } - }, - { - name: "Read API: fetch() sortNumericWithCount", - runTest: function(datastore, t){ - // summary: - // Function to test sorting numerically in descending order, returning only a specified number of them. - // description: - // Function to test sorting numerically in descending order, returning only a specified number of them. - - var store = new datastore({data: { identifier: "uniqueId", - items: [ {uniqueId: 0, value:"fo|o*b.ar"}, - {uniqueId: 1, value:"ba|r*foo"}, - {uniqueId: 2, value:"boomBam"}, - {uniqueId: 3, value:"bit$Bite"}, - {uniqueId: 4, value:"ouagadogou"}, - {uniqueId: 5, value:"jfq4@#!$!@|f1.$4r14i5u"}, - {uniqueId: 6, value:"BaB{aMa|SaRa***F}oo"}, - {uniqueId: 7, value:"squawl"}, - {uniqueId: 9, value:"seaweed"}, - {uniqueId: 10, value:"zulu"}, - {uniqueId: 8, value:"seaweed"} - ] - } - }); - - var d = new doh.Deferred(); - function completed(items, request){ - t.assertEqual(items.length, 5); - var itemId = 10; - var passed = true; - for(var i = 0; i < items.length; i++){ - var value = store.getValue(items[i], "value"); - if(!(store.getValue(items[i], "uniqueId") === itemId)){ - passed=false; - break; - } - itemId--; // Decrement the item id. We are descending sorted, so it should go 10, 9, 8, etc. - } - t.assertTrue(passed); - if (passed){ - d.callback(true); - }else{ - d.errback(new Error("Unexpected sorting order found, sort failure.")); - } - } - - function error(error, request){ - t.assertTrue(false); - d.errback(error); - } - - var sortAttributes = [{attribute: "uniqueId", descending: true}]; - store.fetch({onComplete: completed, onError: error, sort: sortAttributes, count: 5}); - return d; - } - }, - { - name: "Read API: fetch() sortAlphabetic", - runTest: function(datastore, t){ - // summary: - // Function to test sorting alphabetic ordering. - // description: - // Function to test sorting alphabetic ordering. - - var store = new datastore({data: { identifier: "uniqueId", - items: [ {uniqueId: 0, value:"abc"}, - {uniqueId: 1, value:"bca"}, - {uniqueId: 2, value:"abcd"}, - {uniqueId: 3, value:"abcdefg"}, - {uniqueId: 4, value:"lmnop"}, - {uniqueId: 5, value:"foghorn"}, - {uniqueId: 6, value:"qberty"}, - {uniqueId: 7, value:"qwerty"}, - {uniqueId: 8, value:""}, - {uniqueId: 9, value:"seaweed"}, - {uniqueId: 10, value:"123abc"} - - ] - } - }); - - var d = new doh.Deferred(); - function completed(items, request){ - //Output should be in this order... - var orderedArray = [ "", - "123abc", - "abc", - "abcd", - "abcdefg", - "bca", - "foghorn", - "lmnop", - "qberty", - "qwerty", - "seaweed" - ]; - t.assertEqual(items.length, 11); - var passed = true; - for(var i = 0; i < items.length; i++){ - var value = store.getValue(items[i], "value"); - if(!(store.getValue(items[i], "value") === orderedArray[i])){ - passed=false; - break; - } - } - t.assertTrue(passed); - if (passed){ - d.callback(true); - }else{ - d.errback(new Error("Unexpected sorting order found, sort failure.")); - } - } - - function error(error, request) { - t.assertTrue(false); - d.errback(error); - } - - var sortAttributes = [{attribute: "value"}]; - store.fetch({onComplete: completed, onError: error, sort: sortAttributes}); - return d; - } - }, - { - name: "Read API: fetch() sortAlphabeticDescending", - runTest: function(datastore, t){ - // summary: - // Function to test sorting alphabetic ordering in descending mode. - // description: - // Function to test sorting alphabetic ordering in descending mode. - - var store = new datastore({data: { identifier: "uniqueId", - items: [ {uniqueId: 0, value:"abc"}, - {uniqueId: 1, value:"bca"}, - {uniqueId: 2, value:"abcd"}, - {uniqueId: 3, value:"abcdefg"}, - {uniqueId: 4, value:"lmnop"}, - {uniqueId: 5, value:"foghorn"}, - {uniqueId: 6, value:"qberty"}, - {uniqueId: 7, value:"qwerty"}, - {uniqueId: 8, value:""}, - {uniqueId: 9, value:"seaweed"}, - {uniqueId: 10, value:"123abc"} - - ] - } - }); - var d = new doh.Deferred(); - function completed(items, request){ - //Output should be in this order... - var orderedArray = [ "", - "123abc", - "abc", - "abcd", - "abcdefg", - "bca", - "foghorn", - "lmnop", - "qberty", - "qwerty", - "seaweed" - ]; - orderedArray = orderedArray.reverse(); - t.assertEqual(items.length, 11); - - var passed = true; - for(var i = 0; i < items.length; i++){ - var value = store.getValue(items[i], "value"); - if(!(store.getValue(items[i], "value") === orderedArray[i])){ - passed=false; - break; - } - } - t.assertTrue(passed); - if (passed){ - d.callback(true); - }else{ - d.errback(new Error("Unexpected sorting order found, sort failure.")); - } - } - - function error(error, request) { - t.assertTrue(false); - d.errback(error); - } - - var sortAttributes = [{attribute: "value", descending: true}]; - store.fetch({onComplete: completed, onError: error, sort: sortAttributes}); - return d; - } - }, - { - name: "Read API: fetch() sortDate", - runTest: function(datastore, t){ - // summary: - // Function to test sorting date. - // description: - // Function to test sorting date. - - var store = new datastore({data: { identifier: "uniqueId", - items: [ {uniqueId: 0, value: new Date(0)}, - {uniqueId: 1, value: new Date(100)}, - {uniqueId: 2, value:new Date(1000)}, - {uniqueId: 3, value:new Date(2000)}, - {uniqueId: 4, value:new Date(3000)}, - {uniqueId: 5, value:new Date(4000)}, - {uniqueId: 6, value:new Date(5000)}, - {uniqueId: 7, value:new Date(6000)}, - {uniqueId: 8, value:new Date(7000)}, - {uniqueId: 9, value:new Date(8000)}, - {uniqueId: 10, value:new Date(9000)} - - ] - } - }); - - var d = new doh.Deferred(); - function completed(items,request){ - var orderedArray = [0,100,1000,2000,3000,4000,5000,6000,7000,8000,9000]; - t.assertEqual(items.length, 11); - var passed = true; - for(var i = 0; i < items.length; i++){ - var value = store.getValue(items[i], "value"); - if(!(store.getValue(items[i], "value").getTime() === orderedArray[i])){ - passed=false; - break; - } - } - t.assertTrue(passed); - if (passed){ - d.callback(true); - }else{ - d.errback(new Error("Unexpected sorting order found, sort failure.")); - } - } - - function error(error, request){ - t.assertTrue(false); - d.errback(error); - } - - var sortAttributes = [{attribute: "value"}]; - store.fetch({onComplete: completed, onError: error, sort: sortAttributes}); - return d; - } - }, - { - name: "Read API: fetch() sortDateDescending", - runTest: function(datastore, t){ - // summary: - // Function to test sorting date in descending order. - // description: - // Function to test sorting date in descending order. - - var store = new datastore({data: { identifier: "uniqueId", - items: [ {uniqueId: 0, value: new Date(0)}, - {uniqueId: 1, value: new Date(100)}, - {uniqueId: 2, value:new Date(1000)}, - {uniqueId: 3, value:new Date(2000)}, - {uniqueId: 4, value:new Date(3000)}, - {uniqueId: 5, value:new Date(4000)}, - {uniqueId: 6, value:new Date(5000)}, - {uniqueId: 7, value:new Date(6000)}, - {uniqueId: 8, value:new Date(7000)}, - {uniqueId: 9, value:new Date(8000)}, - {uniqueId: 10, value:new Date(9000)} - - ] - } - }); - - var d = new doh.Deferred(); - function completed(items,request){ - var orderedArray = [0,100,1000,2000,3000,4000,5000,6000,7000,8000,9000]; - orderedArray = orderedArray.reverse(); - t.assertEqual(items.length, 11); - var passed = true; - for(var i = 0; i < items.length; i++){ - var value = store.getValue(items[i], "value"); - if(!(store.getValue(items[i], "value").getTime() === orderedArray[i])){ - passed=false; - break; - } - } - t.assertTrue(passed); - if (passed){ - d.callback(true); - }else{ - d.errback(new Error("Unexpected sorting order found, sort failure.")); - } - } - - function error(error, request){ - t.assertTrue(false); - d.errback(error); - } - - var sortAttributes = [{attribute: "value", descending: true}]; - store.fetch({onComplete: completed, onError: error, sort: sortAttributes}); - return d; - } - }, - { - name: "Read API: fetch() sortMultiple", - runTest: function(datastore, t){ - // summary: - // Function to test sorting on multiple attributes. - // description: - // Function to test sorting on multiple attributes. - - var store = new datastore({data: { identifier: "uniqueId", - items: [ {uniqueId: 1, value:"fo|o*b.ar"}, - {uniqueId: 2, value:"ba|r*foo"}, - {uniqueId: 3, value:"boomBam"}, - {uniqueId: 4, value:"bit$Bite"}, - {uniqueId: 5, value:"ouagadogou"}, - {uniqueId: 6, value:"jfq4@#!$!@|f1.$4r14i5u"}, - {uniqueId: 7, value:"BaB{aMa|SaRa***F}oo"}, - {uniqueId: 8, value:"squawl"}, - {uniqueId: 10, value:"seaweed"}, - {uniqueId: 12, value:"seaweed"}, - {uniqueId: 11, value:"zulu"}, - {uniqueId: 9, value:"seaweed"} - ] - } - }); - - var d = new doh.Deferred(); - function completed(items, request){ - var orderedArray0 = [7,2,4,3,1,6,5,12,10,9,8,11]; - var orderedArray1 = [ "BaB{aMa|SaRa***F}oo", - "ba|r*foo", - "bit$Bite", - "boomBam", - "fo|o*b.ar", - "jfq4@#!$!@|f1.$4r14i5u", - "ouagadogou", - "seaweed", - "seaweed", - "seaweed", - "squawl", - "zulu" - ]; - var passed = true; - for(var i = 0; i < items.length; i++){ - var value = store.getValue(items[i], "value"); - if(!( (store.getValue(items[i], "uniqueId") === orderedArray0[i])&& - (store.getValue(items[i], "value") === orderedArray1[i])) - ){ - passed=false; - break; - } - } - t.assertTrue(passed); - if (passed){ - d.callback(true); - }else{ - d.errback(new Error("Unexpected sorting order found, sort failure.")); - } - } - - function error(error, request){ - t.assertTrue(false); - d.errback(error); - } - - var sortAttributes = [{ attribute: "value"}, { attribute: "uniqueId", descending: true}]; - store.fetch({onComplete: completed, onError: error, sort: sortAttributes}); - return d; - } - }, - { - name: "Read API: fetch() sortMultipleSpecialComparator", - runTest: function(datastore, t){ - // summary: - // Function to test sorting on multiple attributes with a custom comparator. - // description: - // Function to test sorting on multiple attributes with a custom comparator. - - var store = new datastore({data: { identifier: "uniqueId", - items: [ {uniqueId: 1, status:"CLOSED"}, - {uniqueId: 2, status:"OPEN"}, - {uniqueId: 3, status:"PENDING"}, - {uniqueId: 4, status:"BLOCKED"}, - {uniqueId: 5, status:"CLOSED"}, - {uniqueId: 6, status:"OPEN"}, - {uniqueId: 7, status:"PENDING"}, - {uniqueId: 8, status:"PENDING"}, - {uniqueId: 10, status:"BLOCKED"}, - {uniqueId: 12, status:"BLOCKED"}, - {uniqueId: 11, status:"OPEN"}, - {uniqueId: 9, status:"CLOSED"} - ] - } - }); - - - store.comparatorMap = {}; - store.comparatorMap["status"] = function(a,b) { - var ret = 0; - // We want to map these by what the priority of these items are, not by alphabetical. - // So, custom comparator. - var enumMap = { OPEN: 3, BLOCKED: 2, PENDING: 1, CLOSED: 0}; - if (enumMap[a] > enumMap[b]) { - ret = 1; - } - if (enumMap[a] < enumMap[b]) { - ret = -1; - } - return ret; - }; - - var sortAttributes = [{attribute: "status", descending: true}, { attribute: "uniqueId", descending: true}]; - - var d = new doh.Deferred(); - function completed(items, findResult){ - var orderedArray = [11,6,2,12,10,4,8,7,3,9,5,1]; - var passed = true; - for(var i = 0; i < items.length; i++){ - var value = store.getValue(items[i], "value"); - if(!(store.getValue(items[i], "uniqueId") === orderedArray[i])){ - passed=false; - break; - } - } - t.assertTrue(passed); - if (passed){ - d.callback(true); - }else{ - d.errback(new Error("Unexpected sorting order found, sort failure.")); - } - } - - function error(errData, request){ - t.assertTrue(false); - d.errback(errData); - } - store.fetch({onComplete: completed, onError: error, sort: sortAttributes}); - return d; - } - }, - { - name: "Read API: fetch() sortAlphabeticWithUndefined", - runTest: function(datastore, t){ - // summary: - // Function to test sorting alphabetic ordering. - // description: - // Function to test sorting alphabetic ordering. - - var store = new datastore({data: { identifier: "uniqueId", - items: [ {uniqueId: 0, value:"abc"}, - {uniqueId: 1, value:"bca"}, - {uniqueId: 2, value:"abcd"}, - {uniqueId: 3, value:"abcdefg"}, - {uniqueId: 4, value:"lmnop"}, - {uniqueId: 5, value:"foghorn"}, - {uniqueId: 6, value:"qberty"}, - {uniqueId: 7, value:"qwerty"}, - {uniqueId: 8 }, //Deliberate undefined value - {uniqueId: 9, value:"seaweed"}, - {uniqueId: 10, value:"123abc"} - - ] - } - }); - - var d = new doh.Deferred(); - function completed(items, request){ - //Output should be in this order... - var orderedArray = [10,0,2,3,1,5,4,6,7,9,8]; - t.assertEqual(items.length, 11); - var passed = true; - for(var i = 0; i < items.length; i++){ - if(!(store.getValue(items[i], "uniqueId") === orderedArray[i])){ - passed=false; - break; - } - } - t.assertTrue(passed); - if (passed){ - d.callback(true); - }else{ - d.errback(new Error("Unexpected sorting order found, sort failure.")); - } - } - - function error(error, request) { - t.assertTrue(false); - d.errback(error); - } - - var sortAttributes = [{attribute: "value"}]; - store.fetch({onComplete: completed, onError: error, sort: sortAttributes}); - return d; - } - }, - { - name: "Read API: errorCondition_idCollision_inMemory", - runTest: function(datastore, t){ - // summary: - // Simple test of the errors thrown when there is an id collision in the data. - // Added because of tracker: #2546 - // description: - // Simple test of the errors thrown when there is an id collision in the data. - // Added because of tracker: #2546 - - var store = new datastore({ data: { identifier: "uniqueId", - items: [{uniqueId: 12345, value:"foo"}, - {uniqueId: 123456, value:"bar"}, - {uniqueId: 12345, value:"boom"}, - {uniqueId: 123457, value:"bit"} - ] - } - }); - var d = new doh.Deferred(); - function onComplete(items, request){ - //This is bad if this fires, this case should fail and not call onComplete. - t.assertTrue(false); - d.callback(false); - } - - function reportError(errData, request){ - //This is good if this fires, it is expected. - t.assertTrue(true); - d.callback(true); - } - store.fetch({onComplete: onComplete, onError: reportError}); - return d; - } - }, - { - name: "Read API: errorCondition_idCollision_xhr", - runTest: function(datastore, t){ - // summary: - // Simple test of the errors thrown when there is an id collision in the data. - // Added because of tracker: #2546 - // description: - // Simple test of the errors thrown when there is an id collision in the data. - // Added because of tracker: #2546 - - if(dojo.isBrowser){ - var store = new datastore({url: dojo.moduleUrl("tests", "data/countries_idcollision.json").toString() }); - var d = new doh.Deferred(); - function onComplete(items, request){ - //This is bad if this fires, this case should fail and not call onComplete. - t.assertTrue(false); - d.callback(false); - } - - function reportError(errData, request){ - //This is good if this fires, it is expected. - t.assertTrue(true); - d.callback(true); - } - store.fetch({onComplete: onComplete, onError: reportError}); - return d; - } - } - }, - { - name: "Read API: Date_datatype", - runTest: function(datastore, t){ - //var store = new datastore(tests.data.readOnlyItemFileTestTemplates.testFile["countries_withDates"]); - var store = new datastore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries_withDates")); - - var d = new doh.Deferred(); - function onItem(item){ - t.assertTrue(item !== null); - var independenceDate = store.getValue(item, "independence"); - t.assertTrue(independenceDate instanceof Date); - //Check to see if the value was deserialized properly. Since the store stores in UTC/GMT, it - //should also be compared in the UTC/GMT mode - t.assertTrue(dojo.date.stamp.toISOString(independenceDate, {zulu:true}) === "1993-05-24T00:00:00Z"); - d.callback(true); - } - function onError(errData){ - t.assertTrue(false); - d.errback(errData); - } - store.fetchItemByIdentity({identity:"er", onItem:onItem, onError:onError}); - return d; // Deferred - } - }, - { - name: "Read API: custom_datatype_Color_SimpleMapping", - runTest: function(datastore, t){ - // summary: - // Function to test using literal values with custom datatypes - var dataset = { - identifier:'name', - items: [ - { name:'Kermit', species:'frog', color:{_type:'Color', _value:'green'} }, - { name:'Beaker', hairColor:{_type:'Color', _value:'red'} } - ] - }; - var store = new datastore({ - data:dataset, - typeMap:{'Color': dojo.Color} - }); - var d = new doh.Deferred(); - function onItem(item){ - t.assertTrue(item !== null); - var beaker = item; - var hairColor = store.getValue(beaker, "hairColor"); - t.assertTrue(hairColor instanceof dojo.Color); - t.assertTrue(hairColor.toHex() == "#ff0000"); - d.callback(true); - } - function onError(errData){ - d.errback(errData); - } - store.fetchItemByIdentity({identity:"Beaker", onItem:onItem, onError:onError}); - return d; // Deferred - } - }, - { - name: "Read API: custom_datatype_Color_GeneralMapping", - runTest: function(datastore, t){ - // summary: - // Function to test using literal values with custom datatypes - var dataset = { - identifier:'name', - items: [ - { name:'Kermit', species:'frog', color:{_type:'Color', _value:'green'} }, - { name:'Beaker', hairColor:{_type:'Color', _value:'red'} } - ] - }; - var store = new datastore({ - data:dataset, - typeMap:{'Color': { - type: dojo.Color, - deserialize: function(value){ - return new dojo.Color(value); - } - } - } - }); - var d = new doh.Deferred(); - function onItem(item){ - t.assertTrue(item !== null); - var beaker = item; - var hairColor = store.getValue(beaker, "hairColor"); - t.assertTrue(hairColor instanceof dojo.Color); - t.assertTrue(hairColor.toHex() == "#ff0000"); - d.callback(true); - } - function onError(errData){ - d.errback(errData); - } - store.fetchItemByIdentity({identity:"Beaker", onItem:onItem, onError:onError}); - return d; // Deferred - } - }, - { - name: "Read API: hierarchical_data", - runTest: function(datastore, t){ - //var store = new datastore(tests.data.readOnlyItemFileTestTemplates.testFile["geography_hierarchy_small"]); - var store = new datastore(tests.data.readOnlyItemFileTestTemplates.getTestData("geography_hierarchy_small")); - var d = new doh.Deferred(); - function onComplete(items, request){ - t.assertEqual(items.length, 1); - var northAmerica = items[0]; - var canada = store.getValue(northAmerica, "countries"); - var toronto = store.getValue(canada, "cities"); - t.assertEqual(store.getValue(canada, "name"), "Canada"); - t.assertEqual(store.getValue(toronto, "name"), "Toronto"); - d.callback(true); - } - function onError(errData){ - d.errback(errData); - } - store.fetch({ - query: {name: "North America"}, - onComplete: onComplete, - onError: onError - }); - - return d; // Deferred - } - }, - { - name: "Identity API: no_identifier_specified", - runTest: function(datastore, t){ - var arrayOfItems = [ - {name:"Kermit", color:"green"}, - {name:"Miss Piggy", likes:"Kermit"}, - {name:"Beaker", hairColor:"red"} - ]; - var store = new datastore({data:{items:arrayOfItems}}); - var d = new doh.Deferred(); - function onComplete(items, request){ - var features = store.getFeatures(); - var hasIdentityFeature = Boolean(features['dojo.data.api.Identity']); - t.assertTrue(hasIdentityFeature); - for(var i = 0; i < items.length; ++i){ - var item = items[i]; - var identifier = store.getIdentityAttributes(item); - t.assertTrue(identifier === null); - var identity = store.getIdentity(item); - t.assertTrue(typeof identity == "number"); - } - d.callback(true); - } - function reportError(errData, request){ - d.errback(true); - } - store.fetch({onComplete: onComplete, onError: reportError}); - return d; // Deferred - } - }, - { - name: "Identity API: hierarchical_data", - runTest: function(datastore, t){ - var store = new datastore(tests.data.readOnlyItemFileTestTemplates.getTestData("geography_hierarchy_small")); - var d = new doh.Deferred(); - function onComplete(items, request){ - var features = store.getFeatures(); - var hasIdentityFeature = Boolean(features['dojo.data.api.Identity']); - t.assertTrue(hasIdentityFeature); - for(var i = 0; i < items.length; ++i){ - var item = items[i]; - var identifier = store.getIdentityAttributes(item); - t.assertTrue(identifier === null); - var identity = store.getIdentity(item); - t.assertTrue(typeof identity == "number"); - } - d.callback(true); - } - function reportError(errData, request){ - d.errback(true); - } - store.fetch({onComplete: onComplete, onError: reportError}); - return d; // Deferred - } - }, - { - name: "Read API: functionConformance", - runTest: function(datastore, t){ - // summary: - // Simple test read API conformance. Checks to see all declared functions are actual functions on the instances. - // description: - // Simple test read API conformance. Checks to see all declared functions are actual functions on the instances. - var testStore = new datastore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries")); - var readApi = new dojo.data.api.Read(); - var passed = true; - - for(i in readApi){ - if(i.toString().charAt(0) !== '_') - { - var member = readApi[i]; - //Check that all the 'Read' defined functions exist on the test store. - if(typeof member === "function"){ - var testStoreMember = testStore[i]; - if(!(typeof testStoreMember === "function")){ - passed = false; - break; - } - } - } - } - t.assertTrue(passed); - } - }, - { - name: "Identity API: functionConformance", - runTest: function(datastore, t){ - // summary: - // Simple test identity API conformance. Checks to see all declared functions are actual functions on the instances. - // description: - // Simple test identity API conformance. Checks to see all declared functions are actual functions on the instances. - var testStore = new datastore(tests.data.readOnlyItemFileTestTemplates.getTestData("countries")); - var identityApi = new dojo.data.api.Identity(); - var passed = true; - - for(i in identityApi){ - - if(i.toString().charAt(0) !== '_') - { - var member = identityApi[i]; - //Check that all the 'Read' defined functions exist on the test store. - if(typeof member === "function"){ - var testStoreMember = testStore[i]; - if(!(typeof testStoreMember === "function")){ - passed = false; - break; - } - } - } - } - t.assertTrue(passed); - } - } -]; - - -} diff --git a/includes/js/dojo/tests/data/reference_integrity.json b/includes/js/dojo/tests/data/reference_integrity.json deleted file mode 100644 index bdc6767..0000000 --- a/includes/js/dojo/tests/data/reference_integrity.json +++ /dev/null @@ -1,27 +0,0 @@ -/* -{ - "identifier": "id", - "label": "name", - "items":[ - {"id": 1, "name": "Item 1"}, - {"id": 2, "name": "Item 2"}, - {"id": 3, "name": "Item 3"}, - {"id": 4, "name": "Item 4"}, - {"id": 5, "name": "Item 5"}, - {"id": 6, "name": "Item 6"}, - {"id": 7, "name": "Item 7"}, - {"id": 8, "name": "Item 8"}, - {"id": 9, "name": "Item 9"}, - {"id": 10, "name": "Item 10", "friends": [{"_reference": 1},{"_reference": 3},{"_reference": 5}]}, - {"id": 11, "name": "Item 11", "friends": [{"_reference": 10}], "siblings": [{"_reference": 10}]}, - {"id": 12, "name": "Item 12", "friends": [{"_reference": 3},{"_reference": 7}], "enemies": [{"_reference": 10}]}, - {"id": 13, "name": "Item 13", "friends": [{"_reference": 10}]}, - {"id": 14, "name": "Item 14", "friends": [{"_reference": 11}]}, - {"id": 15, "name": "item 15", "friends": [{"id": 16, "name": "Item 16"}]} - ] -} -*/ - - - - diff --git a/includes/js/dojo/tests/data/runTests.html b/includes/js/dojo/tests/data/runTests.html deleted file mode 100644 index ee3d473..0000000 --- a/includes/js/dojo/tests/data/runTests.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - dojo.data D.O.H. Unit Test Runner - - - Redirecting to D.O.H runner. - - diff --git a/includes/js/dojo/tests/data/utils.js b/includes/js/dojo/tests/data/utils.js deleted file mode 100644 index 8b26037..0000000 --- a/includes/js/dojo/tests/data/utils.js +++ /dev/null @@ -1,203 +0,0 @@ -if(!dojo._hasResource["tests.data.utils"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests.data.utils"] = true; -dojo.provide("tests.data.utils"); -dojo.require("dojo.data.util.filter"); -dojo.require("dojo.data.util.sorter"); - -tests.register("tests.data.utils", - [ - function testWildcardFilter_1(t){ - var pattern = "ca*"; - var values = ["ca", "california", "Macca", "Macca*b", "Macca\\b"]; - - t.assertTrue(values[0].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertTrue(values[1].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[2].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[3].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[4].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - }, - function testWildcardFilter_2(t){ - var pattern = "*ca"; - var values = ["ca", "california", "Macca", "Macca*b", "Macca\\b"]; - - t.assertTrue(values[0].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[1].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertTrue(values[2].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[3].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[4].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - }, - function testWildcardFilter_3(t){ - var pattern = "*ca*"; - var values = ["ca", "california", "Macca", "Macca*b", "Macca\\b"]; - - t.assertTrue(values[0].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertTrue(values[1].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertTrue(values[2].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertTrue(values[3].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertTrue(values[4].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - }, - function testWildcardFilter_4(t){ - //Try and match ca*b - var pattern = "*c*a\\*b*"; - var values = ["ca", "california", "Macca", "Macca*b", "Macca\\b"]; - - t.assertFalse(values[0].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[1].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[2].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertTrue(values[3].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[4].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - }, - function testWildcardFilter_5(t){ - var pattern = "*c*a\\\\*b"; - var values = ["ca", "california", "Macca", "Macca*b", "Macca\\b"]; - - t.assertFalse(values[0].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[1].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[2].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[3].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertTrue(values[4].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - }, - function testWildcardFilter_caseInsensitive(t){ - var pattern = "ca*"; - var values = ["CA", "california", "Macca", "Macca*b", "Macca\\b"]; - - t.assertTrue(values[0].match(dojo.data.util.filter.patternToRegExp(pattern, true))!== null); - t.assertTrue(values[1].match(dojo.data.util.filter.patternToRegExp(pattern, true))!== null); - t.assertFalse(values[2].match(dojo.data.util.filter.patternToRegExp(pattern, true))!== null); - t.assertFalse(values[3].match(dojo.data.util.filter.patternToRegExp(pattern, true))!== null); - t.assertFalse(values[4].match(dojo.data.util.filter.patternToRegExp(pattern, true))!== null); - }, - function testSingleChar_1(t){ - var pattern = "bob?le"; - var values = ["bobble", "boble", "foo", "bobBle", "bar"]; - - t.assertTrue(values[0].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[1].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[2].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertTrue(values[3].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[4].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - }, - function testSingleChar_2(t){ - var pattern = "?ob?le"; - var values = ["bobble", "cob1le", "foo", "bobBle", "bar"]; - - t.assertTrue(values[0].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertTrue(values[1].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[2].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertTrue(values[3].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[4].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - }, - function testBracketChar(t){ - //Make sure we don't treat this as regexp - var pattern = "*[*]*"; - var values = ["bo[b]ble", "cob1le", "foo", "[bobBle]", "b[]ar"]; - - t.assertTrue(values[0].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[1].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[2].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertTrue(values[3].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertTrue(values[4].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - }, - function testBraceChar(t){ - //Make sure we don't treat this as regexp - var pattern = "*{*}*"; - var values = ["bo{b}ble", "cob1le", "foo", "{bobBle}", "b{}ar"]; - - t.assertTrue(values[0].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[1].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[2].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertTrue(values[3].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertTrue(values[4].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - }, - function testParenChar(t){ - //Make sure we don't treat this as regexp - var pattern = "*(*)*"; - var values = ["bo(b)ble", "cob1le", "foo", "{bobBle}", "b()ar"]; - - t.assertTrue(values[0].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[1].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[2].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[3].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertTrue(values[4].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - }, - function testPlusChar(t){ - //Make sure we don't treat this as regexp, so match anything with a + in it. - var pattern = "*+*"; - var values = ["bo+ble", "cob1le", "foo", "{bobBle}", "b{}ar"]; - - t.assertTrue(values[0].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[1].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[2].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[3].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[4].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - }, - function testPeriodChar(t){ - //Make sure we don't treat this as regexp, so match anything with a period - var pattern = "*.*"; - var values = ["bo.ble", "cob1le", "foo", "{bobBle}", "b{}ar"]; - - t.assertTrue(values[0].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[1].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[2].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[3].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[4].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - }, - function testBarChar(t){ - //Make sure we don't treat this as regexp, so match anything with a pipe bar - var pattern = "*|*"; - var values = ["bo.ble", "cob|le", "foo", "{bobBle}", "b{}ar"]; - - t.assertFalse(values[0].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertTrue(values[1].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[2].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[3].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[4].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - }, - function testDollarSignChar(t){ - //Make sure we don't treat this as regexp, so match anything with a $ in it - var pattern = "*$*"; - var values = ["bo$ble", "cob$le", "foo", "{bobBle}", "b{}ar"]; - - t.assertTrue(values[0].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertTrue(values[1].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[2].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[3].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[4].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - }, - function testCarrotChar(t){ - //Make sure we don't treat this as regexp, so match anything with a ^ in it - var pattern = "*^*"; - var values = ["bo$ble", "cob$le", "f^oo", "{bobBle}", "b{}ar"]; - - t.assertFalse(values[0].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[1].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertTrue(values[2].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[3].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[4].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - }, - function testEscapeChar(t){ - //Make sure we escape properly, so match this single word. - var pattern = "bob\*ble"; - var values = ["bob*ble", "cob$le", "f^oo", "{bobBle}", "b{}ar"]; - - t.assertTrue(values[0].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[1].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[2].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[3].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[4].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - }, - function testAbsoluteMatch(t){ - var pattern = "bobble"; - var values = ["bobble", "cob$le", "f^oo", "{bobBle}", "b{}ar"]; - - t.assertTrue(values[0].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[1].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[2].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[3].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - t.assertFalse(values[4].match(dojo.data.util.filter.patternToRegExp(pattern))!== null); - } - ] -); - - -} diff --git a/includes/js/dojo/tests/date.js b/includes/js/dojo/tests/date.js deleted file mode 100644 index 57df0fd..0000000 --- a/includes/js/dojo/tests/date.js +++ /dev/null @@ -1,716 +0,0 @@ -if(!dojo._hasResource["tests.date"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests.date"] = true; -dojo.provide("tests.date"); - -dojo.require("dojo.date"); - -tests.register("tests.date.util", - [ - -/* Informational Functions - **************************/ - -function test_date_getDaysInMonth(t){ - // months other than February - t.is(31, dojo.date.getDaysInMonth(new Date(2006,0,1))); - t.is(31, dojo.date.getDaysInMonth(new Date(2006,2,1))); - t.is(30, dojo.date.getDaysInMonth(new Date(2006,3,1))); - t.is(31, dojo.date.getDaysInMonth(new Date(2006,4,1))); - t.is(30, dojo.date.getDaysInMonth(new Date(2006,5,1))); - t.is(31, dojo.date.getDaysInMonth(new Date(2006,6,1))); - t.is(31, dojo.date.getDaysInMonth(new Date(2006,7,1))); - t.is(30, dojo.date.getDaysInMonth(new Date(2006,8,1))); - t.is(31, dojo.date.getDaysInMonth(new Date(2006,9,1))); - t.is(30, dojo.date.getDaysInMonth(new Date(2006,10,1))); - t.is(31, dojo.date.getDaysInMonth(new Date(2006,11,1))); - - // Februarys - t.is(28, dojo.date.getDaysInMonth(new Date(2006,1,1))); - t.is(29, dojo.date.getDaysInMonth(new Date(2004,1,1))); - t.is(29, dojo.date.getDaysInMonth(new Date(2000,1,1))); - t.is(28, dojo.date.getDaysInMonth(new Date(1900,1,1))); - t.is(28, dojo.date.getDaysInMonth(new Date(1800,1,1))); - t.is(28, dojo.date.getDaysInMonth(new Date(1700,1,1))); - t.is(29, dojo.date.getDaysInMonth(new Date(1600,1,1))); -}, - -function test_date_isLeapYear(t){ - t.f(dojo.date.isLeapYear(new Date(2006,0,1))); - t.t(dojo.date.isLeapYear(new Date(2004,0,1))); - t.t(dojo.date.isLeapYear(new Date(2000,0,1))); - t.f(dojo.date.isLeapYear(new Date(1900,0,1))); - t.f(dojo.date.isLeapYear(new Date(1800,0,1))); - t.f(dojo.date.isLeapYear(new Date(1700,0,1))); - t.t(dojo.date.isLeapYear(new Date(1600,0,1))); -}, - -// The getTimezone function pulls from either the date's toString or -// toLocaleString method -- it's really just a string-processing -// function (assuming the Date obj passed in supporting both toString -// and toLocaleString) and as such can be tested for multiple browsers -// by manually settting up fake Date objects with the actual strings -// produced by various browser/OS combinations. -// FIXME: the function and tests are not localized. -function test_date_getTimezoneName(t){ - - // Create a fake Date object with toString and toLocaleString - // results manually set to simulate tests for multiple browsers - function FakeDate(str, strLocale){ - this.str = str || ''; - this.strLocale = strLocale || ''; - this.toString = function() { - return this.str; - }; - this.toLocaleString = function(){ - return this.strLocale; - }; - } - var dt = new FakeDate(); - - // FF 1.5 Ubuntu Linux (Breezy) - dt.str = 'Sun Sep 17 2006 22:25:51 GMT-0500 (CDT)'; - dt.strLocale = 'Sun 17 Sep 2006 10:25:51 PM CDT'; - t.is('CDT', dojo.date.getTimezoneName(dt)); - - // Safari 2.0 Mac OS X 10.4 - dt.str = 'Sun Sep 17 2006 22:55:01 GMT-0500'; - dt.strLocale = 'September 17, 2006 10:55:01 PM CDT'; - t.is('CDT', dojo.date.getTimezoneName(dt)); - - // FF 1.5 Mac OS X 10.4 - dt.str = 'Sun Sep 17 2006 22:57:18 GMT-0500 (CDT)'; - dt.strLocale = 'Sun Sep 17 22:57:18 2006'; - t.is('CDT', dojo.date.getTimezoneName(dt)); - - // Opera 9 Mac OS X 10.4 -- no TZ data expect empty string return - dt.str = 'Sun, 17 Sep 2006 22:58:06 GMT-0500'; - dt.strLocale = 'Sunday September 17, 22:58:06 GMT-0500 2006'; - t.is('', dojo.date.getTimezoneName(dt)); - - // IE 6 Windows XP - dt.str = 'Mon Sep 18 11:21:07 CDT 2006'; - dt.strLocale = 'Monday, September 18, 2006 11:21:07 AM'; - t.is('CDT', dojo.date.getTimezoneName(dt)); - - // Opera 9 Ubuntu Linux (Breezy) -- no TZ data expect empty string return - dt.str = 'Mon, 18 Sep 2006 13:30:32 GMT-0500'; - dt.strLocale = 'Monday September 18, 13:30:32 GMT-0500 2006'; - t.is('', dojo.date.getTimezoneName(dt)); - - // IE 5.5 Windows 2000 - dt.str = 'Mon Sep 18 13:49:22 CDT 2006'; - dt.strLocale = 'Monday, September 18, 2006 1:49:22 PM'; - t.is('CDT', dojo.date.getTimezoneName(dt)); -} - ] -); - -tests.register("tests.date.math", - [ -function test_date_compare(t){ - var d1=new Date(); - d1.setHours(0); - var d2=new Date(); - d2.setFullYear(2005); - d2.setHours(12); - t.is(0, dojo.date.compare(d1, d1)); - t.is(1, dojo.date.compare(d1, d2, "date")); - t.is(-1, dojo.date.compare(d2, d1, "date")); - t.is(-1, dojo.date.compare(d1, d2, "time")); - t.is(1, dojo.date.compare(d1, d2, "datetime")); -}, -function test_date_add(t){ - var interv = ''; // Interval (e.g., year, month) - var dtA = null; // Date to increment - var dtB = null; // Expected result date - - interv = "year"; - dtA = new Date(2005, 11, 27); - dtB = new Date(2006, 11, 27); - t.is(dtB, dojo.date.add(dtA, interv, 1)); - - dtA = new Date(2005, 11, 27); - dtB = new Date(2004, 11, 27); - t.is(dtB, dojo.date.add(dtA, interv, -1)); - - dtA = new Date(2000, 1, 29); - dtB = new Date(2001, 1, 28); - t.is(dtB, dojo.date.add(dtA, interv, 1)); - - dtA = new Date(2000, 1, 29); - dtB = new Date(2005, 1, 28); - t.is(dtB, dojo.date.add(dtA, interv, 5)); - - dtA = new Date(1900, 11, 31); - dtB = new Date(1930, 11, 31); - t.is(dtB, dojo.date.add(dtA, interv, 30)); - - dtA = new Date(1995, 11, 31); - dtB = new Date(2030, 11, 31); - t.is(dtB, dojo.date.add(dtA, interv, 35)); - - interv = "quarter"; - dtA = new Date(2000, 0, 1); - dtB = new Date(2000, 3, 1); - t.is(dtB, dojo.date.add(dtA, interv, 1)); - - dtA = new Date(2000, 1, 29); - dtB = new Date(2000, 7, 29); - t.is(dtB, dojo.date.add(dtA, interv, 2)); - - dtA = new Date(2000, 1, 29); - dtB = new Date(2001, 1, 28); - t.is(dtB, dojo.date.add(dtA, interv, 4)); - - interv = "month"; - dtA = new Date(2000, 0, 1); - dtB = new Date(2000, 1, 1); - t.is(dtB, dojo.date.add(dtA, interv, 1)); - - dtA = new Date(2000, 0, 31); - dtB = new Date(2000, 1, 29); - t.is(dtB, dojo.date.add(dtA, interv, 1)); - - dtA = new Date(2000, 1, 29); - dtB = new Date(2001, 1, 28); - t.is(dtB, dojo.date.add(dtA, interv, 12)); - - interv = "week"; - dtA = new Date(2000, 0, 1); - dtB = new Date(2000, 0, 8); - t.is(dtB, dojo.date.add(dtA, interv, 1)); - - interv = "day"; - dtA = new Date(2000, 0, 1); - dtB = new Date(2000, 0, 2); - t.is(dtB, dojo.date.add(dtA, interv, 1)); - - dtA = new Date(2001, 0, 1); - dtB = new Date(2002, 0, 1); - t.is(dtB, dojo.date.add(dtA, interv, 365)); - - dtA = new Date(2000, 0, 1); - dtB = new Date(2001, 0, 1); - t.is(dtB, dojo.date.add(dtA, interv, 366)); - - dtA = new Date(2000, 1, 28); - dtB = new Date(2000, 1, 29); - t.is(dtB, dojo.date.add(dtA, interv, 1)); - - dtA = new Date(2001, 1, 28); - dtB = new Date(2001, 2, 1); - t.is(dtB, dojo.date.add(dtA, interv, 1)); - - dtA = new Date(2000, 2, 1); - dtB = new Date(2000, 1, 29); - t.is(dtB, dojo.date.add(dtA, interv, -1)); - - dtA = new Date(2001, 2, 1); - dtB = new Date(2001, 1, 28); - t.is(dtB, dojo.date.add(dtA, interv, -1)); - - dtA = new Date(2000, 0, 1); - dtB = new Date(1999, 11, 31); - t.is(dtB, dojo.date.add(dtA, interv, -1)); - - interv = "weekday"; - // Sat, Jan 1 - dtA = new Date(2000, 0, 1); - // Should be Mon, Jan 3 - dtB = new Date(2000, 0, 3); - t.is(dtB, dojo.date.add(dtA, interv, 1)); - - // Sun, Jan 2 - dtA = new Date(2000, 0, 2); - // Should be Mon, Jan 3 - dtB = new Date(2000, 0, 3); - t.is(dtB, dojo.date.add(dtA, interv, 1)); - - // Sun, Jan 2 - dtA = new Date(2000, 0, 2); - // Should be Fri, Jan 7 - dtB = new Date(2000, 0, 7); - t.is(dtB, dojo.date.add(dtA, interv, 5)); - - // Sun, Jan 2 - dtA = new Date(2000, 0, 2); - // Should be Mon, Jan 10 - dtB = new Date(2000, 0, 10); - t.is(dtB, dojo.date.add(dtA, interv, 6)); - - // Mon, Jan 3 - dtA = new Date(2000, 0, 3); - // Should be Mon, Jan 17 - dtB = new Date(2000, 0, 17); - t.is(dtB, dojo.date.add(dtA, interv, 10)); - - // Sat, Jan 8 - dtA = new Date(2000, 0, 8); - // Should be Mon, Jan 3 - dtB = new Date(2000, 0, 3); - t.is(dtB, dojo.date.add(dtA, interv, -5)); - - // Sun, Jan 9 - dtA = new Date(2000, 0, 9); - // Should be Wed, Jan 5 - dtB = new Date(2000, 0, 5); - t.is(dtB, dojo.date.add(dtA, interv, -3)); - - // Sun, Jan 23 - dtA = new Date(2000, 0, 23); - // Should be Fri, Jan 7 - dtB = new Date(2000, 0, 7); - t.is(dtB, dojo.date.add(dtA, interv, -11)); - - interv = "hour"; - dtA = new Date(2000, 0, 1, 11); - dtB = new Date(2000, 0, 1, 12); - t.is(dtB, dojo.date.add(dtA, interv, 1)); - - dtA = new Date(2001, 9, 28, 0); - dtB = new Date(dtA.getTime() + (60 * 60 * 1000)); - t.is(dtB, dojo.date.add(dtA, interv, 1)); - - dtA = new Date(2001, 9, 28, 23); - dtB = new Date(2001, 9, 29, 0); - t.is(dtB, dojo.date.add(dtA, interv, 1)); - - dtA = new Date(2001, 11, 31, 23); - dtB = new Date(2002, 0, 1, 0); - t.is(dtB, dojo.date.add(dtA, interv, 1)); - - interv = "minute"; - dtA = new Date(2000, 11, 31, 23, 59); - dtB = new Date(2001, 0, 1, 0, 0); - t.is(dtB, dojo.date.add(dtA, interv, 1)); - - dtA = new Date(2000, 11, 27, 12, 2); - dtB = new Date(2000, 11, 27, 13, 2); - t.is(dtB, dojo.date.add(dtA, interv, 60)); - - interv = "second"; - dtA = new Date(2000, 11, 31, 23, 59, 59); - dtB = new Date(2001, 0, 1, 0, 0, 0); - t.is(dtB, dojo.date.add(dtA, interv, 1)); - - dtA = new Date(2000, 11, 27, 8, 10, 59); - dtB = new Date(2000, 11, 27, 8, 11, 59); - t.is(dtB, dojo.date.add(dtA, interv, 60)); - - // Test environment JS Date doesn't support millisec? - //interv = "millisecond"; - // - //dtA = new Date(2000, 11, 31, 23, 59, 59, 999); - //dtB = new Date(2001, 0, 1, 0, 0, 0, 0); - //t.is(dtB, dojo.date.add(dtA, interv, 1)); - // - //dtA = new Date(2000, 11, 27, 8, 10, 53, 2); - //dtB = new Date(2000, 11, 27, 8, 10, 54, 2); - //t.is(dtB, dojo.date.add(dtA, interv, 1000)); -}, -function test_date_diff(t){ - var dtA = null; // First date to compare - var dtB = null; // Second date to compare - var interv = ''; // Interval to compare on (e.g., year, month) - - interv = "year"; - dtA = new Date(2005, 11, 27); - dtB = new Date(2006, 11, 27); - t.is(1, dojo.date.difference(dtA, dtB, interv)); - - dtA = new Date(2000, 11, 31); - dtB = new Date(2001, 0, 1); - t.is(1, dojo.date.difference(dtA, dtB, interv)); - - interv = "quarter"; - dtA = new Date(2000, 1, 29); - dtB = new Date(2001, 2, 1); - t.is(4, dojo.date.difference(dtA, dtB, interv)); - - dtA = new Date(2000, 11, 1); - dtB = new Date(2001, 0, 1); - t.is(1, dojo.date.difference(dtA, dtB, interv)); - - interv = "month"; - dtA = new Date(2000, 1, 29); - dtB = new Date(2001, 2, 1); - t.is(13, dojo.date.difference(dtA, dtB, interv)); - - dtA = new Date(2000, 11, 1); - dtB = new Date(2001, 0, 1); - t.is(1, dojo.date.difference(dtA, dtB, interv)); - - interv = "week"; - dtA = new Date(2000, 1, 1); - dtB = new Date(2000, 1, 8); - t.is(1, dojo.date.difference(dtA, dtB, interv)); - - dtA = new Date(2000, 1, 28); - dtB = new Date(2000, 2, 6); - t.is(1, dojo.date.difference(dtA, dtB, interv)); - - dtA = new Date(2000, 2, 6); - dtB = new Date(2000, 1, 28); - t.is(-1, dojo.date.difference(dtA, dtB, interv)); - - interv = "day"; - dtA = new Date(2000, 1, 29); - dtB = new Date(2000, 2, 1); - t.is(1, dojo.date.difference(dtA, dtB, interv)); - - dtA = new Date(2000, 11, 31); - dtB = new Date(2001, 0, 1); - t.is(1, dojo.date.difference(dtA, dtB, interv)); - - // DST leap -- check for rounding err - // This is dependent on US calendar, but - // shouldn't break in other locales - dtA = new Date(2005, 3, 3); - dtB = new Date(2005, 3, 4); - t.is(1, dojo.date.difference(dtA, dtB, interv)); - - interv = "weekday"; - dtA = new Date(2006, 7, 3); - dtB = new Date(2006, 7, 11); - t.is(6, dojo.date.difference(dtA, dtB, interv)); - - // Positive diffs - dtA = new Date(2006, 7, 4); - dtB = new Date(2006, 7, 11); - t.is(5, dojo.date.difference(dtA, dtB, interv)); - - dtA = new Date(2006, 7, 5); - dtB = new Date(2006, 7, 11); - t.is(5, dojo.date.difference(dtA, dtB, interv)); - - dtA = new Date(2006, 7, 6); - dtB = new Date(2006, 7, 11); - t.is(5, dojo.date.difference(dtA, dtB, interv)); - - dtA = new Date(2006, 7, 7); - dtB = new Date(2006, 7, 11); - t.is(4, dojo.date.difference(dtA, dtB, interv)); - - dtA = new Date(2006, 7, 7); - dtB = new Date(2006, 7, 13); - t.is(4, dojo.date.difference(dtA, dtB, interv)); - - dtA = new Date(2006, 7, 7); - dtB = new Date(2006, 7, 14); - t.is(5, dojo.date.difference(dtA, dtB, interv)); - - dtA = new Date(2006, 7, 7); - dtB = new Date(2006, 7, 15); - t.is(6, dojo.date.difference(dtA, dtB, interv)); - - dtA = new Date(2006, 7, 7); - dtB = new Date(2006, 7, 28); - t.is(15, dojo.date.difference(dtA, dtB, interv)); - - dtA = new Date(2006, 2, 2); - dtB = new Date(2006, 2, 28); - t.is(18, dojo.date.difference(dtA, dtB, interv)); - - // Negative diffs - dtA = new Date(2006, 7, 11); - dtB = new Date(2006, 7, 4); - t.is(-5, dojo.date.difference(dtA, dtB, interv)); - - dtA = new Date(2006, 7, 11); - dtB = new Date(2006, 7, 5); - t.is(-4, dojo.date.difference(dtA, dtB, interv)); - - dtA = new Date(2006, 7, 11); - dtB = new Date(2006, 7, 6); - t.is(-4, dojo.date.difference(dtA, dtB, interv)); - - dtA = new Date(2006, 7, 11); - dtB = new Date(2006, 7, 7); - t.is(-4, dojo.date.difference(dtA, dtB, interv)); - - dtA = new Date(2006, 7, 13); - dtB = new Date(2006, 7, 7); - t.is(-5, dojo.date.difference(dtA, dtB, interv)); - - dtA = new Date(2006, 7, 14); - dtB = new Date(2006, 7, 7); - t.is(-5, dojo.date.difference(dtA, dtB, interv)); - - dtA = new Date(2006, 7, 15); - dtB = new Date(2006, 7, 7); - t.is(-6, dojo.date.difference(dtA, dtB, interv)); - - dtA = new Date(2006, 7, 28); - dtB = new Date(2006, 7, 7); - t.is(-15, dojo.date.difference(dtA, dtB, interv)); - - dtA = new Date(2006, 2, 28); - dtB = new Date(2006, 2, 2); - t.is(-18, dojo.date.difference(dtA, dtB, interv)); - - // Two days on the same weekend -- no weekday diff - dtA = new Date(2006, 7, 5); - dtB = new Date(2006, 7, 6); - t.is(0, dojo.date.difference(dtA, dtB, interv)); - - interv = "hour"; - dtA = new Date(2000, 11, 31, 23); - dtB = new Date(2001, 0, 1, 0); - t.is(1, dojo.date.difference(dtA, dtB, interv)); - - dtA = new Date(2000, 11, 31, 12); - dtB = new Date(2001, 0, 1, 0); - t.is(12, dojo.date.difference(dtA, dtB, interv)); - - interv = "minute"; - dtA = new Date(2000, 11, 31, 23, 59); - dtB = new Date(2001, 0, 1, 0, 0); - t.is(1, dojo.date.difference(dtA, dtB, interv)); - - dtA = new Date(2000, 1, 28, 23, 59); - dtB = new Date(2000, 1, 29, 0, 0); - t.is(1, dojo.date.difference(dtA, dtB, interv)); - - interv = "second"; - dtA = new Date(2000, 11, 31, 23, 59, 59); - dtB = new Date(2001, 0, 1, 0, 0, 0); - t.is(1, dojo.date.difference(dtA, dtB, interv)); - - interv = "millisecond"; - dtA = new Date(2000, 11, 31, 23, 59, 59, 999); - dtB = new Date(2001, 0, 1, 0, 0, 0, 0); - t.is(1, dojo.date.difference(dtA, dtB, interv)); - - dtA = new Date(2000, 11, 31, 23, 59, 59, 0); - dtB = new Date(2001, 0, 1, 0, 0, 0, 0); - t.is(1000, dojo.date.difference(dtA, dtB, interv)); -}, -function test_date_add_diff_year(t){ - var interv = ''; // Interval (e.g., year, month) - var dtA = null; // Date to increment - var dtB = null; // Expected result date - - interv = "year"; - dtA = new Date(2005, 11, 27); - dtB = dojo.date.add(dtA, interv, 1); - t.is(dojo.date.difference(dtA, dtB, interv), 1); - - dtA = new Date(2005, 11, 27); - dtB = dojo.date.add(dtA, interv, -1); - t.is(dojo.date.difference(dtA, dtB, interv), -1); - - dtA = new Date(2000, 1, 29); - dtB = dojo.date.add(dtA, interv, 1); - t.is(dojo.date.difference(dtA, dtB, interv), 1); - - dtA = new Date(2000, 1, 29); - dtB = dojo.date.add(dtA, interv, 5); - t.is(dojo.date.difference(dtA, dtB, interv), 5); - - dtA = new Date(1900, 11, 31); - dtB = dojo.date.add(dtA, interv, 30); - t.is(dojo.date.difference(dtA, dtB, interv), 30); - - dtA = new Date(1995, 11, 31); - dtB = dojo.date.add(dtA, interv, 35); - t.is(dojo.date.difference(dtA, dtB, interv), 35); -}, -function test_date_add_diff_quarter(t){ - var interv = ''; // Interval (e.g., year, month) - var dtA = null; // Date to increment - var dtB = null; // Expected result date - interv = "quarter"; - dtA = new Date(2000, 0, 1); - dtB = dojo.date.add(dtA, interv, 1); - t.is(dojo.date.difference(dtA, dtB, interv), 1); - - dtA = new Date(2000, 1, 29); - dtB = dojo.date.add(dtA, interv, 2); - t.is(dojo.date.difference(dtA, dtB, interv), 2); - - dtA = new Date(2000, 1, 29); - dtB = dojo.date.add(dtA, interv, 4); - t.is(dojo.date.difference(dtA, dtB, interv), 4); -}, -function test_date_add_diff_month(t){ - var interv = ''; // Interval (e.g., year, month) - var dtA = null; // Date to increment - var dtB = null; // Expected result date - interv = "month"; - dtA = new Date(2000, 0, 1); - dtB = dojo.date.add(dtA, interv, 1); - t.is(dojo.date.difference(dtA, dtB, interv), 1); - - dtA = new Date(2000, 0, 31); - dtB = dojo.date.add(dtA, interv, 1); - t.is(dojo.date.difference(dtA, dtB, interv), 1); - - dtA = new Date(2000, 1, 29); - dtB = dojo.date.add(dtA, interv, 12); - t.is(dojo.date.difference(dtA, dtB, interv), 12); -}, -function test_date_add_diff_week(t){ - var interv = ''; // Interval (e.g., year, month) - var dtA = null; // Date to increment - var dtB = null; // Expected result date - interv = "week"; - dtA = new Date(2000, 0, 1); - dtB = dojo.date.add(dtA, interv, 1); - t.is(dojo.date.difference(dtA, dtB, interv), 1); -}, -function test_date_add_diff_day(t){ - var interv = ''; // Interval (e.g., year, month) - var dtA = null; // Date to increment - var dtB = null; // Expected result date - interv = "day"; - dtA = new Date(2000, 0, 1); - dtB = dojo.date.add(dtA, interv, 1); - t.is(dojo.date.difference(dtA, dtB, interv), 1); - - dtA = new Date(2001, 0, 1); - dtB = dojo.date.add(dtA, interv, 365); - t.is(dojo.date.difference(dtA, dtB, interv), 365); - - dtA = new Date(2000, 0, 1); - dtB = dojo.date.add(dtA, interv, 366); - t.is(dojo.date.difference(dtA, dtB, interv), 366); - - dtA = new Date(2000, 1, 28); - dtB = dojo.date.add(dtA, interv, 1); - t.is(dojo.date.difference(dtA, dtB, interv), 1); - - dtA = new Date(2001, 1, 28); - dtB = dojo.date.add(dtA, interv, 1); - t.is(dojo.date.difference(dtA, dtB, interv), 1); - - dtA = new Date(2000, 2, 1); - dtB = dojo.date.add(dtA, interv, -1); - t.is(dojo.date.difference(dtA, dtB, interv), -1); - - dtA = new Date(2001, 2, 1); - dtB = dojo.date.add(dtA, interv, -1); - t.is(dojo.date.difference(dtA, dtB, interv), -1); - - dtA = new Date(2000, 0, 1); - dtB = dojo.date.add(dtA, interv, -1); - t.is(dojo.date.difference(dtA, dtB, interv), -1); -}, -function test_date_add_diff_weekday(t){ - var interv = ''; // Interval (e.g., year, month) - var dtA = null; // Date to increment - var dtB = null; // Expected result date - interv = "weekday"; - // Sat, Jan 1 - dtA = new Date(2000, 0, 1); - // Should be Mon, Jan 3 - dtB = dojo.date.add(dtA, interv, 1); - t.is(dojo.date.difference(dtA, dtB, interv), 1); - - // Sun, Jan 2 - dtA = new Date(2000, 0, 2); - // Should be Mon, Jan 3 - dtB = dojo.date.add(dtA, interv, 1); - t.is(dojo.date.difference(dtA, dtB, interv), 1); - - // Sun, Jan 2 - dtA = new Date(2000, 0, 2); - // Should be Fri, Jan 7 - dtB = dojo.date.add(dtA, interv, 5); - t.is(dojo.date.difference(dtA, dtB, interv), 5); - - // Sun, Jan 2 - dtA = new Date(2000, 0, 2); - // Should be Mon, Jan 10 - dtB = dojo.date.add(dtA, interv, 6); - t.is(dojo.date.difference(dtA, dtB, interv), 6); - - // Mon, Jan 3 - dtA = new Date(2000, 0, 3); - // Should be Mon, Jan 17 - dtB = dojo.date.add(dtA, interv, 10); - t.is(dojo.date.difference(dtA, dtB, interv), 10); - - // Sat, Jan 8 - dtA = new Date(2000, 0, 8); - // Should be Mon, Jan 3 - dtB = dojo.date.add(dtA, interv, -5); - t.is(dojo.date.difference(dtA, dtB, interv), -5); - - // Sun, Jan 9 - dtA = new Date(2000, 0, 9); - // Should be Wed, Jan 5 - dtB = dojo.date.add(dtA, interv, -3); - t.is(dojo.date.difference(dtA, dtB, interv), -3); - - // Sun, Jan 23 - dtA = new Date(2000, 0, 23); - // Should be Fri, Jan 7 - dtB = dojo.date.add(dtA, interv, -11); - t.is(dojo.date.difference(dtA, dtB, interv), -11); -}, -function test_date_add_diff_hour(t){ - var interv = ''; // Interval (e.g., year, month) - var dtA = null; // Date to increment - var dtB = null; // Expected result date - interv = "hour"; - dtA = new Date(2000, 0, 1, 11); - dtB = dojo.date.add(dtA, interv, 1); - t.is(dojo.date.difference(dtA, dtB, interv), 1); - - dtA = new Date(2001, 9, 28, 0); - dtB = dojo.date.add(dtA, interv, 1); - t.is(dojo.date.difference(dtA, dtB, interv), 1); - - dtA = new Date(2001, 9, 28, 23); - dtB = dojo.date.add(dtA, interv, 1); - t.is(dojo.date.difference(dtA, dtB, interv), 1); - - dtA = new Date(2001, 11, 31, 23); - dtB = dojo.date.add(dtA, interv, 1); - t.is(dojo.date.difference(dtA, dtB, interv), 1); -}, -function test_date_add_diff_minute(t){ - var interv = ''; // Interval (e.g., year, month) - var dtA = null; // Date to increment - var dtB = null; // Expected result date - interv = "minute"; - dtA = new Date(2000, 11, 31, 23, 59); - dtB = dojo.date.add(dtA, interv, 1); - t.is(dojo.date.difference(dtA, dtB, interv), 1); - - dtA = new Date(2000, 11, 27, 12, 2); - dtB = dojo.date.add(dtA, interv, 60); - t.is(dojo.date.difference(dtA, dtB, interv), 60); -}, -function test_date_add_diff_second(t){ - var interv = ''; // Interval (e.g., year, month) - var dtA = null; // Date to increment - var dtB = null; // Expected result date - console.debug("second"); - interv = "second"; - dtA = new Date(2000, 11, 31, 23, 59, 59); - dtB = dojo.date.add(dtA, interv, 1); - t.is(dojo.date.difference(dtA, dtB, interv), 1); - - dtA = new Date(2000, 11, 27, 8, 10, 59); - dtB = dojo.date.add(dtA, interv, 60); - t.is(dojo.date.difference(dtA, dtB, interv), 60); - - // Test environment JS Date doesn't support millisec? - //interv = "millisecond"; - // - //dtA = new Date(2000, 11, 31, 23, 59, 59, 999); - //dtB = dojo.date.add(dtA, interv, 1); - //t.is(dojo.date.difference(dtA, dtB, interv), 1); - // - //dtA = new Date(2000, 11, 27, 8, 10, 53, 2); - //dtB = dojo.date.add(dtA, interv, 1000); - //t.is(dojo.date.difference(dtA, dtB, interv), 1000); -} - ] -); - -dojo.require("tests.date.locale"); -dojo.require("tests.date.stamp"); - -} diff --git a/includes/js/dojo/tests/date/locale.js b/includes/js/dojo/tests/date/locale.js deleted file mode 100644 index 77512a0..0000000 --- a/includes/js/dojo/tests/date/locale.js +++ /dev/null @@ -1,398 +0,0 @@ -if(!dojo._hasResource["tests.date.locale"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests.date.locale"] = true; -dojo.provide("tests.date.locale"); - -dojo.require("dojo.date.locale"); - -tests.register("tests.date.locale", - [ - { - // Test formatting and parsing of dates in various locales pre-built in dojo.cldr - // NOTE: we can't set djConfig.extraLocale before bootstrapping unit tests, so directly - // load resources here for specific locales: - - name: "date.locale", - setUp: function(){ - var partLocaleList = ["en-us", "fr-fr", "es", "de-at", "ja-jp", "zh-cn"]; - - dojo.forEach(partLocaleList, function(locale){ - dojo.requireLocalization("dojo.cldr", "gregorian", locale, "zh-cn,zh,en-ca,ko-kr,pt,pt-br,it-it,ROOT,en-gb,de,ja,en,en-au,fr,es,ko,zh-tw,it,es-es"); - }); - }, - runTest: function(t){ - }, - tearDown: function(){ - //Clean up bundles that should not exist if - //the test is re-run. - delete dojo.cldr.nls.gregorian; - } - }, - { - name: "isWeekend", - runTest: function(t){ - var thursday = new Date(2006, 8, 21); - var friday = new Date(2006, 8, 22); - var saturday = new Date(2006, 8, 23); - var sunday = new Date(2006, 8, 24); - var monday = new Date(2006, 8, 25); - t.f(dojo.date.locale.isWeekend(thursday, 'en-us')); - t.t(dojo.date.locale.isWeekend(saturday, 'en-us')); - t.t(dojo.date.locale.isWeekend(sunday, 'en-us')); - t.f(dojo.date.locale.isWeekend(monday, 'en-us')); -// t.f(dojo.date.locale.isWeekend(saturday, 'en-in')); -// t.t(dojo.date.locale.isWeekend(sunday, 'en-in')); -// t.f(dojo.date.locale.isWeekend(monday, 'en-in')); -// t.t(dojo.date.locale.isWeekend(friday, 'he-il')); -// t.f(dojo.date.locale.isWeekend(sunday, 'he-il')); - } - }, - { - name: "format", - runTest: function(t){ - - var date = new Date(2006, 7, 11, 0, 55, 12, 345); - - t.is("Friday, August 11, 2006", dojo.date.locale.format(date, {formatLength:'full',selector:'date', locale:'en-us'})); - t.is("vendredi 11 ao\xFBt 2006", dojo.date.locale.format(date, {formatLength:'full',selector:'date', locale:'fr-fr'})); - t.is("Freitag, 11. August 2006", dojo.date.locale.format(date, {formatLength:'full',selector:'date', locale:'de-at'})); - t.is("2006\u5E748\u670811\u65E5\u91D1\u66DC\u65E5", dojo.date.locale.format(date, {formatLength:'full',selector:'date', locale:'ja-jp'})); - - t.is("8/11/06", dojo.date.locale.format(date, {formatLength:'short',selector:'date', locale:'en-us'})); - t.is("11/08/06", dojo.date.locale.format(date, {formatLength:'short',selector:'date', locale:'fr-fr'})); - t.is("11.08.06", dojo.date.locale.format(date, {formatLength:'short',selector:'date', locale:'de-at'})); - t.is("06/08/11", dojo.date.locale.format(date, {formatLength:'short',selector:'date', locale:'ja-jp'})); - - t.is("12:55 AM", dojo.date.locale.format(date, {formatLength:'short',selector:'time', locale:'en-us'})); - t.is("12:55:12", dojo.date.locale.format(date, {timePattern:'h:m:s',selector:'time'})); - t.is("12:55:12.35", dojo.date.locale.format(date, {timePattern:'h:m:s.SS',selector:'time'})); - t.is("24:55:12.35", dojo.date.locale.format(date, {timePattern:'k:m:s.SS',selector:'time'})); - t.is("0:55:12.35", dojo.date.locale.format(date, {timePattern:'H:m:s.SS',selector:'time'})); - t.is("0:55:12.35", dojo.date.locale.format(date, {timePattern:'K:m:s.SS',selector:'time'})); - - t.is("11082006", dojo.date.locale.format(date, {datePattern:"ddMMyyyy", selector:"date"})); - - // compare without timezone - t.is("\u4e0a\u534812\u65f655\u520612\u79d2", dojo.date.locale.format(date, {formatLength:'full',selector:'time', locale:'zh-cn'}).split(' ')[0]); - } - }, - { - name: "parse_dates", - runTest: function(t){ - - var aug_11_2006 = new Date(2006, 7, 11, 0); - - //en: 'short' fmt: M/d/yy - // Tolerate either 8 or 08 for month part. - t.is( aug_11_2006, dojo.date.locale.parse("08/11/06", {formatLength:'short', selector:'date', locale:'en'})); - t.is( aug_11_2006, dojo.date.locale.parse("8/11/06", {formatLength:'short', selector:'date', locale:'en'})); - // Tolerate yyyy input in yy part... - t.is( aug_11_2006, dojo.date.locale.parse("8/11/2006", {formatLength:'short', selector:'date', locale:'en'})); - // ...but not in strict mode - t.f( Boolean(dojo.date.locale.parse("8/11/2006", {formatLength:'short', selector:'date', locale:'en', strict:true}))); - - //en: 'medium' fmt: MMM d, yyyy - // Tolerate either 8 or 08 for month part. - t.is( aug_11_2006, dojo.date.locale.parse("Aug 11, 2006", {formatLength:'medium', selector:'date', locale:'en'})); - t.is( aug_11_2006, dojo.date.locale.parse("Aug 11, 2006", {formatLength:'medium', selector:'date', locale:'en'})); - // Tolerate abbreviating period in month part... - t.is( aug_11_2006, dojo.date.locale.parse("Aug. 11, 2006", {formatLength:'medium', selector:'date', locale:'en'})); - // ...but not in strict mode - t.f( Boolean(dojo.date.locale.parse("Aug. 11, 2006", {formatLength:'medium', selector:'date', locale:'en', strict:true}))); - - // Note: 06 for year part will be translated literally as the year 6 C.E. - var aug_11_06CE = new Date(2006, 7, 11, 0); - aug_11_06CE.setFullYear(6); //literally the year 6 C.E. - t.is( aug_11_06CE, dojo.date.locale.parse("Aug 11, 06", {selector:'date', datePattern:'MMM dd, yyyy', strict:true})); - - //en: 'long' fmt: MMMM d, yyyy - t.is( aug_11_2006, dojo.date.locale.parse("August 11, 2006", {formatLength:'long', selector:'date', locale:'en'})); - - //en: 'full' fmt: EEEE, MMMM d, yyyy - t.is( aug_11_2006, dojo.date.locale.parse("Friday, August 11, 2006", {formatLength:'full', selector:'date', locale:'en'})); - //TODO: wrong day-of-week should fail - //t.f( Boolean(dojo.date.locale.parse("Thursday, August 11, 2006", {formatLength:'full', selector:'date', locale:'en'}))); - //TODO: Whitespace tolerance - // t.is( aug_11_2006, dojo.date.locale.parse(" August 11, 2006", {formatLength:'long', selector:'date', locale:'en'})); - // t.is( aug_11_2006, dojo.date.locale.parse("August 11, 2006", {formatLength:'long', selector:'date', locale:'en'})); - // t.is( aug_11_2006, dojo.date.locale.parse("August 11 , 2006", {formatLength:'long', selector:'date', locale:'en'})); - // t.is( aug_11_2006, dojo.date.locale.parse("August 11, 2006", {formatLength:'long', selector:'date', locale:'en'})); - // t.is( aug_11_2006, dojo.date.locale.parse("August 11, 2006 ", {formatLength:'long', selector:'date', locale:'en'})); - - //Simple Validation Tests - //catch "month" > 12 (note: month/day reversals are common when user expectation isn't met wrt european versus US formats) - t.f( Boolean(dojo.date.locale.parse("15/1/2005", {formatLength:'short', selector:'date', locale:'en'}))); - //day of month typo rolls over to the next month - t.f( Boolean(dojo.date.locale.parse("Aug 32, 2006", {formatLength:'medium', selector:'date', locale:'en'}))); - - //German (de) - t.is( aug_11_2006, dojo.date.locale.parse("11.08.06", {formatLength:'short', selector:'date', locale:'de'})); - t.f( Boolean(dojo.date.locale.parse("11.8/06", {formatLength:'short', selector:'date', locale:'de'}))); - t.f( Boolean(dojo.date.locale.parse("11.8x06", {formatLength:'short', selector:'date', locale:'de'}))); - t.f( Boolean(dojo.date.locale.parse("11.13.06", {formatLength:'short', selector:'date', locale:'de'}))); - t.f( Boolean(dojo.date.locale.parse("11.0.06", {formatLength:'short', selector:'date', locale:'de'}))); - t.f( Boolean(dojo.date.locale.parse("32.08.06", {formatLength:'short', selector:'date', locale:'de'}))); - - //Spanish (es) - //es: 'short' fmt: d/MM/yy - t.is( aug_11_2006, dojo.date.locale.parse("11/08/06", {formatLength:'short', selector:'date', locale:'es'})); - t.is( aug_11_2006, dojo.date.locale.parse("11/8/06", {formatLength:'short', selector:'date', locale:'es'})); - // Tolerate yyyy input in yy part... - t.is( aug_11_2006, dojo.date.locale.parse("11/8/2006", {formatLength:'short', selector:'date', locale:'es'})); - // ...but not in strict mode - t.f( Boolean(dojo.date.locale.parse("11/8/2006", {formatLength:'short', selector:'date', locale:'es', strict:true}))); - //es: 'medium' fmt: dd-MMM-yy (not anymore as of CLDR 1.5.1) -// t.is( aug_11_2006, dojo.date.locale.parse("11-ago-06", {formatLength:'medium', selector:'date', locale:'es'})); -// t.is( aug_11_2006, dojo.date.locale.parse("11-ago-2006", {formatLength:'medium', selector:'date', locale:'es'})); - // Tolerate abbreviating period in month part... -// t.is( aug_11_2006, dojo.date.locale.parse("11-ago.-2006", {formatLength:'medium', selector:'date', locale:'es'})); - // ...but not in strict mode -// t.f( Boolean(dojo.date.locale.parse("11-ago.-2006", {formatLength:'medium', selector:'date', locale:'es', strict:true}))); - //es: 'long' fmt: d' de 'MMMM' de 'yyyy - t.is( aug_11_2006, dojo.date.locale.parse("11 de agosto de 2006", {formatLength:'long', selector:'date', locale:'es'})); - //case-insensitive month... - t.is( aug_11_2006, dojo.date.locale.parse("11 de Agosto de 2006", {formatLength:'long', selector:'date', locale:'es'})); - //...but not in strict mode - t.f( Boolean(dojo.date.locale.parse("11 de Agosto de 2006", {formatLength:'long', selector:'date', locale:'es', strict:true}))); - //es 'full' fmt: EEEE d' de 'MMMM' de 'yyyy - t.is( aug_11_2006, dojo.date.locale.parse("viernes 11 de agosto de 2006", {formatLength:'full', selector:'date', locale:'es'})); - //case-insensitive day-of-week... - t.is( aug_11_2006, dojo.date.locale.parse("Viernes 11 de agosto de 2006", {formatLength:'full', selector:'date', locale:'es'})); - //...but not in strict mode - t.f( Boolean(dojo.date.locale.parse("Viernes 11 de agosto de 2006", {formatLength:'full', selector:'date', locale:'es', strict:true}))); - - //Japanese (ja) - //note: to avoid garbling from non-utf8-aware editors that may touch this file, using the \uNNNN format - //for expressing double-byte chars. - //toshi (year): \u5e74 - //getsu (month): \u6708 - //nichi (day): \u65e5 - //kinyoubi (Friday): \u91d1\u66dc\u65e5 - //zenkaku space: \u3000 - - //ja: 'short' fmt: yy/MM/dd (note: the "short" fmt isn't actually defined in the CLDR data...) - t.is( aug_11_2006, dojo.date.locale.parse("06/08/11", {formatLength:'short', selector:'date', locale:'ja'})); - t.is( aug_11_2006, dojo.date.locale.parse("06/8/11", {formatLength:'short', selector:'date', locale:'ja'})); - // Tolerate yyyy input in yy part... - t.is( aug_11_2006, dojo.date.locale.parse("2006/8/11", {formatLength:'short', selector:'date', locale:'ja'})); - // ...but not in strict mode - t.f( Boolean(dojo.date.locale.parse("2006/8/11", {formatLength:'short', selector:'date', locale:'ja', strict:true}))); - //ja: 'medium' fmt: yyyy/MM/dd - t.is( aug_11_2006, dojo.date.locale.parse("2006/08/11", {formatLength:'medium', selector:'date', locale:'ja'})); - t.is( aug_11_2006, dojo.date.locale.parse("2006/8/11", {formatLength:'medium', selector:'date', locale:'ja'})); - //ja: 'long' fmt: yyyy'\u5e74'\u6708'd'\u65e5' - t.is( aug_11_2006, dojo.date.locale.parse("2006\u5e748\u670811\u65e5", {formatLength:'long', selector:'date', locale:'ja'})); - //ja 'full' fmt: yyyy'\u5e74'M'\u6708'd'\u65e5'EEEE - t.is( aug_11_2006, dojo.date.locale.parse("2006\u5e748\u670811\u65e5\u91d1\u66dc\u65e5", {formatLength:'full', selector:'date', locale:'ja'})); - - //TODO: Whitespace tolerance - //tolerate ascii space - // t.is( aug_11_2006, dojo.date.locale.parse(" 2006\u5e748\u670811\u65e5\u91d1\u66dc\u65e5 ", {formatLength:'full', selector:'date', locale:'ja'})); - // t.is( aug_11_2006, dojo.date.locale.parse("2006\u5e74 8\u670811\u65e5 \u91d1\u66dc\u65e5", {formatLength:'full', selector:'date', locale:'ja'})); - //tolerate zenkaku space - // t.is( aug_11_2006, dojo.date.locale.parse("\u30002006\u5e748\u670811\u65e5\u91d1\u66dc\u65e5\u3000", {formatLength:'full', selector:'date', locale:'ja'})); - // t.is( aug_11_2006, dojo.date.locale.parse("2006\u5e74\u30008\u670811\u65e5\u3000\u91d1\u66dc\u65e5", {formatLength:'full', selector:'date', locale:'ja'})); - - var apr_11_2006 = new Date(2006, 3, 11, 0); - //Roundtrip - var options={formatLength:'medium',selector:'date', locale:'fr-fr'}; - t.is(0, dojo.date.compare(apr_11_2006, dojo.date.locale.parse(dojo.date.locale.format(apr_11_2006, options), options))); - - //Tolerance for abbreviations - t.is(0, dojo.date.compare(apr_11_2006, dojo.date.locale.parse("11 avr 06", options))); - } - }, - { - name: "parse_dates_neg", - runTest: function(t){ - t.f(Boolean(dojo.date.locale.parse("2/29/2007", {formatLength: 'short', selector: 'date', locale: 'en'}))); - t.f(Boolean(dojo.date.locale.parse("4/31/2007", {formatLength: 'short', selector: 'date', locale: 'en'}))); - t.f(Boolean(dojo.date.locale.parse("Decemb 30, 2007", {formatLength: 'long', selector: 'date', locale: 'en'}))); - } - }, - { - name: "parse_datetimes", - runTest: function(t){ - - var aug_11_2006_12_30_am = new Date(2006, 7, 11, 0, 30); - var aug_11_2006_12_30_pm = new Date(2006, 7, 11, 12, 30); - - //en: 'short' datetime fmt: M/d/yy h:mm a - //note: this is concatenation of dateFormat-short and timeFormat-short, - //cldr provisionally defines datetime fmts as well, but we're not using them at the moment - t.is( aug_11_2006_12_30_pm, dojo.date.locale.parse("08/11/06 12:30 PM", {formatLength:'short', locale:'en'})); - //case-insensitive - t.is( aug_11_2006_12_30_pm, dojo.date.locale.parse("08/11/06 12:30 pm", {formatLength:'short', locale:'en'})); - //...but not in strict mode - t.f( Boolean(dojo.date.locale.parse("08/11/06 12:30 pm", {formatLength:'short', locale:'en', strict:true}))); - - t.is( aug_11_2006_12_30_am, dojo.date.locale.parse("08/11/06 12:30 AM", {formatLength:'short', locale:'en'})); - - t.is( new Date(2006, 7, 11), dojo.date.locale.parse("11082006", {datePattern:"ddMMyyyy", selector:"date"})); - - } - }, - { - name: "parse_times", - runTest: function(t){ - - var time = new Date(2006, 7, 11, 12, 30); - var tformat = {selector:'time', strict:true, timePattern:"h:mm a", locale:'en'}; - - t.is(time.getHours(), dojo.date.locale.parse("12:30 PM", tformat).getHours()); - t.is(time.getMinutes(), dojo.date.locale.parse("12:30 PM", tformat).getMinutes()); - } - }, - { - name: "day_of_year", - runTest: function(t){ - -// t.is(23, dojo.date.setDayOfYear(new Date(2006,0,1), 23).getDate()); - t.is(1, dojo.date.locale._getDayOfYear(new Date(2006,0,1))); - t.is(32, dojo.date.locale._getDayOfYear(new Date(2006,1,1))); - t.is(72, dojo.date.locale._getDayOfYear(new Date(2007,2,13,0,13))); - t.is(72, dojo.date.locale._getDayOfYear(new Date(2007,2,13,1,13))); - } - }, - { - name: "week_of_year", - runTest: function(t){ - t.is(0, dojo.date.locale._getWeekOfYear(new Date(2000,0,1))); - t.is(1, dojo.date.locale._getWeekOfYear(new Date(2000,0,2))); - t.is(0, dojo.date.locale._getWeekOfYear(new Date(2000,0,2), 1)); - t.is(0, dojo.date.locale._getWeekOfYear(new Date(2007,0,1))); - t.is(1, dojo.date.locale._getWeekOfYear(new Date(2007,0,1), 1)); - t.is(27, dojo.date.locale._getWeekOfYear(new Date(2007,6,14))); - t.is(28, dojo.date.locale._getWeekOfYear(new Date(2007,6,14), 1)); - } - } - ] -); - -/* -// workaround deprecated methods. Should decide whether we should convert the tests or add a helper method (in dojo.date?) to do this. - -dojo_validate_isValidTime = function(str, props){ - props = props || {}; - if(!props.format){props.format="h:mm:ss";} - if(!props.am){props.am="a.m.";} - if(!props.pm){props.pm="p.m.";} - var result = false; - if(/[hk]/.test(props.format) && props.format.indexOf('a') == -1){ - result = dojo.date.locale.parse(str, {selector: 'time', timePattern: props.format + " a"}); - } - return Boolean(result || dojo.date.locale.parse(str, {selector: 'time', timePattern: props.format})); -} - -dojo_validate_is12HourTime = function(str){ - return dojo_validate_isValidTime(str, {format: 'h:mm:ss'}) || dojo_validate_isValidTime(str, {format: 'h:mm'}); -} - -dojo_validate_is24HourTime = function(str){ - return dojo_validate_isValidTime(str, {format: 'H:mm:ss'}) || dojo_validate_isValidTime(str, {format: 'H:mm'}); -} - -dojo_validate_isValidDate = function(str, fmt){ - return Boolean(dojo.date.locale.parse(str, {selector: 'date', datePattern: fmt})); -} - -function test_validate_datetime_isValidTime(){ - jum.assertTrue("test1", dojo_validate_isValidTime('5:15:05 pm')); -// FAILURE jum.assertTrue("test2", dojo_validate_isValidTime('5:15:05 p.m.', {pm: "P.M."} )); - jum.assertFalse("test3", dojo_validate_isValidTime('5:15:05 f.m.')); - jum.assertTrue("test4", dojo_validate_isValidTime('5:15 pm', {format: "h:mm a"} ) ); - jum.assertFalse("test5", dojo_validate_isValidTime('5:15 fm', {}) ); - jum.assertTrue("test6", dojo_validate_isValidTime('15:15:00', {format: "H:mm:ss"} ) ); -// FAILURE jum.assertFalse("test7", dojo_validate_isValidTime('15:15:00', {}) ); - jum.assertTrue("test8", dojo_validate_isValidTime('17:01:30', {format: "H:mm:ss"} ) ); - jum.assertFalse("test9", dojo_validate_isValidTime('17:1:30', {format: "H:mm:ss"} ) ); -// FAILURE jum.assertFalse("test10", dojo_validate_isValidTime('17:01:30', {format: "H:m:ss"} ) ); - // Greek -// FAILURE jum.assertTrue("test11", dojo_validate_isValidTime('5:01:30 \u0924\u0924', {am: "\u0928\u0924", pm: "\u0924\u0924"} ) ); - // Italian - jum.assertTrue("test12", dojo_validate_isValidTime('17.01.30', {format: "H.mm.ss"} ) ); - // Mexico -// FAILURE jum.assertTrue("test13", dojo_validate_isValidTime('05:01:30 p.m.', {format: "hh:mm:ss a", am: "a.m.", pm: "p.m."} ) ); -} - - -function test_validate_datetime_is12HourTime(){ - jum.assertTrue("test1", dojo_validate_is12HourTime('5:15:05 pm')); -// FAILURE jum.assertFalse("test2", dojo_validate_is12HourTime('05:15:05 pm')); - jum.assertFalse("test3", dojo_validate_is12HourTime('5:5:05 pm')); - jum.assertFalse("test4", dojo_validate_is12HourTime('5:15:5 pm')); -// FAILURE jum.assertFalse("test5", dojo_validate_is12HourTime('13:15:05 pm')); - jum.assertFalse("test6", dojo_validate_is12HourTime('5:60:05 pm')); - jum.assertFalse("test7", dojo_validate_is12HourTime('5:15:60 pm')); - jum.assertTrue("test8", dojo_validate_is12HourTime('5:59:05 pm')); - jum.assertTrue("test9", dojo_validate_is12HourTime('5:15:59 pm')); -// FAILURE jum.assertFalse("test10", dojo_validate_is12HourTime('5:15:05')); - - // optional seconds - jum.assertTrue("test11", dojo_validate_is12HourTime('5:15 pm')); - jum.assertFalse("test12", dojo_validate_is12HourTime('5:15: pm')); -} - -function test_validate_datetime_is24HourTime(){ - jum.assertTrue("test1", dojo_validate_is24HourTime('00:03:59')); - jum.assertTrue("test2", dojo_validate_is24HourTime('22:03:59')); -//FIXME: fix tests or code? -// jum.assertFalse("test3", dojo_validate_is24HourTime('22:03:59 pm')); -// jum.assertFalse("test4", dojo_validate_is24HourTime('2:03:59')); - jum.assertFalse("test5", dojo_validate_is24HourTime('0:3:59')); - jum.assertFalse("test6", dojo_validate_is24HourTime('00:03:5')); - jum.assertFalse("test7", dojo_validate_isValidTime('24:03:59', {format: 'kk:mm:ss'})); - jum.assertFalse("test8", dojo_validate_is24HourTime('02:60:59')); - jum.assertFalse("test9", dojo_validate_is24HourTime('02:03:60')); - - // optional seconds - jum.assertTrue("test10", dojo_validate_is24HourTime('22:53')); - jum.assertFalse("test11", dojo_validate_is24HourTime('22:53:')); -} - -function test_validate_datetime_isValidDate(){ - - // Month date year - jum.assertTrue("test1", dojo_validate_isValidDate("08/06/2005", "MM/dd/yyyy")); - jum.assertTrue("test2", dojo_validate_isValidDate("08.06.2005", "MM.dd.yyyy")); - jum.assertTrue("test3", dojo_validate_isValidDate("08-06-2005", "MM-dd-yyyy")); - jum.assertTrue("test4", dojo_validate_isValidDate("8/6/2005", "M/d/yyyy")); - jum.assertTrue("test5", dojo_validate_isValidDate("8/6", "M/d")); - jum.assertFalse("test6", dojo_validate_isValidDate("09/31/2005", "MM/dd/yyyy")); - jum.assertFalse("test7", dojo_validate_isValidDate("02/29/2005", "MM/dd/yyyy")); - jum.assertTrue("test8", dojo_validate_isValidDate("02/29/2004", "MM/dd/yyyy")); - - // year month date - jum.assertTrue("test9", dojo_validate_isValidDate("2005-08-06", "yyyy-MM-dd")); - jum.assertTrue("test10", dojo_validate_isValidDate("20050806", "yyyyMMdd")); - - // year month - jum.assertTrue("test11", dojo_validate_isValidDate("2005-08", "yyyy-MM")); - jum.assertTrue("test12", dojo_validate_isValidDate("200508", "yyyyMM")); - - // year - jum.assertTrue("test13", dojo_validate_isValidDate("2005", "yyyy")); - - // year week day -//TODO: need to support 'w'? -// jum.assertTrue("test14", dojo_validate_isValidDate("2005-W42-3", "yyyy-'W'ww-d")); -// jum.assertTrue("test15", dojo_validate_isValidDate("2005W423", "yyyy'W'wwd")); -// jum.assertFalse("test16", dojo_validate_isValidDate("2005-W42-8", "yyyy-'W'ww-d")); -// jum.assertFalse("test17", dojo_validate_isValidDate("2005-W54-3", "yyyy-'W'ww-d")); - - // year week -// jum.assertTrue("test18", dojo_validate_isValidDate("2005-W42", "yyyy-'W'ww")); -// jum.assertTrue("test19", dojo_validate_isValidDate("2005W42", "yyyy'W'ww")); - - // year ordinal-day - jum.assertTrue("test20", dojo_validate_isValidDate("2005-292", "yyyy-DDD")); - jum.assertTrue("test21", dojo_validate_isValidDate("2005292", "yyyyDDD")); - jum.assertFalse("test22", dojo_validate_isValidDate("2005-366", "yyyy-DDD")); - jum.assertTrue("test23", dojo_validate_isValidDate("2004-366", "yyyy-DDD")); - - // date month year - jum.assertTrue("test24", dojo_validate_isValidDate("19.10.2005", "dd.MM.yyyy")); - jum.assertTrue("test25", dojo_validate_isValidDate("19-10-2005", "d-M-yyyy")); -} -*/ - -} diff --git a/includes/js/dojo/tests/date/stamp.js b/includes/js/dojo/tests/date/stamp.js deleted file mode 100644 index 88cf677..0000000 --- a/includes/js/dojo/tests/date/stamp.js +++ /dev/null @@ -1,94 +0,0 @@ -if(!dojo._hasResource["tests.date.stamp"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests.date.stamp"] = true; -dojo.provide("tests.date.stamp"); - -dojo.require("dojo.date.stamp"); - -tests.register("tests.date.stamp", - [ -function test_date_iso(t){ - var rfc = "2005-06-29T08:05:00-07:00"; - var date = dojo.date.stamp.fromISOString(rfc); - t.is(2005,date.getFullYear()); - t.is(5,date.getMonth()); - t.is(29,date.getUTCDate()); - t.is(15,date.getUTCHours()); - t.is(5,date.getMinutes()); - t.is(0,date.getSeconds()); - - rfc = "2004-02-29"; - date = dojo.date.stamp.fromISOString(rfc); - t.is(2004,date.getFullYear()); - t.is(1,date.getMonth()); - t.is(29,date.getDate()); - - rfc = "2004-01"; - date = dojo.date.stamp.fromISOString(rfc); - t.is(2004,date.getFullYear()); - t.is(0,date.getMonth()); - t.is(1,date.getDate()); - - // No TZ info means local time - rfc = "2004-02-29T01:23:45"; - date = dojo.date.stamp.fromISOString(rfc); - t.is(2004,date.getFullYear()); - t.is(1,date.getMonth()); - t.is(29,date.getDate()); - t.is(1,date.getHours()); - - date = new Date(2005,5,29,8,5,0); - rfc = dojo.date.stamp.toISOString(date); - //truncate for comparison - t.is("2005-06",rfc.substring(0,7)); - - date = new Date(101,0,2); - date.setFullYear(101); - rfc = dojo.date.stamp.toISOString(date); - //truncate for comparison - t.is("0101-01",rfc.substring(0,7)); - - rfc = "0101-01-01"; - date = dojo.date.stamp.fromISOString(rfc); - t.is(101,date.getFullYear()); - t.is(0,date.getMonth()); - t.is(1,date.getDate()); - - date = dojo.date.stamp.fromISOString("T18:46:39"); - t.is(18, date.getHours()); - t.is(46, date.getMinutes()); - t.is(39, date.getSeconds()); -}, - -function test_date_iso_tz(t){ - - //23:59:59.9942 or 235959.9942 -// var date = dojo.date.stamp.fromISOString("T18:46:39.9942"); -// t.is(18, date.getHours()); -// t.is(46, date.getMinutes()); -// t.is(39, date.getSeconds()); -// t.is(994, date.getMilliseconds()); - - //1995-02-04 24:00 = 1995-02-05 00:00 - - //timezone tests - var offset = new Date().getTimezoneOffset()/60; - date = dojo.date.stamp.fromISOString("T18:46:39+07:00"); - t.is(11, date.getUTCHours()); - - date = dojo.date.stamp.fromISOString("T18:46:39+00:00"); - t.is(18, date.getUTCHours()); - - date = dojo.date.stamp.fromISOString("T18:46:39Z"); - t.is(18, date.getUTCHours()); - - date = dojo.date.stamp.fromISOString("T16:46:39-07:00"); - t.is(23, date.getUTCHours()); - - //+hh:mm, +hhmm, or +hh - - //-hh:mm, -hhmm, or -hh - } - ] -); - -} diff --git a/includes/js/dojo/tests/dnd/dndDefault.css b/includes/js/dojo/tests/dnd/dndDefault.css deleted file mode 100644 index eca2ef5..0000000 --- a/includes/js/dojo/tests/dnd/dndDefault.css +++ /dev/null @@ -1,52 +0,0 @@ - -.container { - border:3px solid #ccc; - padding: 1em 3em; - cursor: default; - radius:8pt; - background:#fff; - -moz-border-radius:8pt 8pt; -} -.dojoDndContainerOver { - - border:3px solid #aaa; -} -.dojoDndItem { - padding:3px; -} -.dojoDndItemOver { - background: #ededed; - cursor:pointer; -} -.dojoDndItemSelected { - background: #ccf; color: #444; -} -.dojoDndItemAnchor { - background: #ccf; color: black; -} -.dojoDndItemOver .dojoDndItemSelected { - background: #ededed; -} -.dojoDndItemOver .dojoDndItemAnchor { - background: #ededed; -} -.dojoDndItemBefore { - border-top: 2px solid #369; -} -.dojoDndItemAfter { - border-bottom: 2px solid #369; -} -.dojoDndAvatar { - border:2px solid #ccc; - font-size: 75%; - -moz-border-radius:8pt 8pt; - radius:8pt; -} - -.dojoDndAvatarHeader { - background: #aaa; -} -.dojoDndAvatarItem { - background: #fff; - border-bottom:1px solid #666; -} diff --git a/includes/js/dojo/tests/dnd/dndDefault.css.commented.css b/includes/js/dojo/tests/dnd/dndDefault.css.commented.css deleted file mode 100644 index cad410c..0000000 --- a/includes/js/dojo/tests/dnd/dndDefault.css.commented.css +++ /dev/null @@ -1,69 +0,0 @@ -/* - - there are basically all the classes you can set - for the various dojo.dnd states and elements in - their simplest form. hacking welcome. - -*/ -.container { - border:3px solid #ccc; - padding: 1em 3em; - cursor: default; - radius:8pt; - background:#fff; - -moz-border-radius:8pt 8pt; -} - -.dojoDndContainerOver { - /* cursor:pointer; */ - border:3px solid #aaa; -} - -.dojoDndItem { - padding:3px; -} - -.dojoDndItemOver { - background: #ededed; - cursor:pointer; -} - -.dojoDndItemSelected { - background: #ccf; color: #444; -} - -.dojoDndItemAnchor { - background: #ccf; color: black; -} - -.dojoDndItemOver .dojoDndItemSelected { - background: #ededed; -} - -.dojoDndItemOver .dojoDndItemAnchor { - background: #ededed; -} - -.dojoDndItemBefore { - border-top: 2px solid #369; -} - -.dojoDndItemAfter { - border-bottom: 2px solid #369; -} - -.dojoDndAvatar { - border:2px solid #ccc; - font-size: 75%; - -moz-border-radius:8pt 8pt; - radius:8pt; -} - -.dojoDndAvatarHeader { - background: #aaa; -} - -.dojoDndAvatarItem { - background: #fff; - border-bottom:1px solid #666; -} diff --git a/includes/js/dojo/tests/dnd/flickr_viewer.html b/includes/js/dojo/tests/dnd/flickr_viewer.html deleted file mode 100644 index 4ede297..0000000 --- a/includes/js/dojo/tests/dnd/flickr_viewer.html +++ /dev/null @@ -1,168 +0,0 @@ - - - - Sort Flickr images by tags - - - - - - - - - - - - -

Sort Flickr images by tags

-

This simple web application retrieves public images from Flickr that were tagged either as "cat", "dog", or "cow". - You can copy/move images in different containers according to their tags.

-

Following selection modes are supported by default:

-
    -
  • Simple click — selects a single element, all other elements will be unselected.
  • -
  • Ctrl+click — toggles a selection state of an element (use Meta key on Mac).
  • -
  • Shift+click — selects a range of element from the previous anchor to the current element.
  • -
  • Ctrl+Shift+click — adds a range of element from the previous anchor to the current element (use Meta key on Mac).
  • -
-

Following drop modes are supported by default:

-
    -
  • Simple drop — moves elements to the valid target removing them from the source. It can be used to reorganize elements within a single source/target.
  • -
  • Ctrl+drop — copies elements to the valid target (use Meta key on Mac).
  • -
-

Now scroll down and start dragging and dropping, rearrange images using DnD, copy and move them back!

-

Status: retrieving a list of Flickr images...

-
-
- -
-
-

Tag: cat

-
-
- -
-
-

Tag: dog

-
-
- -
-
- - diff --git a/includes/js/dojo/tests/dnd/test_box_constraints.html b/includes/js/dojo/tests/dnd/test_box_constraints.html deleted file mode 100644 index 85a5033..0000000 --- a/includes/js/dojo/tests/dnd/test_box_constraints.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - Dojo box constraint test - - - - - - -

Dojo box constraint test

-

Paragraph restricted to (100,100:500,500) box: Donec ac odio sed pede aliquet auctor. Donec et lectus. Praesent feugiat ultrices enim. Morbi lectus. Donec vestibulum posuere libero. Donec quam enim, nonummy a, auctor vitae, placerat id, massa. Vivamus vulputate luctus nibh. Donec dolor orci, sagittis ac, pretium sed, ornare sit amet, pede. Vestibulum leo justo, pellentesque sit amet, tristique sed, tempor eu, felis. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam scelerisque velit vel sem. Curabitur vulputate. Morbi pretium porta dui.

-

Paragraph restricted to (100,100:500,500) box, it cannot go outside of this box: In hac habitasse platea dictumst. Etiam rhoncus, leo quis hendrerit vestibulum, ipsum felis porta massa, vitae posuere nunc lorem ac enim. Nam neque turpis, aliquet quis, sollicitudin sit amet, dapibus sed, eros. Duis volutpat porttitor velit. Vivamus nibh metus, iaculis eget, malesuada eget, facilisis id, lorem. Sed turpis. Vestibulum aliquam mauris. Integer malesuada tellus vel neque. In hac habitasse platea dictumst. Aliquam at lectus. Maecenas nonummy cursus nisl. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Morbi imperdiet purus eu ipsum. Curabitur sapien felis, euismod eu, dapibus vel, tempor vitae, pede. Suspendisse blandit. Nulla imperdiet. Duis placerat nulla ultricies sem. In in mi nec ipsum molestie tempor. Sed scelerisque.

-

Marked up paragraph restricted to (100,100:500,500) box: Donec ac odio sed pede aliquet auctor. Donec et lectus. Praesent feugiat ultrices enim. Morbi lectus. Donec vestibulum posuere libero. Donec quam enim, nonummy a, auctor vitae, placerat id, massa. Vivamus vulputate luctus nibh. Donec dolor orci, sagittis ac, pretium sed, ornare sit amet, pede. Vestibulum leo justo, pellentesque sit amet, tristique sed, tempor eu, felis. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam scelerisque velit vel sem. Curabitur vulputate. Morbi pretium porta dui. -

-

Marked up paragraph restricted to (100,100:500,500) box, it cannot go outside of this box: In hac habitasse platea dictumst. Etiam rhoncus, leo quis hendrerit vestibulum, ipsum felis porta massa, vitae posuere nunc lorem ac enim. Nam neque turpis, aliquet quis, sollicitudin sit amet, dapibus sed, eros. Duis volutpat porttitor velit. Vivamus nibh metus, iaculis eget, malesuada eget, facilisis id, lorem. Sed turpis. Vestibulum aliquam mauris. Integer malesuada tellus vel neque. In hac habitasse platea dictumst. Aliquam at lectus. Maecenas nonummy cursus nisl. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Morbi imperdiet purus eu ipsum. Curabitur sapien felis, euismod eu, dapibus vel, tempor vitae, pede. Suspendisse blandit. Nulla imperdiet. Duis placerat nulla ultricies sem. In in mi nec ipsum molestie tempor. Sed scelerisque. - - -

- - diff --git a/includes/js/dojo/tests/dnd/test_container.html b/includes/js/dojo/tests/dnd/test_container.html deleted file mode 100644 index 352aa7a..0000000 --- a/includes/js/dojo/tests/dnd/test_container.html +++ /dev/null @@ -1,74 +0,0 @@ - - - - Dojo DnD container test - - - - - - -

Dojo DnD container test

-

Containers have a notion of a "current container", and one element can be "current".

-

see dndDefault.css for example styling

-

DIV container

-
-
Item 1
-
Item 2
-
Item 3
-
-

UL container

-
    -
  • Item 1
  • -
  • Item 2
  • -
  • Item 3
  • -
-

OL container

-
    -
  1. Item 1
  2. -
  3. Item 2
  4. -
  5. Item 3
  6. -
-

TABLE container

- - - - - - - - - - - - - -
Arow 1
Brow 2
Crow 3
-

P container with SPAN elements

-

Elements of this container are layed out horizontally.

-

-  Item 1  -  Item 2  -  Item 3  -

- - diff --git a/includes/js/dojo/tests/dnd/test_container_markup.html b/includes/js/dojo/tests/dnd/test_container_markup.html deleted file mode 100644 index 4bde544..0000000 --- a/includes/js/dojo/tests/dnd/test_container_markup.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - Dojo DnD markup container test - - - - - - -

Dojo DnD markup container test

-

This example is functionally equivalent to test_container.html example but is done using the Dojo markup.

-

Containers have a notion of a "current container", and one element can be "current".

-

See dndDefault.css for example styling

-

DIV container

-
-
Item 1
-
Item 2
-
Item 3
-
-

UL container

-
    -
  • Item 1
  • -
  • Item 2
  • -
  • Item 3
  • -
-

OL container

-
    -
  1. Item 1
  2. -
  3. Item 2
  4. -
  5. Item 3
  6. -
-

TABLE container

- - - - - - - - - - - - - -
Arow 1
Brow 2
Crow 3
-

P container with SPAN elements

-

Elements of this container are layed out horizontally.

-

-  Item 1  -  Item 2  -  Item 3  -

- - diff --git a/includes/js/dojo/tests/dnd/test_custom_constraints.html b/includes/js/dojo/tests/dnd/test_custom_constraints.html deleted file mode 100644 index 9140914..0000000 --- a/includes/js/dojo/tests/dnd/test_custom_constraints.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - Dojo custom constraint test - - - - - - -

Dojo custom constraint test

-

This paragraph stops at 50x50 grid knots: Donec ac odio sed pede aliquet auctor. Donec et lectus. Praesent feugiat ultrices enim. Morbi lectus. Donec vestibulum posuere libero. Donec quam enim, nonummy a, auctor vitae, placerat id, massa. Vivamus vulputate luctus nibh. Donec dolor orci, sagittis ac, pretium sed, ornare sit amet, pede. Vestibulum leo justo, pellentesque sit amet, tristique sed, tempor eu, felis. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam scelerisque velit vel sem. Curabitur vulputate. Morbi pretium porta dui.

-

This paragraph stops at 50x50 grid knots: Donec ac odio sed pede aliquet auctor. Donec et lectus. Praesent feugiat ultrices enim. Morbi lectus. Donec vestibulum posuere libero. Donec quam enim, nonummy a, auctor vitae, placerat id, massa. Vivamus vulputate luctus nibh. Donec dolor orci, sagittis ac, pretium sed, ornare sit amet, pede. Vestibulum leo justo, pellentesque sit amet, tristique sed, tempor eu, felis. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam scelerisque velit vel sem. Curabitur vulputate. Morbi pretium porta dui.

- - diff --git a/includes/js/dojo/tests/dnd/test_dnd.html b/includes/js/dojo/tests/dnd/test_dnd.html deleted file mode 100644 index 7e2a56a..0000000 --- a/includes/js/dojo/tests/dnd/test_dnd.html +++ /dev/null @@ -1,130 +0,0 @@ - - - - Dojo DnD test - - - - - - - - - - - - - -

Dojo DnD test

- -

Elements of both sources/targets were created dynamically.

-

Following selection modes are supported by default:

-
    -
  • Simple click — selects a single element, all other elements will be unselected.
  • -
  • Ctrl+click — toggles a selection state of an element (use Meta key on Mac).
  • -
  • Shift+click — selects a range of element from the previous anchor to the current element.
  • -
  • Ctrl+Shift+click — adds a range of element from the previous anchor to the current element (use Meta key on Mac).
  • -
-

Following drop modes are supported by default:

-
    -
  • Simple drop — moves elements to the valid target removing them from the source. It can be used to reorganize elements within a single source/target.
  • -
  • Ctrl+drop — copies elements to the valid target (use Meta key on Mac).
  • -
- -
-
-

Source 1

-
-
-
-

Source 2

-
-
Item X
-
Item Y
-
Item Z
-
-
-
-

Source 3

-
- -
Item Alpha
-
Item Beta
-
Item Gamma
-
Item Delta
-
-
-
-

Pure Target 4

-
-
One item
-
-
-
-
- -

HTML after

- - - diff --git a/includes/js/dojo/tests/dnd/test_dnd_handles.html b/includes/js/dojo/tests/dnd/test_dnd_handles.html deleted file mode 100644 index bcc58dc..0000000 --- a/includes/js/dojo/tests/dnd/test_dnd_handles.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - Dojo DnD with handles test - - - - - - - - - - - - - -

Dojo DnD with handles test

- -

Following selection modes are supported by default:

-
    -
  • Simple click — selects a single element, all other elements will be unselected.
  • -
  • Ctrl+click — toggles a selection state of an element (use Meta key on Mac).
  • -
  • Shift+click — selects a range of element from the previous anchor to the current element.
  • -
  • Ctrl+Shift+click — adds a range of element from the previous anchor to the current element (use Meta key on Mac).
  • -
-

Following drop modes are supported by default:

-
    -
  • Simple drop — moves elements to the valid target removing them from the source. It can be used to reorganize elements within a single source/target.
  • -
  • Ctrl+drop — copies elements to the valid target (use Meta key on Mac).
  • -
- -

Source with handles. Items should be draggable by "Item".

-
-
Item Alpha
-
Item Beta
-
Item Gamma
-
Item Delta
-
- -

Source without handles.

-
-
Item Epsilon
-
Item Zeta
-
Item Eta
-
Item Theta
-
- -

HTML after

- - - diff --git a/includes/js/dojo/tests/dnd/test_form.html b/includes/js/dojo/tests/dnd/test_form.html deleted file mode 100644 index cac46c0..0000000 --- a/includes/js/dojo/tests/dnd/test_form.html +++ /dev/null @@ -1,103 +0,0 @@ - - - - Dojo DnD form test - - - - - - - - - - - - - -

Dojo DnD form test

- -

This is a test to confirm that the DnD container does not interfere with form elements.

- -
- -
-

Target 1

-

-
- -
-

Target 2: form controls galore

-
- Input text:
- Input checkbox:
- Input radio:
- Input password:
- Input file:
- Input button:
- Input reset:
- Input submit:
- Input image:
- Button:
- Select:
- Textarea: -
-
-
-
- -

 

- -
-
Source with skipForm = false (by default)
-
Item X:
-
Item Y:
-
Item Z:
-
- -

 

- -
-
Source with skipForm = true
-
Item A:
-
Item B:
-
Item C:
-
- -

HTML after

- - - diff --git a/includes/js/dojo/tests/dnd/test_moveable.html b/includes/js/dojo/tests/dnd/test_moveable.html deleted file mode 100644 index 3f7e2e7..0000000 --- a/includes/js/dojo/tests/dnd/test_moveable.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - Dojo Moveable test - - - - - - - - -

Dojo Moveable test

-

1st run

-

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent erat. In malesuada ultricies velit. Vestibulum tempor odio vitae diam. Morbi arcu lectus, laoreet eget, nonummy at, elementum a, quam. Pellentesque ac lacus. Cras quis est. Etiam suscipit, quam at eleifend nonummy, elit nunc sollicitudin tellus, at mattis est ligula interdum urna. Vivamus id augue sed mi consectetuer dictum. Suspendisse dapibus elit non urna. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam gravida dapibus ante. Nam viverra ligula in neque. Nullam at metus. Aenean ipsum.

-

Mauris vulputate elit a risus. Praesent pellentesque velit ac neque. Fusce ultrices augue vitae orci. Proin a ante. Nulla consectetuer arcu quis est. Suspendisse potenti. Aliquam erat volutpat. Morbi purus augue, eleifend eu, consectetuer sed, tristique ut, wisi. Cras ac tellus. Phasellus adipiscing, libero ac consequat volutpat, ligula purus mollis lectus, ac porttitor ipsum diam non urna. Donec lorem. Pellentesque diam tortor, posuere et, placerat vitae, iaculis et, sapien. Proin sodales vehicula purus. Quisque bibendum mi ac mauris. Quisque tellus. Morbi sagittis. Integer euismod rhoncus augue. Ut accumsan. Curabitur quis tellus sit amet odio ultricies tristique. Etiam malesuada.

-

Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec est. Cras semper nunc ut metus. Pellentesque blandit pede at erat. Quisque nonummy leo id metus. Donec mi mi, viverra id, adipiscing vitae, consectetuer ut, elit. In lectus augue, porttitor quis, viverra id, dignissim id, leo. Maecenas sapien. Nam adipiscing sem. Aenean ligula. Etiam vel velit. In mollis cursus dolor. Suspendisse ac nibh id leo tempor posuere. Aliquam sapien tellus, elementum non, aliquam sed, luctus eu, augue. Aliquam elementum leo nec enim. Donec ornare sagittis magna. Mauris ac tellus.

-

Duis ac augue rhoncus neque adipiscing feugiat. Donec pulvinar sem vitae neque. Donec commodo metus at ipsum. Cras vel magna vehicula lorem varius consequat. Morbi at enim vitae lectus mollis sodales. Sed tincidunt quam ut mi varius hendrerit. Sed porta arcu non libero. Quisque et wisi. Pellentesque lobortis. Ut enim felis, varius vitae, ornare quis, auctor ut, risus. Ut porta lorem vel quam. Etiam nunc purus, consectetuer non, lobortis eu, fermentum eu, magna. Aenean ultrices ante. Aliquam erat volutpat. Morbi quis velit eu mi sollicitudin lacinia. Suspendisse potenti. Donec lectus.

-

Quisque egestas turpis. Sed id ipsum id libero euismod nonummy. Nam sed dolor. Mauris in turpis. Duis nec wisi eget ante ultrices varius. Ut eget neque. Suspendisse sagittis iaculis tellus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Phasellus at justo. Donec imperdiet, elit et commodo bibendum, leo augue pellentesque arcu, ac dapibus lorem nulla eget erat. In viverra, tellus eu luctus eleifend, urna nibh lobortis sapien, ac pulvinar massa enim vel turpis. Sed orci neque, sagittis eu, mattis vitae, rutrum condimentum, leo. Fusce wisi odio, convallis at, condimentum vel, imperdiet id, mi. Mauris semper, magna pretium consectetuer sollicitudin, eros enim vehicula risus, eu ultrices turpis quam at wisi. Nam mollis.

- - - - - - - -
You can drag the table using this handle.
1Lorem ipsum dolor sit amet...
2Mauris vulputate elit a risus...
3Pellentesque habitant morbi tristique senectus...
4Duis ac augue rhoncus neque...
5Quisque egestas turpis. Sed id...
-

2nd run

-

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent erat. In malesuada ultricies velit. Vestibulum tempor odio vitae diam. Morbi arcu lectus, laoreet eget, nonummy at, elementum a, quam. Pellentesque ac lacus. Cras quis est. Etiam suscipit, quam at eleifend nonummy, elit nunc sollicitudin tellus, at mattis est ligula interdum urna. Vivamus id augue sed mi consectetuer dictum. Suspendisse dapibus elit non urna. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam gravida dapibus ante. Nam viverra ligula in neque. Nullam at metus. Aenean ipsum.

-

Mauris vulputate elit a risus. Praesent pellentesque velit ac neque. Fusce ultrices augue vitae orci. Proin a ante. Nulla consectetuer arcu quis est. Suspendisse potenti. Aliquam erat volutpat. Morbi purus augue, eleifend eu, consectetuer sed, tristique ut, wisi. Cras ac tellus. Phasellus adipiscing, libero ac consequat volutpat, ligula purus mollis lectus, ac porttitor ipsum diam non urna. Donec lorem. Pellentesque diam tortor, posuere et, placerat vitae, iaculis et, sapien. Proin sodales vehicula purus. Quisque bibendum mi ac mauris. Quisque tellus. Morbi sagittis. Integer euismod rhoncus augue. Ut accumsan. Curabitur quis tellus sit amet odio ultricies tristique. Etiam malesuada.

-

Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec est. Cras semper nunc ut metus. Pellentesque blandit pede at erat. Quisque nonummy leo id metus. Donec mi mi, viverra id, adipiscing vitae, consectetuer ut, elit. In lectus augue, porttitor quis, viverra id, dignissim id, leo. Maecenas sapien. Nam adipiscing sem. Aenean ligula. Etiam vel velit. In mollis cursus dolor. Suspendisse ac nibh id leo tempor posuere. Aliquam sapien tellus, elementum non, aliquam sed, luctus eu, augue. Aliquam elementum leo nec enim. Donec ornare sagittis magna. Mauris ac tellus.

-

Duis ac augue rhoncus neque adipiscing feugiat. Donec pulvinar sem vitae neque. Donec commodo metus at ipsum. Cras vel magna vehicula lorem varius consequat. Morbi at enim vitae lectus mollis sodales. Sed tincidunt quam ut mi varius hendrerit. Sed porta arcu non libero. Quisque et wisi. Pellentesque lobortis. Ut enim felis, varius vitae, ornare quis, auctor ut, risus. Ut porta lorem vel quam. Etiam nunc purus, consectetuer non, lobortis eu, fermentum eu, magna. Aenean ultrices ante. Aliquam erat volutpat. Morbi quis velit eu mi sollicitudin lacinia. Suspendisse potenti. Donec lectus.

-

Quisque egestas turpis. Sed id ipsum id libero euismod nonummy. Nam sed dolor. Mauris in turpis. Duis nec wisi eget ante ultrices varius. Ut eget neque. Suspendisse sagittis iaculis tellus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Phasellus at justo. Donec imperdiet, elit et commodo bibendum, leo augue pellentesque arcu, ac dapibus lorem nulla eget erat. In viverra, tellus eu luctus eleifend, urna nibh lobortis sapien, ac pulvinar massa enim vel turpis. Sed orci neque, sagittis eu, mattis vitae, rutrum condimentum, leo. Fusce wisi odio, convallis at, condimentum vel, imperdiet id, mi. Mauris semper, magna pretium consectetuer sollicitudin, eros enim vehicula risus, eu ultrices turpis quam at wisi. Nam mollis.

-
-
You can drag this whole object around.
-
You can move this paragraph. It is relatively positioned.
-
- - diff --git a/includes/js/dojo/tests/dnd/test_moveable_markup.html b/includes/js/dojo/tests/dnd/test_moveable_markup.html deleted file mode 100644 index 1f63d13..0000000 --- a/includes/js/dojo/tests/dnd/test_moveable_markup.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - Dojo Moveable markup test - - - - - - -

Dojo Moveable markup test

-

1st run

-

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent erat. In malesuada ultricies velit. Vestibulum tempor odio vitae diam. Morbi arcu lectus, laoreet eget, nonummy at, elementum a, quam. Pellentesque ac lacus. Cras quis est. Etiam suscipit, quam at eleifend nonummy, elit nunc sollicitudin tellus, at mattis est ligula interdum urna. Vivamus id augue sed mi consectetuer dictum. Suspendisse dapibus elit non urna. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam gravida dapibus ante. Nam viverra ligula in neque. Nullam at metus. Aenean ipsum.

-

Mauris vulputate elit a risus. Praesent pellentesque velit ac neque. Fusce ultrices augue vitae orci. Proin a ante. Nulla consectetuer arcu quis est. Suspendisse potenti. Aliquam erat volutpat. Morbi purus augue, eleifend eu, consectetuer sed, tristique ut, wisi. Cras ac tellus. Phasellus adipiscing, libero ac consequat volutpat, ligula purus mollis lectus, ac porttitor ipsum diam non urna. Donec lorem. Pellentesque diam tortor, posuere et, placerat vitae, iaculis et, sapien. Proin sodales vehicula purus. Quisque bibendum mi ac mauris. Quisque tellus. Morbi sagittis. Integer euismod rhoncus augue. Ut accumsan. Curabitur quis tellus sit amet odio ultricies tristique. Etiam malesuada.

-

Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec est. Cras semper nunc ut metus. Pellentesque blandit pede at erat. Quisque nonummy leo id metus. Donec mi mi, viverra id, adipiscing vitae, consectetuer ut, elit. In lectus augue, porttitor quis, viverra id, dignissim id, leo. Maecenas sapien. Nam adipiscing sem. Aenean ligula. Etiam vel velit. In mollis cursus dolor. Suspendisse ac nibh id leo tempor posuere. Aliquam sapien tellus, elementum non, aliquam sed, luctus eu, augue. Aliquam elementum leo nec enim. Donec ornare sagittis magna. Mauris ac tellus.

-

Duis ac augue rhoncus neque adipiscing feugiat. Donec pulvinar sem vitae neque. Donec commodo metus at ipsum. Cras vel magna vehicula lorem varius consequat. Morbi at enim vitae lectus mollis sodales. Sed tincidunt quam ut mi varius hendrerit. Sed porta arcu non libero. Quisque et wisi. Pellentesque lobortis. Ut enim felis, varius vitae, ornare quis, auctor ut, risus. Ut porta lorem vel quam. Etiam nunc purus, consectetuer non, lobortis eu, fermentum eu, magna. Aenean ultrices ante. Aliquam erat volutpat. Morbi quis velit eu mi sollicitudin lacinia. Suspendisse potenti. Donec lectus.

-

Quisque egestas turpis. Sed id ipsum id libero euismod nonummy. Nam sed dolor. Mauris in turpis. Duis nec wisi eget ante ultrices varius. Ut eget neque. Suspendisse sagittis iaculis tellus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Phasellus at justo. Donec imperdiet, elit et commodo bibendum, leo augue pellentesque arcu, ac dapibus lorem nulla eget erat. In viverra, tellus eu luctus eleifend, urna nibh lobortis sapien, ac pulvinar massa enim vel turpis. Sed orci neque, sagittis eu, mattis vitae, rutrum condimentum, leo. Fusce wisi odio, convallis at, condimentum vel, imperdiet id, mi. Mauris semper, magna pretium consectetuer sollicitudin, eros enim vehicula risus, eu ultrices turpis quam at wisi. Nam mollis.

- - - - - - - -
You can drag the table using this handle.
1Lorem ipsum dolor sit amet...
2Mauris vulputate elit a risus...
3Pellentesque habitant morbi tristique senectus...
4Duis ac augue rhoncus neque...
5Quisque egestas turpis. Sed id...
-

2nd run

-

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent erat. In malesuada ultricies velit. Vestibulum tempor odio vitae diam. Morbi arcu lectus, laoreet eget, nonummy at, elementum a, quam. Pellentesque ac lacus. Cras quis est. Etiam suscipit, quam at eleifend nonummy, elit nunc sollicitudin tellus, at mattis est ligula interdum urna. Vivamus id augue sed mi consectetuer dictum. Suspendisse dapibus elit non urna. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam gravida dapibus ante. Nam viverra ligula in neque. Nullam at metus. Aenean ipsum.

-

Mauris vulputate elit a risus. Praesent pellentesque velit ac neque. Fusce ultrices augue vitae orci. Proin a ante. Nulla consectetuer arcu quis est. Suspendisse potenti. Aliquam erat volutpat. Morbi purus augue, eleifend eu, consectetuer sed, tristique ut, wisi. Cras ac tellus. Phasellus adipiscing, libero ac consequat volutpat, ligula purus mollis lectus, ac porttitor ipsum diam non urna. Donec lorem. Pellentesque diam tortor, posuere et, placerat vitae, iaculis et, sapien. Proin sodales vehicula purus. Quisque bibendum mi ac mauris. Quisque tellus. Morbi sagittis. Integer euismod rhoncus augue. Ut accumsan. Curabitur quis tellus sit amet odio ultricies tristique. Etiam malesuada.

-

Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec est. Cras semper nunc ut metus. Pellentesque blandit pede at erat. Quisque nonummy leo id metus. Donec mi mi, viverra id, adipiscing vitae, consectetuer ut, elit. In lectus augue, porttitor quis, viverra id, dignissim id, leo. Maecenas sapien. Nam adipiscing sem. Aenean ligula. Etiam vel velit. In mollis cursus dolor. Suspendisse ac nibh id leo tempor posuere. Aliquam sapien tellus, elementum non, aliquam sed, luctus eu, augue. Aliquam elementum leo nec enim. Donec ornare sagittis magna. Mauris ac tellus.

-

Duis ac augue rhoncus neque adipiscing feugiat. Donec pulvinar sem vitae neque. Donec commodo metus at ipsum. Cras vel magna vehicula lorem varius consequat. Morbi at enim vitae lectus mollis sodales. Sed tincidunt quam ut mi varius hendrerit. Sed porta arcu non libero. Quisque et wisi. Pellentesque lobortis. Ut enim felis, varius vitae, ornare quis, auctor ut, risus. Ut porta lorem vel quam. Etiam nunc purus, consectetuer non, lobortis eu, fermentum eu, magna. Aenean ultrices ante. Aliquam erat volutpat. Morbi quis velit eu mi sollicitudin lacinia. Suspendisse potenti. Donec lectus.

-

Quisque egestas turpis. Sed id ipsum id libero euismod nonummy. Nam sed dolor. Mauris in turpis. Duis nec wisi eget ante ultrices varius. Ut eget neque. Suspendisse sagittis iaculis tellus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Phasellus at justo. Donec imperdiet, elit et commodo bibendum, leo augue pellentesque arcu, ac dapibus lorem nulla eget erat. In viverra, tellus eu luctus eleifend, urna nibh lobortis sapien, ac pulvinar massa enim vel turpis. Sed orci neque, sagittis eu, mattis vitae, rutrum condimentum, leo. Fusce wisi odio, convallis at, condimentum vel, imperdiet id, mi. Mauris semper, magna pretium consectetuer sollicitudin, eros enim vehicula risus, eu ultrices turpis quam at wisi. Nam mollis.

-
You can drag this whole paragraph around.
- - diff --git a/includes/js/dojo/tests/dnd/test_params.html b/includes/js/dojo/tests/dnd/test_params.html deleted file mode 100644 index 1be540c..0000000 --- a/includes/js/dojo/tests/dnd/test_params.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - Dojo DnD optional parameters test - - - - - - -

Dojo DnD optional parameters test

-

Normal paragraph: Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Mauris augue augue, condimentum nec, viverra et, porttitor sit amet, ligula. Cras malesuada sollicitudin risus. Praesent tincidunt nunc ut enim. Aliquam sit amet libero ac lorem ornare vulputate. Nulla a mauris cursus erat rutrum condimentum. Vivamus sit amet pede in felis sodales adipiscing. Curabitur arcu turpis, pharetra ac, porttitor ac, ultrices nec, quam. Donec feugiat purus eu nulla. Aenean mattis tellus vel nulla. Pellentesque vitae quam. Vestibulum scelerisque, eros nec imperdiet interdum, sapien quam accumsan libero, at vestibulum risus purus ut quam. Nam mattis, lorem vel rhoncus pulvinar, augue nibh rhoncus felis, et elementum felis dolor vitae justo. Nullam felis augue, ultricies ac, laoreet sed, lobortis in, neque. Vivamus nunc quam, dictum at, egestas et, fringilla non, magna.

-

Delayed move by 10px: Quisque at urna. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Pellentesque ante sem, ullamcorper in, ornare vitae, placerat id, velit. Ut ut tortor vitae lectus dignissim fringilla. Praesent urna enim, laoreet in, lobortis eget, porttitor eget, lacus. Suspendisse et enim. Duis semper nulla a felis. Duis dolor odio, ultrices et, lobortis sed, posuere eu, dolor. Duis est. Nam laoreet. Sed vehicula augue aliquam tortor.

-

With form elements: - dojotoolkit
- - - - - -

-

With form elements and skip setting: - dojotoolkit - - - - - -

- - diff --git a/includes/js/dojo/tests/dnd/test_parent_constraints.html b/includes/js/dojo/tests/dnd/test_parent_constraints.html deleted file mode 100644 index a814a06..0000000 --- a/includes/js/dojo/tests/dnd/test_parent_constraints.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - Dojo parent constraint test - - - - - - -

Dojo parent constraint test

-
-
This is the parent element. All children will be restricted with within = true.
-
I am restricted within my parent's margins.
-
I am restricted within my parent's border.
-
I am restricted within my parent's paddings.
-
I am restricted within my parent's content.
-
- - diff --git a/includes/js/dojo/tests/dnd/test_parent_constraints_margins.html b/includes/js/dojo/tests/dnd/test_parent_constraints_margins.html deleted file mode 100644 index 3ee455c..0000000 --- a/includes/js/dojo/tests/dnd/test_parent_constraints_margins.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - Dojo parent constraint test - - - - - - -

Dojo parent constraint test

-
-
This is the parent element.
-
Paragraph restricted to its parent element: Sed hendrerit ornare justo. Maecenas ac urna. Maecenas in leo in tortor tincidunt pellentesque. Vivamus augue. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Integer eget ipsum vitae quam condimentum tempus. Phasellus augue tortor, pretium nec, bibendum eget, eleifend eget, quam. Nam sem mauris, volutpat eget, ultricies in, consequat nec, tortor. Nulla eleifend. Vivamus et purus ultricies turpis vehicula auctor.
-
Paragraph restricted to its parent element (cannot go outside): Nam nibh. Mauris neque sem, pharetra ac, gravida ac, ultricies eget, quam. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Vivamus scelerisque molestie mi. Duis eget ligula nec justo interdum hendrerit. Curabitur tempor convallis enim. In quis lorem. Proin nonummy consectetuer ligula. Curabitur tempor adipiscing lorem. Maecenas vitae nunc. Aliquam et magna. In vestibulum justo eleifend ante. Nulla pede sem, tempus tincidunt, vehicula ut, tempor et, nisi. Nulla ut lorem. Aliquam erat volutpat. Proin sodales, elit ut molestie dignissim, quam neque vulputate felis, quis scelerisque magna arcu aliquet lacus. Vivamus blandit. Nam eu mi vel augue pharetra semper.
-
- - diff --git a/includes/js/dojo/tests/dnd/test_selector.html b/includes/js/dojo/tests/dnd/test_selector.html deleted file mode 100644 index bebdca9..0000000 --- a/includes/js/dojo/tests/dnd/test_selector.html +++ /dev/null @@ -1,80 +0,0 @@ - - - - Dojo DnD selector test - - - - - - - - -

Dojo DnD selector test

-

Containers have a notion of a "current container", and one element can be "current". All containers on this page are selectors that allow to select elements.

-

Following selection modes are supported by default:

-
    -
  • Simple click — selects a single element, all other elements will be unselected.
  • -
  • Ctrl+click — toggles a selection state of an element (use Meta key on Mac).
  • -
  • Shift+click — selects a range of elements from the previous anchor to the current element.
  • -
  • Ctrl+Shift+click — adds a range of elements from the previous anchor to the current element (use Meta key on Mac).
  • -
-

DIV selector

-

This selector can select just one element a time. It was specified during the creation time.

-
-
Item 1
-
Item 2
-
Item 3
-
-

UL selector

-
    -
  • Item 1
  • -
  • Item 2
  • -
  • Item 3
  • -
-

OL selector

-
    -
  1. Item 1
  2. -
  3. Item 2
  4. -
  5. Item 3
  6. -
-

TABLE selector

- - - - - - - - - - - - - -
Arow 1
Brow 2
Crow 3
-

P selector with SPAN elements

-

Elements of this container are layed out horizontally.

-

-  Item 1  -  Item 2  -  Item 3  -

- - diff --git a/includes/js/dojo/tests/dnd/test_selector_markup.html b/includes/js/dojo/tests/dnd/test_selector_markup.html deleted file mode 100644 index 43c8e9c..0000000 --- a/includes/js/dojo/tests/dnd/test_selector_markup.html +++ /dev/null @@ -1,71 +0,0 @@ - - - - Dojo DnD markup selector test - - - - - - -

Dojo DnD markup selector test

-

This example is functionally equivalent to test_selector.html example but is done using the Dojo markup.

-

Containers have a notion of a "current container", and one element can be "current". All containers on this page are selectors that allow to select elements.

-

Following selection modes are supported by default:

-
    -
  • Simple click — selects a single element, all other elements will be unselected.
  • -
  • Ctrl+click — toggles a selection state of an element (use Meta key on Mac).
  • -
  • Shift+click — selects a range of elements from the previous anchor to the current element.
  • -
  • Ctrl+Shift+click — adds a range of elements from the previous anchor to the current element (use Meta key on Mac).
  • -
-

DIV selector

-

This selector can select just one element a time. It was specified during the creation time.

-
-
Item 1
-
Item 2
-
Item 3
-
-

UL selector

-
    -
  • Item 1
  • -
  • Item 2
  • -
  • Item 3
  • -
-

OL selector

-
    -
  1. Item 1
  2. -
  3. Item 2
  4. -
  5. Item 3
  6. -
-

TABLE selector

- - - - - - - - - - - - - -
Arow 1
Brow 2
Crow 3
-

P selector with SPAN elements

-

Elements of this container are layed out horizontally.

-

-  Item 1  -  Item 2  -  Item 3  -

- - diff --git a/includes/js/dojo/tests/dnd/test_timed_moveable.html b/includes/js/dojo/tests/dnd/test_timed_moveable.html deleted file mode 100644 index 685067e..0000000 --- a/includes/js/dojo/tests/dnd/test_timed_moveable.html +++ /dev/null @@ -1,112 +0,0 @@ - - - - Dojo TimedMoveable test - - - - - - - - - -

Dojo TimedMoveable test

-

One moveable (specially marked) is delayed by 500ms (2 fps). Other two are delayed by 40ms (25 fps) — this is the default value.

-

1st run

-

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent erat. In malesuada ultricies velit. Vestibulum tempor odio vitae diam. Morbi arcu lectus, laoreet eget, nonummy at, elementum a, quam. Pellentesque ac lacus. Cras quis est. Etiam suscipit, quam at eleifend nonummy, elit nunc sollicitudin tellus, at mattis est ligula interdum urna. Vivamus id augue sed mi consectetuer dictum. Suspendisse dapibus elit non urna. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam gravida dapibus ante. Nam viverra ligula in neque. Nullam at metus. Aenean ipsum.

-

Mauris vulputate elit a risus. Praesent pellentesque velit ac neque. Fusce ultrices augue vitae orci. Proin a ante. Nulla consectetuer arcu quis est. Suspendisse potenti. Aliquam erat volutpat. Morbi purus augue, eleifend eu, consectetuer sed, tristique ut, wisi. Cras ac tellus. Phasellus adipiscing, libero ac consequat volutpat, ligula purus mollis lectus, ac porttitor ipsum diam non urna. Donec lorem. Pellentesque diam tortor, posuere et, placerat vitae, iaculis et, sapien. Proin sodales vehicula purus. Quisque bibendum mi ac mauris. Quisque tellus. Morbi sagittis. Integer euismod rhoncus augue. Ut accumsan. Curabitur quis tellus sit amet odio ultricies tristique. Etiam malesuada.

-

Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec est. Cras semper nunc ut metus. Pellentesque blandit pede at erat. Quisque nonummy leo id metus. Donec mi mi, viverra id, adipiscing vitae, consectetuer ut, elit. In lectus augue, porttitor quis, viverra id, dignissim id, leo. Maecenas sapien. Nam adipiscing sem. Aenean ligula. Etiam vel velit. In mollis cursus dolor. Suspendisse ac nibh id leo tempor posuere. Aliquam sapien tellus, elementum non, aliquam sed, luctus eu, augue. Aliquam elementum leo nec enim. Donec ornare sagittis magna. Mauris ac tellus.

-

Duis ac augue rhoncus neque adipiscing feugiat. Donec pulvinar sem vitae neque. Donec commodo metus at ipsum. Cras vel magna vehicula lorem varius consequat. Morbi at enim vitae lectus mollis sodales. Sed tincidunt quam ut mi varius hendrerit. Sed porta arcu non libero. Quisque et wisi. Pellentesque lobortis. Ut enim felis, varius vitae, ornare quis, auctor ut, risus. Ut porta lorem vel quam. Etiam nunc purus, consectetuer non, lobortis eu, fermentum eu, magna. Aenean ultrices ante. Aliquam erat volutpat. Morbi quis velit eu mi sollicitudin lacinia. Suspendisse potenti. Donec lectus.

-

Quisque egestas turpis. Sed id ipsum id libero euismod nonummy. Nam sed dolor. Mauris in turpis. Duis nec wisi eget ante ultrices varius. Ut eget neque. Suspendisse sagittis iaculis tellus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Phasellus at justo. Donec imperdiet, elit et commodo bibendum, leo augue pellentesque arcu, ac dapibus lorem nulla eget erat. In viverra, tellus eu luctus eleifend, urna nibh lobortis sapien, ac pulvinar massa enim vel turpis. Sed orci neque, sagittis eu, mattis vitae, rutrum condimentum, leo. Fusce wisi odio, convallis at, condimentum vel, imperdiet id, mi. Mauris semper, magna pretium consectetuer sollicitudin, eros enim vehicula risus, eu ultrices turpis quam at wisi. Nam mollis.

- - - - - - - -
You can drag the table using this handle.
1Lorem ipsum dolor sit amet...
2Mauris vulputate elit a risus...
3Pellentesque habitant morbi tristique senectus...
4Duis ac augue rhoncus neque...
5Quisque egestas turpis. Sed id...
-

2nd run

-

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent erat. In malesuada ultricies velit. Vestibulum tempor odio vitae diam. Morbi arcu lectus, laoreet eget, nonummy at, elementum a, quam. Pellentesque ac lacus. Cras quis est. Etiam suscipit, quam at eleifend nonummy, elit nunc sollicitudin tellus, at mattis est ligula interdum urna. Vivamus id augue sed mi consectetuer dictum. Suspendisse dapibus elit non urna. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam gravida dapibus ante. Nam viverra ligula in neque. Nullam at metus. Aenean ipsum.

-

Mauris vulputate elit a risus. Praesent pellentesque velit ac neque. Fusce ultrices augue vitae orci. Proin a ante. Nulla consectetuer arcu quis est. Suspendisse potenti. Aliquam erat volutpat. Morbi purus augue, eleifend eu, consectetuer sed, tristique ut, wisi. Cras ac tellus. Phasellus adipiscing, libero ac consequat volutpat, ligula purus mollis lectus, ac porttitor ipsum diam non urna. Donec lorem. Pellentesque diam tortor, posuere et, placerat vitae, iaculis et, sapien. Proin sodales vehicula purus. Quisque bibendum mi ac mauris. Quisque tellus. Morbi sagittis. Integer euismod rhoncus augue. Ut accumsan. Curabitur quis tellus sit amet odio ultricies tristique. Etiam malesuada.

-

Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec est. Cras semper nunc ut metus. Pellentesque blandit pede at erat. Quisque nonummy leo id metus. Donec mi mi, viverra id, adipiscing vitae, consectetuer ut, elit. In lectus augue, porttitor quis, viverra id, dignissim id, leo. Maecenas sapien. Nam adipiscing sem. Aenean ligula. Etiam vel velit. In mollis cursus dolor. Suspendisse ac nibh id leo tempor posuere. Aliquam sapien tellus, elementum non, aliquam sed, luctus eu, augue. Aliquam elementum leo nec enim. Donec ornare sagittis magna. Mauris ac tellus.

-

Duis ac augue rhoncus neque adipiscing feugiat. Donec pulvinar sem vitae neque. Donec commodo metus at ipsum. Cras vel magna vehicula lorem varius consequat. Morbi at enim vitae lectus mollis sodales. Sed tincidunt quam ut mi varius hendrerit. Sed porta arcu non libero. Quisque et wisi. Pellentesque lobortis. Ut enim felis, varius vitae, ornare quis, auctor ut, risus. Ut porta lorem vel quam. Etiam nunc purus, consectetuer non, lobortis eu, fermentum eu, magna. Aenean ultrices ante. Aliquam erat volutpat. Morbi quis velit eu mi sollicitudin lacinia. Suspendisse potenti. Donec lectus.

-

Quisque egestas turpis. Sed id ipsum id libero euismod nonummy. Nam sed dolor. Mauris in turpis. Duis nec wisi eget ante ultrices varius. Ut eget neque. Suspendisse sagittis iaculis tellus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Phasellus at justo. Donec imperdiet, elit et commodo bibendum, leo augue pellentesque arcu, ac dapibus lorem nulla eget erat. In viverra, tellus eu luctus eleifend, urna nibh lobortis sapien, ac pulvinar massa enim vel turpis. Sed orci neque, sagittis eu, mattis vitae, rutrum condimentum, leo. Fusce wisi odio, convallis at, condimentum vel, imperdiet id, mi. Mauris semper, magna pretium consectetuer sollicitudin, eros enim vehicula risus, eu ultrices turpis quam at wisi. Nam mollis.

-
You can drag this whole paragraph around.
-
My move is delayed by 500ms, which corresponds to 2 fps.
- - diff --git a/includes/js/dojo/tests/fx.html b/includes/js/dojo/tests/fx.html deleted file mode 100644 index bd2c9c1..0000000 --- a/includes/js/dojo/tests/fx.html +++ /dev/null @@ -1,310 +0,0 @@ - - - - Testing dojo.fx - - - - - -
a
b
-
c
d
- -
-

- Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean - semper sagittis velit. Cras in mi. Duis porta mauris ut ligula. - Proin porta rutrum lacus. Etiam consequat scelerisque quam. Nulla - facilisi. Maecenas luctus venenatis nulla. In sit amet dui non mi - semper iaculis. Sed molestie tortor at ipsum. Morbi dictum rutrum - magna. Sed vitae risus. -

-

- Aliquam vitae enim. Duis scelerisque metus auctor est venenatis - imperdiet. Fusce dignissim porta augue. Nulla vestibulum. Integer - lorem nunc, ullamcorper a, commodo ac, malesuada sed, dolor. Aenean - id mi in massa bibendum suscipit. Integer eros. Nullam suscipit - mauris. In pellentesque. Mauris ipsum est, pharetra semper, - pharetra in, viverra quis, tellus. Etiam purus. Quisque egestas, - tortor ac cursus lacinia, felis leo adipiscing nisi, et rhoncus - elit dolor eget eros. Fusce ut quam. Suspendisse eleifend leo vitae - ligula. Nulla facilisi. Nulla rutrum, erat vitae lacinia dictum, - pede purus imperdiet lacus, ut semper velit ante id metus. Praesent - massa dolor, porttitor sed, pulvinar in, consequat ut, leo. Nullam - nec est. Aenean id risus blandit tortor pharetra congue. - Suspendisse pulvinar. -

-
-
foo2
- - diff --git a/includes/js/dojo/tests/fx.js b/includes/js/dojo/tests/fx.js deleted file mode 100644 index f5e2cfc..0000000 --- a/includes/js/dojo/tests/fx.js +++ /dev/null @@ -1,9 +0,0 @@ -if(!dojo._hasResource["tests.fx"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests.fx"] = true; -dojo.provide("tests.fx"); -if(dojo.isBrowser){ - doh.registerUrl("tests.fx", dojo.moduleUrl("tests", "fx.html"), 30000); - doh.registerUrl("tests.NodeList-fx", dojo.moduleUrl("tests", "NodeList-fx.html")); -} - -} diff --git a/includes/js/dojo/tests/i18n.js b/includes/js/dojo/tests/i18n.js deleted file mode 100644 index 47bb946..0000000 --- a/includes/js/dojo/tests/i18n.js +++ /dev/null @@ -1,88 +0,0 @@ -if(!dojo._hasResource["tests.i18n"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests.i18n"] = true; -dojo.provide("tests.i18n"); - -dojo.require("dojo.i18n"); - -(function(){ - var setUp = function(locale){ - return function(){ - dojo.requireLocalization("tests","salutations",locale, ""); - } - } - - var getTest = function(value, locale){ - return function(){ - doh.assertEqual(value, dojo.i18n.getLocalization("tests", "salutations", locale).hello); - } - } - - var getFixture = function(locale, value){ - return { - name: "salutations-"+locale, - setUp: setUp(locale), - runTest: getTest(value, locale) - }; - } - - var testSet = [ - /* needs dojo.string, - // This doesn't actually test anything, it just gives an impressive list of translated output to the console - // See the 'salutations' test for something verifyable - function fun(t){ - var salutations_default = dojo.i18n.getLocalization("tests", "salutations"); - console.debug("In the local language: "+salutations_default.hello); - - var salutations_en = dojo.i18n.getLocalization("tests", "salutations", "en"); - - for (i in tests.nls.salutations) { - var loc = i.replace('_', '-'); - var salutations = dojo.i18n.getLocalization("tests", "salutations", loc); - var language_as_english = salutations_en[loc]; - var language_as_native = salutations[loc]; - var hello_dojo = dojo.string.substitute(salutations.hello_dojo, salutations); - if (!dojo.i18n.isLeftToRight(loc)) { - var RLE = "\u202b"; - var PDF = "\u202c"; - hello_dojo = RLE + hello_dojo + PDF; - } - hello_dojo += "\t[" + loc + "]"; - if(language_as_english){hello_dojo += " " + language_as_english;} - if(language_as_native){hello_dojo += " (" + language_as_native + ")";} - console.debug(hello_dojo); - } - - t.assertTrue(true); - }, - */ - - // Test on-the-fly loading of localized string bundles from different locales, and - // the expected inheritance behavior - - // Locale which overrides root translation - getFixture("de", "Hallo"), - // Locale which does not override root translation - getFixture("en", "Hello"), - // Locale which overrides its parent - getFixture("en-au", "G'day"), - // Locale which does not override its parent - getFixture("en-us", "Hello"), - // Locale which overrides its parent - getFixture("en-us-texas", "Howdy"), - // 3rd level variant which overrides its parent - getFixture("en-us-new_york", "Hello"), - // Locale which overrides its grandparent - getFixture("en-us-new_york-brooklyn", "Yo"), - // Locale which does not have any translation available - getFixture("xx", "Hello"), - // A double-byte string. Everything should be read in as UTF-8 and treated as unicode within Javascript. - getFixture("zh-cn", "\u4f60\u597d") - ]; - testSet[testSet.length-1].tearDown = function(){ - // Clean up bundles that should not exist if the test is re-run. - delete tests.nls.salutations; - }; - tests.register("tests.i18n", testSet); -})(); - -} diff --git a/includes/js/dojo/tests/io/iframe.html b/includes/js/dojo/tests/io/iframe.html deleted file mode 100644 index c37bcb1..0000000 --- a/includes/js/dojo/tests/io/iframe.html +++ /dev/null @@ -1,124 +0,0 @@ - - - - Testing dojo.io.iframe - - - - - - - - diff --git a/includes/js/dojo/tests/io/iframe.js b/includes/js/dojo/tests/io/iframe.js deleted file mode 100644 index 6e20af5..0000000 --- a/includes/js/dojo/tests/io/iframe.js +++ /dev/null @@ -1,8 +0,0 @@ -if(!dojo._hasResource["tests.io.iframe"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests.io.iframe"] = true; -dojo.provide("tests.io.iframe"); -if(dojo.isBrowser){ - doh.registerUrl("tests.io.iframe", dojo.moduleUrl("tests.io", "iframe.html")); -} - -} diff --git a/includes/js/dojo/tests/io/iframeResponse.html b/includes/js/dojo/tests/io/iframeResponse.html deleted file mode 100644 index cd26e21..0000000 --- a/includes/js/dojo/tests/io/iframeResponse.html +++ /dev/null @@ -1,8 +0,0 @@ - - - - -

SUCCESSFUL HTML response

- - - diff --git a/includes/js/dojo/tests/io/iframeResponse.js.html b/includes/js/dojo/tests/io/iframeResponse.js.html deleted file mode 100644 index 50c1855..0000000 --- a/includes/js/dojo/tests/io/iframeResponse.js.html +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/includes/js/dojo/tests/io/iframeResponse.json.html b/includes/js/dojo/tests/io/iframeResponse.json.html deleted file mode 100644 index cb04ed7..0000000 --- a/includes/js/dojo/tests/io/iframeResponse.json.html +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/includes/js/dojo/tests/io/iframeResponse.text.html b/includes/js/dojo/tests/io/iframeResponse.text.html deleted file mode 100644 index 2a05b83..0000000 --- a/includes/js/dojo/tests/io/iframeResponse.text.html +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/includes/js/dojo/tests/io/iframeUploadTest.html b/includes/js/dojo/tests/io/iframeUploadTest.html deleted file mode 100644 index 6f6db6f..0000000 --- a/includes/js/dojo/tests/io/iframeUploadTest.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - -

This file tests dojo.io.iframe upload using a form POST with a file upload button.

- -

- Note: This test makes a form POST to upload.cgi. This cgi needs to be made executable for this test to work, and it won't work from local disk. -

-
- - - -
- - - diff --git a/includes/js/dojo/tests/io/script.html b/includes/js/dojo/tests/io/script.html deleted file mode 100644 index db24ac9..0000000 --- a/includes/js/dojo/tests/io/script.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - Testing dojo.io.script - - - - - - - - diff --git a/includes/js/dojo/tests/io/script.js b/includes/js/dojo/tests/io/script.js deleted file mode 100644 index 722a805..0000000 --- a/includes/js/dojo/tests/io/script.js +++ /dev/null @@ -1,8 +0,0 @@ -if(!dojo._hasResource["tests.io.script"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests.io.script"] = true; -dojo.provide("tests.io.script"); -if(dojo.isBrowser){ - doh.registerUrl("tests.io.script", dojo.moduleUrl("tests.io", "script.html")); -} - -} diff --git a/includes/js/dojo/tests/io/scriptJsonp.js b/includes/js/dojo/tests/io/scriptJsonp.js deleted file mode 100644 index ad1a196..0000000 --- a/includes/js/dojo/tests/io/scriptJsonp.js +++ /dev/null @@ -1,57 +0,0 @@ -function getJsonpCallback(url){ - var result = null; - var idMatch = url.match(/jsonp=(.*?)(&|$)/); - if(idMatch){ - result = idMatch[1]; - }else{ - //jsonp didn't match, so maybe it is the jsonCallback thing. - idMatch = url.match(/callback=(.*?)(&|$)/); - if(idMatch){ - result = idMatch[1]; - } - } - - if(result){ - result = decodeURIComponent(result); - } - return result; -} - -function findJsonpDone(){ - var result = false; - var scriptUrls = getScriptUrls(); - - for(var i = 0; i < scriptUrls.length; i++){ - var jsonp = getJsonpCallback(scriptUrls[i]); - if(jsonp){ - eval(jsonp + "({animalType: 'mammal'});"); - result = true; - break; - } - } - return result; -} - -function getScriptUrls(){ - //Get the script tags in the page to figure what state we are in. - var scripts = document.getElementsByTagName('script'); - var scriptUrls = new Array(); - for(var i = 0; scripts && i < scripts.length; i++){ - var scriptTag = scripts[i]; - if(scriptTag.id.indexOf("dojoIoScript") == 0){ - scriptUrls.push(scriptTag.src); - } - } - - return scriptUrls; -} - -function doJsonpCallback(){ - if(!findJsonpDone()){ - alert('ERROR: Could not jsonp callback!'); - } -} - -//Set a timeout to do the callback check, since MSIE won't see the SCRIPT tag until -//we complete processing of this page. -setTimeout(function(){doJsonpCallback();}, 300); diff --git a/includes/js/dojo/tests/io/scriptSimple.js b/includes/js/dojo/tests/io/scriptSimple.js deleted file mode 100644 index 8ca316c..0000000 --- a/includes/js/dojo/tests/io/scriptSimple.js +++ /dev/null @@ -1,5 +0,0 @@ -myTasks = new Array(); -myTasks[0] = 'Take out trash.'; -myTasks[1] = 'Do dishes.'; -myTasks[2] = 'Brush teeth.'; - diff --git a/includes/js/dojo/tests/io/scriptTimeout.html b/includes/js/dojo/tests/io/scriptTimeout.html deleted file mode 100644 index 563e37c..0000000 --- a/includes/js/dojo/tests/io/scriptTimeout.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - Testing dojo.io.script - - - - - -

Timeout test

- -

- This test page tests the timeout functionality of dojo.io.script, and to make - sure that requests that time out get removed quickly. If the server response - is received after the script has been timed out, there should not be weird - errors as the browser tries to evaluate the responses after the desired time - period. -

- -

This test requires a server running PHP to work.

- -

-

Firefox Oddity: Firefox - will print an error after the script response is received from the server:
- dojo.io.script.jsonp_dojoIoScript1 has no properties - This is bad because Firefox goes ahead and evaluates the script contents in the page's - JavaScript space (this happens even when I turn off Firefox Add-Ons). All other browsers - do not evaluate the script (given the weird Opera 9.22 behavior below). You can test this - by clicking the Test for SuperXFooBarVariable button after receiving the response - for timeout.php (check Firebug Net tab to see when request is received). All other browsers - show an error or show the "undefined" value for SuperXFooBarVariable, but Firefox will show its - value as being: "Oh no! SuperXFooBarVariable is defined (should not be for timeout case)". - -

Opera Oddity: Opera 9.22 does not seem to trigger the timeout case, - but rather it waits for the server to send a response to the script before continuing past the - point where the script is added to the DOM? That seems wrong. Dynamic script tags are no longer - an async operation? -

- - - - - diff --git a/includes/js/dojo/tests/io/upload.cgi b/includes/js/dojo/tests/io/upload.cgi deleted file mode 100644 index a13656f..0000000 --- a/includes/js/dojo/tests/io/upload.cgi +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/python - -# FROM: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/273844 - -import cgi -import cgitb; cgitb.enable() -import os, sys -import string - -UPLOAD_DIR = "/tmp/upload/" -form = cgi.FieldStorage() - -dbg = [] - -def debug(dbgstr): - dbg.append(str(dbgstr)) - -def save_uploaded_file(form_field, upload_dir): - global form - if not form.has_key(form_field): - debug("didn't find it! (1)") - return - fileitem = form[form_field] - if not fileitem.file: - debug(form.getvalue(form_field, "")) - debug(fileitem.__dict__) - debug("didn't find it! (2)") - return - fout = file(os.path.join(upload_dir, fileitem.filename), 'wb') - while 1: - chunk = fileitem.file.read(100000) - if not chunk: break - fout.write (chunk) - fout.close() - -retval = "false"; -fileFields = "" - -if form.has_key("fileFields"): - fval = str(form.getvalue("fileFields", "")) - fileFields = fval.split(",") - debug("'fileCount': '" + str(len(fileFields)) + "',") - for field in fileFields: - debug("'fileField' : '"+field + "',") - save_uploaded_file(str(field).strip(), UPLOAD_DIR) - retval = "true"; - -debug("'retval': " + retval) - -print """Content-Type: text/html - - - - - - - - - -""" % (string.join(dbg, "\n")) diff --git a/includes/js/dojo/tests/manualTests.html b/includes/js/dojo/tests/manualTests.html deleted file mode 100644 index 26ff163..0000000 --- a/includes/js/dojo/tests/manualTests.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - Dojo Manual Test Runner - - - Redirecting to D.O.H runner - - - diff --git a/includes/js/dojo/tests/manualTests.js b/includes/js/dojo/tests/manualTests.js deleted file mode 100644 index d60a01b..0000000 --- a/includes/js/dojo/tests/manualTests.js +++ /dev/null @@ -1,45 +0,0 @@ -if(!dojo._hasResource["dojo.tests.manualTests"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["dojo.tests.manualTests"] = true; -dojo.provide("dojo.tests.manualTests"); - -try{ -if(dojo.isBrowser){ - var userArgs = window.location.search.replace(/[\?&](dojoUrl|testUrl|testModule)=[^&]*/g,"").replace(/^&/,"?"); - doh.registerUrl("dojo/tests/back-bookmark.html", dojo.moduleUrl("dojo","tests/back-bookmark.html"+userArgs), 99999999); - doh.registerUrl("dojo/tests/back.html", dojo.moduleUrl("dojo","tests/back.html"+userArgs), 99999999); - doh.registerUrl("dojo/tests/test_FirebugLite.html", dojo.moduleUrl("dojo","tests/test_FirebugLite.html"+userArgs), 99999999); - doh.registerUrl("dojo/tests/test_fx.html", dojo.moduleUrl("dojo","tests/test_fx.html"+userArgs), 99999999); - doh.registerUrl("dojo/tests/dnd/flickr_viewer.html", dojo.moduleUrl("dojo","tests/dnd/flickr_viewer.html"+userArgs), 99999999); - doh.registerUrl("dojo/tests/dnd/test_box_constraints.html", dojo.moduleUrl("dojo","tests/dnd/test_box_constraints.html"+userArgs), 99999999); - doh.registerUrl("dojo/tests/dnd/test_container.html", dojo.moduleUrl("dojo","tests/dnd/test_container.html"+userArgs), 99999999); - doh.registerUrl("dojo/tests/dnd/test_container_markup.html", dojo.moduleUrl("dojo","tests/dnd/test_container_markup.html"+userArgs), 99999999); - doh.registerUrl("dojo/tests/dnd/test_custom_constraints.html", dojo.moduleUrl("dojo","tests/dnd/test_custom_constraints.html"+userArgs), 99999999); - doh.registerUrl("dojo/tests/dnd/test_dnd.html", dojo.moduleUrl("dojo","tests/dnd/test_dnd.html"+userArgs), 99999999); - doh.registerUrl("dojo/tests/dnd/test_dnd_handles.html", dojo.moduleUrl("dojo","tests/dnd/test_dnd_handles.html"+userArgs), 99999999); - doh.registerUrl("dojo/tests/dnd/test_form.html", dojo.moduleUrl("dojo","tests/dnd/test_form.html"+userArgs), 99999999); - doh.registerUrl("dojo/tests/dnd/test_moveable.html", dojo.moduleUrl("dojo","tests/dnd/test_moveable.html"+userArgs), 99999999); - doh.registerUrl("dojo/tests/dnd/test_moveable_markup.html", dojo.moduleUrl("dojo","tests/dnd/test_moveable_markup.html"+userArgs), 99999999); - doh.registerUrl("dojo/tests/dnd/test_params.html", dojo.moduleUrl("dojo","tests/dnd/test_params.html"+userArgs), 99999999); - doh.registerUrl("dojo/tests/dnd/test_parent_constraints.html", dojo.moduleUrl("dojo","tests/dnd/test_parent_constraints.html"+userArgs), 99999999); - doh.registerUrl("dojo/tests/dnd/test_parent_constraints_margins.html", dojo.moduleUrl("dojo","tests/dnd/test_parent_constraints_margins.html"+userArgs), 99999999); - doh.registerUrl("dojo/tests/dnd/test_selector.html", dojo.moduleUrl("dojo","tests/dnd/test_selector.html"+userArgs), 99999999); - doh.registerUrl("dojo/tests/dnd/test_selector_markup.html", dojo.moduleUrl("dojo","tests/dnd/test_selector_markup.html"+userArgs), 99999999); - doh.registerUrl("dojo/tests/dnd/test_timed_moveable.html", dojo.moduleUrl("dojo","tests/dnd/test_timed_moveable.html"+userArgs), 99999999); - doh.registerUrl("dojo/tests/io/iframeUploadTest.html", dojo.moduleUrl("dojo","tests/io/iframeUploadTest.html"+userArgs), 99999999); - doh.registerUrl("dojo/tests/io/scriptTimeout.html", dojo.moduleUrl("dojo","tests/io/scriptTimeout.html"+userArgs), 99999999); - doh.registerUrl("dojo/tests/_base/fx_delay.html", dojo.moduleUrl("dojo","tests/_base/fx_delay.html"+userArgs), 99999999); - doh.registerUrl("dojo/tests/_base/_loader/addLoadEvents.html", dojo.moduleUrl("dojo","tests/_base/_loader/addLoadEvents.html"+userArgs), 99999999); - doh.registerUrl("dojo/tests/_base/_loader/afterOnLoad.html", dojo.moduleUrl("dojo","tests/_base/_loader/afterOnLoad.html"+userArgs), 99999999); - doh.registerUrl("dojo/tests/_base/_loader/744/testEval.html", dojo.moduleUrl("dojo","tests/_base/_loader/744/testEval.html"+userArgs), 99999999); - doh.registerUrl("dojo/tests/_base/_loader/scope/scope04.html", dojo.moduleUrl("dojo","tests/_base/_loader/scope/scope04.html"+userArgs), 99999999); - doh.registerUrl("dojo/tests/_base/_loader/scope/scopeContained.html", dojo.moduleUrl("dojo","tests/_base/_loader/scope/scopeContained.html"+userArgs), 99999999); - doh.registerUrl("dojo/tests/_base/_loader/scope/scopeContainedXd.html", dojo.moduleUrl("dojo","tests/_base/_loader/scope/scopeContainedXd.html"+userArgs), 99999999); - doh.registerUrl("dojo/tests/_base/_loader/scope/scopeDjConfig.html", dojo.moduleUrl("dojo","tests/_base/_loader/scope/scopeDjConfig.html"+userArgs), 99999999); - doh.registerUrl("dojo/tests/_base/_loader/scope/scopeSingle.html", dojo.moduleUrl("dojo","tests/_base/_loader/scope/scopeSingle.html"+userArgs), 99999999); - doh.registerUrl("dojo/tests/_base/_loader/scope/scopeSingleDaac.html", dojo.moduleUrl("dojo","tests/_base/_loader/scope/scopeSingleDaac.html"+userArgs), 99999999); -} -}catch(e){ - doh.debug(e); -} - -} diff --git a/includes/js/dojo/tests/module.js b/includes/js/dojo/tests/module.js deleted file mode 100644 index c4995aa..0000000 --- a/includes/js/dojo/tests/module.js +++ /dev/null @@ -1,29 +0,0 @@ -if(!dojo._hasResource["dojo.tests.module"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["dojo.tests.module"] = true; -dojo.provide("dojo.tests.module"); - -try{ - dojo.require("tests._base"); - dojo.require("tests.i18n"); - dojo.requireIf(dojo.isBrowser, "tests.back-hash"); - dojo.require("tests.cldr"); - dojo.require("tests.data"); - dojo.require("tests.date"); - dojo.require("tests.number"); - dojo.require("tests.currency"); - dojo.require("tests.AdapterRegistry"); - dojo.require("tests.io.script"); - dojo.require("tests.io.iframe"); - dojo.requireIf(dojo.isBrowser, "tests.rpc"); - dojo.require("tests.string"); - dojo.require("tests.behavior"); - dojo.require("tests.parser"); - dojo.require("tests.colors"); - dojo.requireIf(dojo.isBrowser,"tests.cookie"); - dojo.require("tests.fx"); - dojo.require("tests.DeferredList"); -}catch(e){ - doh.debug(e); -} - -} diff --git a/includes/js/dojo/tests/nls/ar/salutations.js b/includes/js/dojo/tests/nls/ar/salutations.js deleted file mode 100644 index f6f2cbf..0000000 --- a/includes/js/dojo/tests/nls/ar/salutations.js +++ /dev/null @@ -1 +0,0 @@ -({"ar":"العربية","hello":"ﺎﺑﺣﺮﻣ","yi":"Yiddish","en-us-texas":"English (Texas)","es":"Spanish","de":"German","pl":"Polish","hello_dojo":"${hello}, ${dojo}!","fa":"Farsi","pt":"Portugese","zh-tw":"Chinese (Traditional)","sw":"Kiswahili","en-us-new_york-brooklyn":"English (Brooklynese)","ru":"Russian","fr":"French","th":"Thai","it":"Italian","he":"Hebrew","cs":"Czech","hi":"Hindi","en-us-hawaii":"English (US-Hawaii)","file_not_found":"The file you requested, ${0}, is not found.","en-au":"English (Australia)","el":"Greek","ko":"Korean","tr":"Turkish","en":"English","ja":"Japanese","zh-cn":"Chinese (Simplified)","dojo":"Dojo"}) \ No newline at end of file diff --git a/includes/js/dojo/tests/nls/cs/salutations.js b/includes/js/dojo/tests/nls/cs/salutations.js deleted file mode 100644 index 0d7b880..0000000 --- a/includes/js/dojo/tests/nls/cs/salutations.js +++ /dev/null @@ -1 +0,0 @@ -({"hello":"Ahoj","cs":"česky","yi":"Yiddish","en-us-texas":"English (Texas)","es":"Spanish","de":"German","pl":"Polish","hello_dojo":"${hello}, ${dojo}!","fa":"Farsi","pt":"Portugese","zh-tw":"Chinese (Traditional)","sw":"Kiswahili","ar":"Arabic","en-us-new_york-brooklyn":"English (Brooklynese)","ru":"Russian","fr":"French","th":"Thai","it":"Italian","he":"Hebrew","hi":"Hindi","en-us-hawaii":"English (US-Hawaii)","file_not_found":"The file you requested, ${0}, is not found.","en-au":"English (Australia)","el":"Greek","ko":"Korean","tr":"Turkish","en":"English","ja":"Japanese","zh-cn":"Chinese (Simplified)","dojo":"Dojo"}) \ No newline at end of file diff --git a/includes/js/dojo/tests/nls/de/salutations.js b/includes/js/dojo/tests/nls/de/salutations.js deleted file mode 100644 index efd62ec..0000000 --- a/includes/js/dojo/tests/nls/de/salutations.js +++ /dev/null @@ -1 +0,0 @@ -({"de":"Deutsch","hello":"Hallo","yi":"Yiddish","en-us-texas":"English (Texas)","es":"Spanish","pl":"Polish","hello_dojo":"${hello}, ${dojo}!","fa":"Farsi","pt":"Portugese","zh-tw":"Chinese (Traditional)","sw":"Kiswahili","ar":"Arabic","en-us-new_york-brooklyn":"English (Brooklynese)","ru":"Russian","fr":"French","th":"Thai","it":"Italian","he":"Hebrew","cs":"Czech","hi":"Hindi","en-us-hawaii":"English (US-Hawaii)","file_not_found":"The file you requested, ${0}, is not found.","en-au":"English (Australia)","el":"Greek","ko":"Korean","tr":"Turkish","en":"English","ja":"Japanese","zh-cn":"Chinese (Simplified)","dojo":"Dojo"}) \ No newline at end of file diff --git a/includes/js/dojo/tests/nls/el/salutations.js b/includes/js/dojo/tests/nls/el/salutations.js deleted file mode 100644 index 10d97c0..0000000 --- a/includes/js/dojo/tests/nls/el/salutations.js +++ /dev/null @@ -1 +0,0 @@ -({"hello":"Γειά","el":"Ελληνικά","yi":"Yiddish","en-us-texas":"English (Texas)","es":"Spanish","de":"German","pl":"Polish","hello_dojo":"${hello}, ${dojo}!","fa":"Farsi","pt":"Portugese","zh-tw":"Chinese (Traditional)","sw":"Kiswahili","ar":"Arabic","en-us-new_york-brooklyn":"English (Brooklynese)","ru":"Russian","fr":"French","th":"Thai","it":"Italian","he":"Hebrew","cs":"Czech","hi":"Hindi","en-us-hawaii":"English (US-Hawaii)","file_not_found":"The file you requested, ${0}, is not found.","en-au":"English (Australia)","ko":"Korean","tr":"Turkish","en":"English","ja":"Japanese","zh-cn":"Chinese (Simplified)","dojo":"Dojo"}) \ No newline at end of file diff --git a/includes/js/dojo/tests/nls/en-au/salutations.js b/includes/js/dojo/tests/nls/en-au/salutations.js deleted file mode 100644 index 314ab18..0000000 --- a/includes/js/dojo/tests/nls/en-au/salutations.js +++ /dev/null @@ -1 +0,0 @@ -({"hello":"G'day","yi":"Yiddish","en-us-texas":"English (Texas)","es":"Spanish","de":"German","pl":"Polish","hello_dojo":"${hello}, ${dojo}!","fa":"Farsi","pt":"Portugese","zh-tw":"Chinese (Traditional)","sw":"Kiswahili","ar":"Arabic","en-us-new_york-brooklyn":"English (Brooklynese)","ru":"Russian","fr":"French","th":"Thai","it":"Italian","he":"Hebrew","cs":"Czech","hi":"Hindi","en-us-hawaii":"English (US-Hawaii)","file_not_found":"The file you requested, ${0}, is not found.","en-au":"English (Australia)","el":"Greek","ko":"Korean","tr":"Turkish","en":"English","ja":"Japanese","zh-cn":"Chinese (Simplified)","dojo":"Dojo"}) \ No newline at end of file diff --git a/includes/js/dojo/tests/nls/en-us-hawaii/salutations.js b/includes/js/dojo/tests/nls/en-us-hawaii/salutations.js deleted file mode 100644 index dd35331..0000000 --- a/includes/js/dojo/tests/nls/en-us-hawaii/salutations.js +++ /dev/null @@ -1 +0,0 @@ -({"hello":"Aloha","yi":"Yiddish","en-us-texas":"English (Texas)","es":"Spanish","de":"German","pl":"Polish","hello_dojo":"${hello}, ${dojo}!","fa":"Farsi","pt":"Portugese","zh-tw":"Chinese (Traditional)","sw":"Kiswahili","ar":"Arabic","en-us-new_york-brooklyn":"English (Brooklynese)","ru":"Russian","fr":"French","th":"Thai","it":"Italian","he":"Hebrew","cs":"Czech","hi":"Hindi","en-us-hawaii":"English (US-Hawaii)","file_not_found":"The file you requested, ${0}, is not found.","en-au":"English (Australia)","el":"Greek","ko":"Korean","tr":"Turkish","en":"English","ja":"Japanese","zh-cn":"Chinese (Simplified)","dojo":"Dojo"}) \ No newline at end of file diff --git a/includes/js/dojo/tests/nls/en-us-new_york-brooklyn/salutations.js b/includes/js/dojo/tests/nls/en-us-new_york-brooklyn/salutations.js deleted file mode 100644 index 9deae14..0000000 --- a/includes/js/dojo/tests/nls/en-us-new_york-brooklyn/salutations.js +++ /dev/null @@ -1 +0,0 @@ -({"hello":"Yo","yi":"Yiddish","en-us-texas":"English (Texas)","es":"Spanish","de":"German","pl":"Polish","hello_dojo":"${hello}, ${dojo}!","fa":"Farsi","pt":"Portugese","zh-tw":"Chinese (Traditional)","sw":"Kiswahili","ar":"Arabic","en-us-new_york-brooklyn":"English (Brooklynese)","ru":"Russian","fr":"French","th":"Thai","it":"Italian","he":"Hebrew","cs":"Czech","hi":"Hindi","en-us-hawaii":"English (US-Hawaii)","file_not_found":"The file you requested, ${0}, is not found.","en-au":"English (Australia)","el":"Greek","ko":"Korean","tr":"Turkish","en":"English","ja":"Japanese","zh-cn":"Chinese (Simplified)","dojo":"Dojo"}) \ No newline at end of file diff --git a/includes/js/dojo/tests/nls/en-us-texas/salutations.js b/includes/js/dojo/tests/nls/en-us-texas/salutations.js deleted file mode 100644 index 410cde8..0000000 --- a/includes/js/dojo/tests/nls/en-us-texas/salutations.js +++ /dev/null @@ -1 +0,0 @@ -({"hello":"Howdy","yi":"Yiddish","en-us-texas":"English (Texas)","es":"Spanish","de":"German","pl":"Polish","hello_dojo":"${hello}, ${dojo}!","fa":"Farsi","pt":"Portugese","zh-tw":"Chinese (Traditional)","sw":"Kiswahili","ar":"Arabic","en-us-new_york-brooklyn":"English (Brooklynese)","ru":"Russian","fr":"French","th":"Thai","it":"Italian","he":"Hebrew","cs":"Czech","hi":"Hindi","en-us-hawaii":"English (US-Hawaii)","file_not_found":"The file you requested, ${0}, is not found.","en-au":"English (Australia)","el":"Greek","ko":"Korean","tr":"Turkish","en":"English","ja":"Japanese","zh-cn":"Chinese (Simplified)","dojo":"Dojo"}) \ No newline at end of file diff --git a/includes/js/dojo/tests/nls/es/salutations.js b/includes/js/dojo/tests/nls/es/salutations.js deleted file mode 100644 index c460414..0000000 --- a/includes/js/dojo/tests/nls/es/salutations.js +++ /dev/null @@ -1 +0,0 @@ -({"es":"Español","hello":"Hola","hello_dojo":"¡${hello}, ${dojo}!","yi":"Yiddish","en-us-texas":"English (Texas)","de":"German","pl":"Polish","fa":"Farsi","pt":"Portugese","zh-tw":"Chinese (Traditional)","sw":"Kiswahili","ar":"Arabic","en-us-new_york-brooklyn":"English (Brooklynese)","ru":"Russian","fr":"French","th":"Thai","it":"Italian","he":"Hebrew","cs":"Czech","hi":"Hindi","en-us-hawaii":"English (US-Hawaii)","file_not_found":"The file you requested, ${0}, is not found.","en-au":"English (Australia)","el":"Greek","ko":"Korean","tr":"Turkish","en":"English","ja":"Japanese","zh-cn":"Chinese (Simplified)","dojo":"Dojo"}) \ No newline at end of file diff --git a/includes/js/dojo/tests/nls/fa/salutations.js b/includes/js/dojo/tests/nls/fa/salutations.js deleted file mode 100644 index aaf73ee..0000000 --- a/includes/js/dojo/tests/nls/fa/salutations.js +++ /dev/null @@ -1 +0,0 @@ -({"hello":"درود","fa":"فارسی","yi":"Yiddish","en-us-texas":"English (Texas)","es":"Spanish","de":"German","pl":"Polish","hello_dojo":"${hello}, ${dojo}!","pt":"Portugese","zh-tw":"Chinese (Traditional)","sw":"Kiswahili","ar":"Arabic","en-us-new_york-brooklyn":"English (Brooklynese)","ru":"Russian","fr":"French","th":"Thai","it":"Italian","he":"Hebrew","cs":"Czech","hi":"Hindi","en-us-hawaii":"English (US-Hawaii)","file_not_found":"The file you requested, ${0}, is not found.","en-au":"English (Australia)","el":"Greek","ko":"Korean","tr":"Turkish","en":"English","ja":"Japanese","zh-cn":"Chinese (Simplified)","dojo":"Dojo"}) \ No newline at end of file diff --git a/includes/js/dojo/tests/nls/fr/salutations.js b/includes/js/dojo/tests/nls/fr/salutations.js deleted file mode 100644 index 9f81ca2..0000000 --- a/includes/js/dojo/tests/nls/fr/salutations.js +++ /dev/null @@ -1 +0,0 @@ -({"fr":"Français","hello":"Bonjour","yi":"Yiddish","en-us-texas":"English (Texas)","es":"Spanish","de":"German","pl":"Polish","hello_dojo":"${hello}, ${dojo}!","fa":"Farsi","pt":"Portugese","zh-tw":"Chinese (Traditional)","sw":"Kiswahili","ar":"Arabic","en-us-new_york-brooklyn":"English (Brooklynese)","ru":"Russian","th":"Thai","it":"Italian","he":"Hebrew","cs":"Czech","hi":"Hindi","en-us-hawaii":"English (US-Hawaii)","file_not_found":"The file you requested, ${0}, is not found.","en-au":"English (Australia)","el":"Greek","ko":"Korean","tr":"Turkish","en":"English","ja":"Japanese","zh-cn":"Chinese (Simplified)","dojo":"Dojo"}) \ No newline at end of file diff --git a/includes/js/dojo/tests/nls/he/salutations.js b/includes/js/dojo/tests/nls/he/salutations.js deleted file mode 100644 index 859fedc..0000000 --- a/includes/js/dojo/tests/nls/he/salutations.js +++ /dev/null @@ -1 +0,0 @@ -({"he":"עברית","hello":"שלום","yi":"Yiddish","en-us-texas":"English (Texas)","es":"Spanish","de":"German","pl":"Polish","hello_dojo":"${hello}, ${dojo}!","fa":"Farsi","pt":"Portugese","zh-tw":"Chinese (Traditional)","sw":"Kiswahili","ar":"Arabic","en-us-new_york-brooklyn":"English (Brooklynese)","ru":"Russian","fr":"French","th":"Thai","it":"Italian","cs":"Czech","hi":"Hindi","en-us-hawaii":"English (US-Hawaii)","file_not_found":"The file you requested, ${0}, is not found.","en-au":"English (Australia)","el":"Greek","ko":"Korean","tr":"Turkish","en":"English","ja":"Japanese","zh-cn":"Chinese (Simplified)","dojo":"Dojo"}) \ No newline at end of file diff --git a/includes/js/dojo/tests/nls/hi/salutations.js b/includes/js/dojo/tests/nls/hi/salutations.js deleted file mode 100644 index 12b23a8..0000000 --- a/includes/js/dojo/tests/nls/hi/salutations.js +++ /dev/null @@ -1 +0,0 @@ -({"hello":"नमस्ते","hi":"हिन्दी","yi":"Yiddish","en-us-texas":"English (Texas)","es":"Spanish","de":"German","pl":"Polish","hello_dojo":"${hello}, ${dojo}!","fa":"Farsi","pt":"Portugese","zh-tw":"Chinese (Traditional)","sw":"Kiswahili","ar":"Arabic","en-us-new_york-brooklyn":"English (Brooklynese)","ru":"Russian","fr":"French","th":"Thai","it":"Italian","he":"Hebrew","cs":"Czech","en-us-hawaii":"English (US-Hawaii)","file_not_found":"The file you requested, ${0}, is not found.","en-au":"English (Australia)","el":"Greek","ko":"Korean","tr":"Turkish","en":"English","ja":"Japanese","zh-cn":"Chinese (Simplified)","dojo":"Dojo"}) \ No newline at end of file diff --git a/includes/js/dojo/tests/nls/it/salutations.js b/includes/js/dojo/tests/nls/it/salutations.js deleted file mode 100644 index c3dd9cc..0000000 --- a/includes/js/dojo/tests/nls/it/salutations.js +++ /dev/null @@ -1 +0,0 @@ -({"it":"italiano","hello":"Ciao","yi":"Yiddish","en-us-texas":"English (Texas)","es":"Spanish","de":"German","pl":"Polish","hello_dojo":"${hello}, ${dojo}!","fa":"Farsi","pt":"Portugese","zh-tw":"Chinese (Traditional)","sw":"Kiswahili","ar":"Arabic","en-us-new_york-brooklyn":"English (Brooklynese)","ru":"Russian","fr":"French","th":"Thai","he":"Hebrew","cs":"Czech","hi":"Hindi","en-us-hawaii":"English (US-Hawaii)","file_not_found":"The file you requested, ${0}, is not found.","en-au":"English (Australia)","el":"Greek","ko":"Korean","tr":"Turkish","en":"English","ja":"Japanese","zh-cn":"Chinese (Simplified)","dojo":"Dojo"}) \ No newline at end of file diff --git a/includes/js/dojo/tests/nls/ja/salutations.js b/includes/js/dojo/tests/nls/ja/salutations.js deleted file mode 100644 index 5456efe..0000000 --- a/includes/js/dojo/tests/nls/ja/salutations.js +++ /dev/null @@ -1 +0,0 @@ -({"hello":"こにちは","ja":"日本語","yi":"Yiddish","en-us-texas":"English (Texas)","es":"Spanish","de":"German","pl":"Polish","hello_dojo":"${hello}, ${dojo}!","fa":"Farsi","pt":"Portugese","zh-tw":"Chinese (Traditional)","sw":"Kiswahili","ar":"Arabic","en-us-new_york-brooklyn":"English (Brooklynese)","ru":"Russian","fr":"French","th":"Thai","it":"Italian","he":"Hebrew","cs":"Czech","hi":"Hindi","en-us-hawaii":"English (US-Hawaii)","file_not_found":"The file you requested, ${0}, is not found.","en-au":"English (Australia)","el":"Greek","ko":"Korean","tr":"Turkish","en":"English","zh-cn":"Chinese (Simplified)","dojo":"Dojo"}) \ No newline at end of file diff --git a/includes/js/dojo/tests/nls/ko/salutations.js b/includes/js/dojo/tests/nls/ko/salutations.js deleted file mode 100644 index 4b43561..0000000 --- a/includes/js/dojo/tests/nls/ko/salutations.js +++ /dev/null @@ -1 +0,0 @@ -({"hello":"안녕","ko":"한국어","yi":"Yiddish","en-us-texas":"English (Texas)","es":"Spanish","de":"German","pl":"Polish","hello_dojo":"${hello}, ${dojo}!","fa":"Farsi","pt":"Portugese","zh-tw":"Chinese (Traditional)","sw":"Kiswahili","ar":"Arabic","en-us-new_york-brooklyn":"English (Brooklynese)","ru":"Russian","fr":"French","th":"Thai","it":"Italian","he":"Hebrew","cs":"Czech","hi":"Hindi","en-us-hawaii":"English (US-Hawaii)","file_not_found":"The file you requested, ${0}, is not found.","en-au":"English (Australia)","el":"Greek","tr":"Turkish","en":"English","ja":"Japanese","zh-cn":"Chinese (Simplified)","dojo":"Dojo"}) \ No newline at end of file diff --git a/includes/js/dojo/tests/nls/pl/salutations.js b/includes/js/dojo/tests/nls/pl/salutations.js deleted file mode 100644 index e4a9a2b..0000000 --- a/includes/js/dojo/tests/nls/pl/salutations.js +++ /dev/null @@ -1 +0,0 @@ -({"pl":"Polski","hello":"Dzièn dobry","yi":"Yiddish","en-us-texas":"English (Texas)","es":"Spanish","de":"German","hello_dojo":"${hello}, ${dojo}!","fa":"Farsi","pt":"Portugese","zh-tw":"Chinese (Traditional)","sw":"Kiswahili","ar":"Arabic","en-us-new_york-brooklyn":"English (Brooklynese)","ru":"Russian","fr":"French","th":"Thai","it":"Italian","he":"Hebrew","cs":"Czech","hi":"Hindi","en-us-hawaii":"English (US-Hawaii)","file_not_found":"The file you requested, ${0}, is not found.","en-au":"English (Australia)","el":"Greek","ko":"Korean","tr":"Turkish","en":"English","ja":"Japanese","zh-cn":"Chinese (Simplified)","dojo":"Dojo"}) \ No newline at end of file diff --git a/includes/js/dojo/tests/nls/pt/salutations.js b/includes/js/dojo/tests/nls/pt/salutations.js deleted file mode 100644 index 7bc14c0..0000000 --- a/includes/js/dojo/tests/nls/pt/salutations.js +++ /dev/null @@ -1 +0,0 @@ -({"hello":"Olá","pt":"Português","yi":"Yiddish","en-us-texas":"English (Texas)","es":"Spanish","de":"German","pl":"Polish","hello_dojo":"${hello}, ${dojo}!","fa":"Farsi","zh-tw":"Chinese (Traditional)","sw":"Kiswahili","ar":"Arabic","en-us-new_york-brooklyn":"English (Brooklynese)","ru":"Russian","fr":"French","th":"Thai","it":"Italian","he":"Hebrew","cs":"Czech","hi":"Hindi","en-us-hawaii":"English (US-Hawaii)","file_not_found":"The file you requested, ${0}, is not found.","en-au":"English (Australia)","el":"Greek","ko":"Korean","tr":"Turkish","en":"English","ja":"Japanese","zh-cn":"Chinese (Simplified)","dojo":"Dojo"}) \ No newline at end of file diff --git a/includes/js/dojo/tests/nls/ru/salutations.js b/includes/js/dojo/tests/nls/ru/salutations.js deleted file mode 100644 index 07e53e2..0000000 --- a/includes/js/dojo/tests/nls/ru/salutations.js +++ /dev/null @@ -1 +0,0 @@ -({"ru":"русский","hello":"Привет","yi":"Yiddish","en-us-texas":"English (Texas)","es":"Spanish","de":"German","pl":"Polish","hello_dojo":"${hello}, ${dojo}!","fa":"Farsi","pt":"Portugese","zh-tw":"Chinese (Traditional)","sw":"Kiswahili","ar":"Arabic","en-us-new_york-brooklyn":"English (Brooklynese)","fr":"French","th":"Thai","it":"Italian","he":"Hebrew","cs":"Czech","hi":"Hindi","en-us-hawaii":"English (US-Hawaii)","file_not_found":"The file you requested, ${0}, is not found.","en-au":"English (Australia)","el":"Greek","ko":"Korean","tr":"Turkish","en":"English","ja":"Japanese","zh-cn":"Chinese (Simplified)","dojo":"Dojo"}) \ No newline at end of file diff --git a/includes/js/dojo/tests/nls/salutations.js b/includes/js/dojo/tests/nls/salutations.js deleted file mode 100644 index 2ad7c40..0000000 --- a/includes/js/dojo/tests/nls/salutations.js +++ /dev/null @@ -1 +0,0 @@ -({"yi":"Yiddish","en-us-texas":"English (Texas)","es":"Spanish","de":"German","pl":"Polish","hello_dojo":"${hello}, ${dojo}!","fa":"Farsi","pt":"Portugese","zh-tw":"Chinese (Traditional)","sw":"Kiswahili","ar":"Arabic","en-us-new_york-brooklyn":"English (Brooklynese)","hello":"Hello","ru":"Russian","fr":"French","th":"Thai","it":"Italian","he":"Hebrew","cs":"Czech","hi":"Hindi","en-us-hawaii":"English (US-Hawaii)","file_not_found":"The file you requested, ${0}, is not found.","en-au":"English (Australia)","el":"Greek","ko":"Korean","tr":"Turkish","en":"English","ja":"Japanese","zh-cn":"Chinese (Simplified)","dojo":"Dojo"}) \ No newline at end of file diff --git a/includes/js/dojo/tests/nls/sw/salutations.js b/includes/js/dojo/tests/nls/sw/salutations.js deleted file mode 100644 index 5bde087..0000000 --- a/includes/js/dojo/tests/nls/sw/salutations.js +++ /dev/null @@ -1 +0,0 @@ -({"hello":"Hujambo","yi":"Yiddish","en-us-texas":"English (Texas)","es":"Spanish","de":"German","pl":"Polish","hello_dojo":"${hello}, ${dojo}!","fa":"Farsi","pt":"Portugese","zh-tw":"Chinese (Traditional)","sw":"Kiswahili","ar":"Arabic","en-us-new_york-brooklyn":"English (Brooklynese)","ru":"Russian","fr":"French","th":"Thai","it":"Italian","he":"Hebrew","cs":"Czech","hi":"Hindi","en-us-hawaii":"English (US-Hawaii)","file_not_found":"The file you requested, ${0}, is not found.","en-au":"English (Australia)","el":"Greek","ko":"Korean","tr":"Turkish","en":"English","ja":"Japanese","zh-cn":"Chinese (Simplified)","dojo":"Dojo"}) \ No newline at end of file diff --git a/includes/js/dojo/tests/nls/th/salutations.js b/includes/js/dojo/tests/nls/th/salutations.js deleted file mode 100644 index 48ff292..0000000 --- a/includes/js/dojo/tests/nls/th/salutations.js +++ /dev/null @@ -1 +0,0 @@ -({"th":"ქართული ენაქართული ენაქართული ენაสวัสดีครับ/คะ","hello":"ภาษาไทย","yi":"Yiddish","en-us-texas":"English (Texas)","es":"Spanish","de":"German","pl":"Polish","hello_dojo":"${hello}, ${dojo}!","fa":"Farsi","pt":"Portugese","zh-tw":"Chinese (Traditional)","sw":"Kiswahili","ar":"Arabic","en-us-new_york-brooklyn":"English (Brooklynese)","ru":"Russian","fr":"French","it":"Italian","he":"Hebrew","cs":"Czech","hi":"Hindi","en-us-hawaii":"English (US-Hawaii)","file_not_found":"The file you requested, ${0}, is not found.","en-au":"English (Australia)","el":"Greek","ko":"Korean","tr":"Turkish","en":"English","ja":"Japanese","zh-cn":"Chinese (Simplified)","dojo":"Dojo"}) \ No newline at end of file diff --git a/includes/js/dojo/tests/nls/tr/salutations.js b/includes/js/dojo/tests/nls/tr/salutations.js deleted file mode 100644 index 785fb02..0000000 --- a/includes/js/dojo/tests/nls/tr/salutations.js +++ /dev/null @@ -1 +0,0 @@ -({"tr":"Türkçe","hello":"Merhaba","yi":"Yiddish","en-us-texas":"English (Texas)","es":"Spanish","de":"German","pl":"Polish","hello_dojo":"${hello}, ${dojo}!","fa":"Farsi","pt":"Portugese","zh-tw":"Chinese (Traditional)","sw":"Kiswahili","ar":"Arabic","en-us-new_york-brooklyn":"English (Brooklynese)","ru":"Russian","fr":"French","th":"Thai","it":"Italian","he":"Hebrew","cs":"Czech","hi":"Hindi","en-us-hawaii":"English (US-Hawaii)","file_not_found":"The file you requested, ${0}, is not found.","en-au":"English (Australia)","el":"Greek","ko":"Korean","en":"English","ja":"Japanese","zh-cn":"Chinese (Simplified)","dojo":"Dojo"}) \ No newline at end of file diff --git a/includes/js/dojo/tests/nls/yi/salutations.js b/includes/js/dojo/tests/nls/yi/salutations.js deleted file mode 100644 index 76187d9..0000000 --- a/includes/js/dojo/tests/nls/yi/salutations.js +++ /dev/null @@ -1 +0,0 @@ -({"yi":"ייִדיש","hello":"אַ גוטן טאָג","en-us-texas":"English (Texas)","es":"Spanish","de":"German","pl":"Polish","hello_dojo":"${hello}, ${dojo}!","fa":"Farsi","pt":"Portugese","zh-tw":"Chinese (Traditional)","sw":"Kiswahili","ar":"Arabic","en-us-new_york-brooklyn":"English (Brooklynese)","ru":"Russian","fr":"French","th":"Thai","it":"Italian","he":"Hebrew","cs":"Czech","hi":"Hindi","en-us-hawaii":"English (US-Hawaii)","file_not_found":"The file you requested, ${0}, is not found.","en-au":"English (Australia)","el":"Greek","ko":"Korean","tr":"Turkish","en":"English","ja":"Japanese","zh-cn":"Chinese (Simplified)","dojo":"Dojo"}) \ No newline at end of file diff --git a/includes/js/dojo/tests/nls/zh-cn/salutations.js b/includes/js/dojo/tests/nls/zh-cn/salutations.js deleted file mode 100644 index cf7500d..0000000 --- a/includes/js/dojo/tests/nls/zh-cn/salutations.js +++ /dev/null @@ -1 +0,0 @@ -({"zh-cn":"汉语","hello":"你好","yi":"Yiddish","en-us-texas":"English (Texas)","es":"Spanish","de":"German","pl":"Polish","hello_dojo":"${hello}, ${dojo}!","fa":"Farsi","pt":"Portugese","zh-tw":"Chinese (Traditional)","sw":"Kiswahili","ar":"Arabic","en-us-new_york-brooklyn":"English (Brooklynese)","ru":"Russian","fr":"French","th":"Thai","it":"Italian","he":"Hebrew","cs":"Czech","hi":"Hindi","en-us-hawaii":"English (US-Hawaii)","file_not_found":"The file you requested, ${0}, is not found.","en-au":"English (Australia)","el":"Greek","ko":"Korean","tr":"Turkish","en":"English","ja":"Japanese","dojo":"Dojo"}) \ No newline at end of file diff --git a/includes/js/dojo/tests/nls/zh-tw/salutations.js b/includes/js/dojo/tests/nls/zh-tw/salutations.js deleted file mode 100644 index 1b2a6ad..0000000 --- a/includes/js/dojo/tests/nls/zh-tw/salutations.js +++ /dev/null @@ -1 +0,0 @@ -({"zh-tw":"漢語","hello":"你好","yi":"Yiddish","en-us-texas":"English (Texas)","es":"Spanish","de":"German","pl":"Polish","hello_dojo":"${hello}, ${dojo}!","fa":"Farsi","pt":"Portugese","sw":"Kiswahili","ar":"Arabic","en-us-new_york-brooklyn":"English (Brooklynese)","ru":"Russian","fr":"French","th":"Thai","it":"Italian","he":"Hebrew","cs":"Czech","hi":"Hindi","en-us-hawaii":"English (US-Hawaii)","file_not_found":"The file you requested, ${0}, is not found.","en-au":"English (Australia)","el":"Greek","ko":"Korean","tr":"Turkish","en":"English","ja":"Japanese","zh-cn":"Chinese (Simplified)","dojo":"Dojo"}) \ No newline at end of file diff --git a/includes/js/dojo/tests/number.js b/includes/js/dojo/tests/number.js deleted file mode 100644 index 902484a..0000000 --- a/includes/js/dojo/tests/number.js +++ /dev/null @@ -1,966 +0,0 @@ -if(!dojo._hasResource["tests.number"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests.number"] = true; -dojo.provide("tests.number"); - -dojo.require("dojo.number"); - -/** - * Refer to ICU4J's NumberFormatTest.expect(...) - */ -tests.number.check=function(t,options,sourceInput,expectResult){ - tests.number.checkFormatParseCycle(t, t,options,sourceInput,expectResult,false); - tests.number.checkParse(t, t,options,expectResult,sourceInput); -} - -/** - * Perform a single formatting check or a backward check - * backward check:number1 -(formatted)-> string1 -(parsed)-> number2 -(formated)-> string2 - * then number should == number2; string1 should == string2 - */ -tests.number.checkFormatParseCycle=function(t,options,sourceInput,expectResult, - backwardCheck/*boolean,indicates whether need a backward chain check,like formate->parse->format*/){ - if(null != options){ - var pattern = options.pattern; - var locale = options.locale; - //TODO: add more fields - } - - //print("\n"); - var str = null==pattern?"default":pattern; - //print("pattern:" + str + "| locale:" + locale); - //print("input:" + sourceInput); - var result = dojo.number.format(sourceInput,options); - //print("result:" + result); - if(null != expectResult){ - t.is(expectResult,result); - } - if(backwardCheck){ - var resultParsed = dojo.number.parse(result,options); - //print("resultParsed:" + resultParsed); - if(!tests.number._decimalNumberDiff(sourceInput,resultParsed)){ - t.is(sourceInput,resultParsed); - } - var resultParsedReformatted = dojo.number.format(resultParsed,options); - //print("resultParsedReformatted:" + resultParsedReformatted); - if(!tests.number._decimalNumberDiff(result,resultParsedReformatted)){ - t.is(result,resultParsedReformatted); - } - } -} - -/** - * Perform a single parsing check - */ -tests.number.checkParse=function(t,options,sourceInput,expectResult){ - var str = "default"; - if(null != options && null != options.pattern){ - str = options.pattern; - } - //print("input:" + sourceInput); - var result = dojo.number.parse(sourceInput,options); - //print("result :" + result); - if(null != expectResult){ - t.is(expectResult,result); - } -} - -/** - * //TODO:Round a given number - */ -tests.number.rounding = function(t,number,maxFractionDigits,expected){ - var pattern="#0."; - for(var i=0; i 12,34,56,789 - //step2:12,34,56,789 parsed=> 123456789 => formated => 12,34,56,789 - tests.number.checkFormatParseCycle(t, options,sourceInput,expectResult,true); - - //TODO: sencondary grouping not implemented yet ? - //Pattern "#,###" and secondaryGroupingSize=4 should format 123456789 to "12,3456,789" - - //Special case for "en-in" locale - //1876543210 should be formated as 1,87,65,43,210 in "en-in" (India) -/* - sourceInput = 1876543210; - expectResult = "1,87,65,43,210"; - var result = dojo.number.format(sourceInput,{locale:"en-in"}); - t.is(expectResult,result); -*/ - //print("test_number_format_Grouping() end..............\n"); - } - }, - { - name: "format_pad", - runTest: function(t){ -/** - * TODO:!!Failed cases: - * According to ICU4J test criteria: - * 1.with pattern "*^##.##": - * 0 should be formatted to "^^^^0",but got "*^0" instead, - * -1.3 should be formatted to "^-1.3",but got "-*^1.3" instead. - * - * 2.with pattern "##0.0####*_ 'g-m/s^2'" : - * 0 should be formatted to "0.0______ g-m/s^2",but got ":0.0*_ 'g-m/s^2'" instead - * 1.0/3 should be formatted to "0.33333__ g-m/s^2",but got "0.33333*_ 'g-m/s^2'" instead - * - * 3.with pattern "*x#,###,###,##0.0#;*x(###,###,##0.0#)": - * -10 should be formatted to "xxxxxxxxxx(10.0)",but got "*x(10.0)" instead. - * 10 should be formatted to "xxxxxxxxxxxx10.0",but got "*x10.0" instead. - * ...... - * -1120456.37 should be formatted to "xx(1,120,456.37)",but got "*x(1,120,456.37)" instead. - * 1120456.37 should be formatted to "xxxx1,120,456.37",but got "*x1,120,456.37" instead. - * -1252045600.37 should be formatted to "(1,252,045,600.37)",but got "*x(1,252,045,600.37)" instead. - * 1252045600.37 should be formatted to "10,252,045,600.37",but got "*x10,252,045,600.37" instead. - * - * 4.with pattern "#,###,###,##0.0#*x;(###,###,##0.0#*x)" - * -10 should be formatted to (10.0xxxxxxxxxx),but got "(10.0*x)" instead. - * 10 should be formatted to "10.0xxxxxxxxxxxx",but got "10.0*x" instead. - * ...... - * -1120456.37 should be formatted to "(1,120,456.37xx)",but got "(1,120,456.37*x)" instead. - * 1120456.37 should be formatted to "xxxx1,120,456.37",but got "1,120,456.37*x" instead. - * -1252045600.37 should be formatted to "(1,252,045,600.37)",but got "(1,252,045,600.37*x)" instead. - * 1252045600.37 should be formatted to ""10,252,045,600.37"",but got "10,252,045,600.37*x" instead.* - * - * Refer to ICU4J's NumberFormatTest.TestPad() - */ -/* -function test_number_format_pad(){ - var locale = "en-us"; - print("test_number_format_Pad() start.............."); - var options = {pattern:"*^##.##",locale:locale}; - - tests.number.check(t, options,0,"^^^^0"); - tests.number.check(t, options,-1.3,"^-1.3"); - - - options = {pattern:"##0.0####*_ 'g-m/s^2'",locale:locale}; - tests.number.check(t, options,0,"0.0______ g-m/s^2"); - tests.number.checkFormatParseCycle(t, options,1.0/3,"0.33333__ g-m/s^2",true); - - //exponent not implemented - //options = {pattern:"##0.0####E0*_ 'g-m/s^2'",locale:locale}; - //tests.number.check(t, options,0,"0.0E0______ g-m/s^2"); - //tests.number.checkFormatParseCycle(t, options,1.0/3,"333.333E-3_ g-m/s^2",true); - - // Test padding before a sign - options = {pattern:"*x#,###,###,##0.0#;*x(###,###,##0.0#)",locale:locale}; - - tests.number.check(t, options,-10,"xxxxxxxxxx(10.0)"); - tests.number.check(t, options,-1000, "xxxxxxx(1,000.0)"); - tests.number.check(t, options,-1000000, "xxx(1,000,000.0)"); - tests.number.check(t, options,-100.37, "xxxxxxxx(100.37)"); - tests.number.check(t, options,-10456.37, "xxxxx(10,456.37)"); - tests.number.check(t, options,-1120456.37, "xx(1,120,456.37)"); - tests.number.check(t, options,-112045600.37, "(112,045,600.37)"); - tests.number.check(t, options,-1252045600.37, "(1,252,045,600.37)"); - - - tests.number.check(t, options,10, "xxxxxxxxxxxx10.0"); - tests.number.check(t, options,1000, "xxxxxxxxx1,000.0"); - tests.number.check(t, options,1000000, "xxxxx1,000,000.0"); - tests.number.check(t, options,100.37, "xxxxxxxxxx100.37"); - tests.number.check(t, options,10456.37, "xxxxxxx10,456.37"); - tests.number.check(t, options,1120456.37, "xxxx1,120,456.37"); - tests.number.check(t, options,112045600.37, "xx112,045,600.37"); - tests.number.check(t, options,10252045600.37, "10,252,045,600.37"); - - // Test padding between a sign and a number - options = {pattern:"#,###,###,##0.0#*x;(###,###,##0.0#*x)",locale:locale}; - tests.number.check(t, options, -10, "(10.0xxxxxxxxxx)"); - tests.number.check(t, options, -1000, "(1,000.0xxxxxxx)"); - tests.number.check(t, options, -1000000, "(1,000,000.0xxx)"); - tests.number.check(t, options, -100.37, "(100.37xxxxxxxx)"); - tests.number.check(t, options, -10456.37, "(10,456.37xxxxx)"); - tests.number.check(t, options, -1120456.37, "(1,120,456.37xx)"); - tests.number.check(t, options, -112045600.37, "(112,045,600.37)"); - tests.number.check(t, options, -1252045600.37, "(1,252,045,600.37)"); - - tests.number.check(t, options, 10, "10.0xxxxxxxxxxxx"); - tests.number.check(t, options, 1000, "1,000.0xxxxxxxxx"); - tests.number.check(t, options, 1000000, "1,000,000.0xxxxx"); - tests.number.check(t, options, 100.37, "100.37xxxxxxxxxx"); - tests.number.check(t, options, 10456.37, "10,456.37xxxxxxx"); - tests.number.check(t, options, 1120456.37, "1,120,456.37xxxx"); - tests.number.check(t, options, 112045600.37, "112,045,600.37xx"); - tests.number.check(t, options, 10252045600.37, "10,252,045,600.37"); - - //Not implemented yet,refer to NumberFormatTest.TestPatterns2() - //For future use - maily test pad patterns - print("test_number_format_Pad() end.............."); -} -*/ - } - }, - { - name: "parse_icu4j3_6", - runTest: function(t){ -/** - * In ICU4J, testing logic for NumberFormat.parse() is seperated into - * differernt single tese cases. So part of these logic are - * collected together in this test case. * - */ - //print("test_number_parse_icu4j3_6() start.............."); - //Refer to ICU4J's NumberFormatTest.TestParse() which is only a rudimentary version - var pattern = "00"; - var str = "0.0"; - var result = dojo.number.parse(str,{pattern:pattern}); - //TODO: add more locales -//FIXME: is this a valid test? -// t.is(0,result); - - /**************************************** tolerant parse ***************************************** - * refers to ICU4J's NumberFormatTest.TestStrictParse()?? - * TODO: Seems dojo.number parses string in a tolerant way. - */ - var options = {locale:"en-us"}; - /* - * TODO: !!Failed case,Should all pass, - * but the following elements failed (all parsed to NaN): - * [1]-"0 ",[2]-"0.",[3]-"0,",[5]-"0. ",[6]-"0.100,5", - * [7]-".00",[9]-"12345, ",[10]-"1,234, ",[12]-"0E" - */ - var passData = ([ - "0", //[0] single zero before end of text is not leading - //"0 ", //[1] single zero at end of number is not leading - //"0.", //[2] single zero before period (or decimal, it's ambiguous) is not leading - //"0,", //[3] single zero before comma (not group separator) is not leading - "0.0", //[4] single zero before decimal followed by digit is not leading - //"0. ", //[5] same as above before period (or decimal) is not leading - //"0.100,5", //[6] comma stops parse of decimal (no grouping) - //".00", //[7] leading decimal is ok, even with zeros - "1234567", //[8] group separators are not required - //"12345, ", //[9] comma not followed by digit is not a group separator, but end of number - //"1,234, ", //[10] if group separator is present, group sizes must be appropriate - "1,234,567" //[11] ...secondary too - //,"0E" //[12]not implemented yet,an exponnent not followed by zero or digits is not an exponent - ]); - runBatchParse(options,passData,true/*tolerant parse*/); - - /* - * TODO:!!Failed case,should all pass, - * but the following failed, - * [10]-"1,45 that" implies that we partially parse input - */ - var failData = ([ - "00", //[0] leading zero before zero - "012", //[1] leading zero before digit - "0,456", //[2] leading zero before group separator - "1,2", //[3] wrong number of digits after group separator - ",0", //[4] leading group separator before zero - ",1", //[5] leading group separator before digit - ",.02", //[6] leading group separator before decimal - "1,.02", //[7] group separator before decimal - "1,,200", //[8] multiple group separators - "1,45", //[9] wrong number of digits in primary group - //"1,45 that", //[10] wrong number of digits in primary group - "1,45.34", //[11] wrong number of digits in primary group - "1234,567", //[12] wrong number of digits in secondary group - "12,34,567", //[13] wrong number of digits in secondary group - "1,23,456,7890" //[14] wrong number of digits in primary and secondary groups - ]); - runBatchParse(options,failData,false); - - options = {pattern:"#,##,##0.#",locale:"en-us"}; - /* - * TODO:!!Failed case,shoudl all pass. - - * but [1] [2] and [3] failed - * should be parsed to 1234567,but NaN instead - */ - var mixedPassData = ([ - "12,34,567" //[0] - //,"12,34,567," //[1] - //"12,34,567, that",//[2] - //"12,34,567 that" //[3] - ]); - runBatchParse(options,mixedPassData,true/*tolerant parse*/); - - /* - * TODO:!!Failed case,should all pass, - * but actually mixedFailData[2] and mixedFailData[3] passed. - * "12,34,56, that " and [3]-"12,34,56 that" should be parsed to 123456,but NaN instead - */ - var mixedFailData = ([ - "12,34,56", //[0] - "12,34,56," //[1] - //,"12,34,56, that ",//[2] - //"12,34,56 that", //[3] - ]); - runBatchParse(options,mixedFailData,false); - - - /**************************************** strict parse ****************************************** - * TODO:May need to test strict parsing in the future? - * e.g. A strict parsing like (with pattern "#,##0.#") - * 1.Leading zeros - * '00', '0123' fail the parse, but '0' and '0.001' pass - * 2.Leading or doubled grouping separators - * ',123' and '1,,234" fail - * 3.Groups of incorrect length when grouping is used - * '1,23' and '1234,567' fail, but '1234' passes - * 4.Grouping separators used in numbers followed by exponents - * '1,234E5' fails, but '1234E5' and '1,234E' pass - */ - //options={locale:"en",strict:true}; - //runBatchParse(options,passData,false/*strict parse*/); - //runBatchParse(options,failData,false/*strict parse*/); - - //options = {pattern:"#,##,##0.#",locale:"en-us",strict:true}; - //runBatchParse(options,mixedPassData,false/*strict parse*/); - //runBatchParse(options,mixedFailData,false/*strict parse*/); - - //print("test_number_parse_icu4j3_6() end..............\n"); - } - }, - { - name: "parse_whitespace", - runTest: function(t){ -/** - * TODO:!!Failed case - * With pattern "a b#0c ",both "a b3456c " and and "a b1234c " should be parsed to 3456,but got NaN instead. - * - * Refer to ICU4J's NumberFormatTest.TestWhiteSpaceParsing - */ - /* - print("test_number_parse_WhiteSpace() start.............."); - var pattern = "a b#0c "; - var expectResult = 3456; - result = dojo.number.parse("a b3456c ",{pattern:pattern,locale:"en-us"}); - t.is(expectResult,result); - result = dojo.number.parse("a b3456c ",{pattern:pattern,locale:"en-us"}); - t.is(expectResult,result); - print("test_number_parse_WhiteSpace() end..............\n"); - */ - } - }, -/************************************************************************************************* - * Regression test cases - * These test cases are referred to ICU4J's NumberFormatRegressionTest and NumberFormatRegression. - * The regression cases in ICU4J are used as unit test cases for bug fixing, - * They are inluced here so that dojo.number may avoid those similar bugs. - *************************************************************************************************/ - { - name: "number_regression_1", - runTest: function(t){ -/** - * Refer to ICU4J's NumberFormatRegressionTest.Test4161100() - */ - tests.number.checkFormatParseCycle(t, {pattern:"#0.#"},-0.09,"-0.1",false); - } - }, - { - name: "number_regression_2", - runTest: function(t){ -/** - * !!Failed case,rounding hasn't been implemented yet. - * Refer to ICU4J's NumberFormatRegressionTest.Test4408066() - */ - /* - var data = ([-3.75, -2.5, -1.5, - -1.25, 0, 1.0, - 1.25, 1.5, 2.5, - 3.75, 10.0, 255.5]); - var expected = (["-4", "-2", "-2", - "-1", "0", "1", - "1", "2", "2", - "4", "10", "256"]); - var options = {locale:"zh-cn",round:true}; - for(var i =0; i < data.length; i++){ - tests.number.checkFormatParseCycle(t, options,data[i],expected[i],false); - } - - data = ([ "-3.75", "-2.5", "-1.5", - "-1.25", "0", "1.0", - "1.25", "1.5", "2.5", - "3.75", "10.0", "255.5"]); - expected =([ -3, -2, -1, - -1, 0, 1, - 1, 1, 2, - 3, 10, 255]); - - for(var i =0; i < data.length; i++){ - tests.number.checkParse(t, options,data[i],expected[i]); - } - */ - } - }, - { - name: "number_regression_3", - runTest: function(t){ -/** - * Refer to ICU4J's NumberRegression.Test4087535() and Test4243108() - */ - tests.number.checkFormatParseCycle(t, {places:0},0,"0",false); - //TODO:in icu4j,0.1 should be formatted to ".1" when minimumIntegerDigits=0 - tests.number.checkFormatParseCycle(t, {places:0},0.1,"0",false); - tests.number.checkParse(t, {pattern:"#0.#####"},123.55456,123.55456); -//!! fails because default pattern only has 3 decimal places -// tests.number.checkParse(t, null,123.55456,123.55456); - - //See whether it fails first format 0.0 ,parse "99.99",and then reformat 0.0 - tests.number.checkFormatParseCycle(t, {pattern:"#.#"},0.0,"0",false); - tests.number.checkParse(t, null,"99.99",99.99); - tests.number.checkFormatParseCycle(t, {pattern:"#.#"},0.0,"0",false); - } - }, - { - name: "number_regression_4", - runTest: function(t){ -/** - * TODO: - * In ICU -0.0 and -0.0001 should be formatted to "-0" with FieldPosition(0) - * dojo.i18n.number format -0.0 to "-0"; -0.0001 to "-0.000100" - * - * Refer to ICU4J's NumberRegression.Test4088503() and Test4106658() - */ - tests.number.checkFormatParseCycle(t, {places:0},123,"123",false); - - //TODO: differernt from ICU where -0.0 is formatted to "-0" - tests.number.checkFormatParseCycle(t, {locale:"en-us"},-0.0,"0",false); - - //TODO: differernt from ICU where -0.0001 is formatted to "-0" - tests.number.checkFormatParseCycle(t, {locale:"en-us",places:6},-0.0001,"-0.000100",false); - } - }, - { - name: "number_regression_5", - runTest: function(t){ -/** - * !!Failed case,rounding has not implemented yet. - * 0.00159999 should be formatted as 0.0016 but got 0.0015 instead. - * Refer to ICU4J's NumberRegression.Test4071492() - */ - //tests.number.checkFormatParseCycle(t, {places:4,round:true},0.00159999,"0.0016",false); - } - }, - { - name: "number_regression_6", - runTest: function(t){ -/** - * Refer to ICU4J's NumberRegression.Test4086575() - */ - var pattern = "###.00;(###.00)"; - var locale = "fr"; - var options = {pattern:pattern,locale:locale}; - - //no group separator - tests.number.checkFormatParseCycle(t, options,1234,"1234,00",false); - tests.number.checkFormatParseCycle(t, options,-1234,"(1234,00)",false); - - //space as group separator - pattern = "#,###.00;(#,###.00)"; - options = {pattern:pattern,locale:locale}; - tests.number.checkFormatParseCycle(t, options,1234,"1\u00a0234,00",false);// Expect 1 234,00 - tests.number.checkFormatParseCycle(t, options,-1234,"(1\u00a0234,00)",false); // Expect (1 234,00) - } - }, - { - name: "number_regression_7", - runTest: function(t){ -/** - * !!Failed case - expontent has not implemented yet - * shuold format 1.000000000000001E7 to 10000000.00000001, but got 10,000,000.000 instead - * Refer to ICU4J's NumberRegression.Test4090489() - loses precision - */ - //tests.number.checkFormatParseCycle(t, null,1.000000000000001E7,"10000000.00000001",false); - } - }, - { - name: "number_regression_8", - runTest: function(t){ -/** - * !!Failed case - * 1.with pattern "#,#00.00 p''ieces;-#,#00.00 p''ieces" - * 3456.78 should be formated to "3,456.78 p'ieces", - * but got "3,456.78 p''ieces","''" should be replaced with "'" - * 2.with illegal pattern "000.0#0" - * no error for the illegal pattern, and 3456.78 is formatted to 456.780 - * 3.with illegal pattern "0#0.000" - * no error for the illegal pattern, and 3456.78 is formatted to 3456.780 - * - * Refer to ICU4J's NumberRegression.Test4092480(),Test4074454() - */ - var patterns = (["#0000","#000","#00","#0","#"]); - var expect = (["0042","042","42","42","42"]); - - for(var i =0; i < patterns.length; i ++){ - tests.number.checkFormatParseCycle(t, {pattern:patterns[i]},42,expect[i],false); - tests.number.checkFormatParseCycle(t, {pattern:patterns[i]},-42,"-"+expect[i],false); - } - - tests.number.checkFormatParseCycle(t, {pattern:"#,#00.00;-#.#"},3456.78,"3,456.78",false); - //!!Failed case - //tests.number.checkFormatParseCycle(t, {pattern:"#,#00.00 p''ieces;-#,#00.00 p''ieces"},3456.78,"3,456.78 p'ieces",false); - //tests.number.checkFormatParseCycle(t, {pattern:"000.0#0"},3456.78,null,false); - //tests.number.checkFormatParseCycle(t, {pattern:"0#0.000"},3456.78,null,false); - } - }, - { - name: "number_regression_9", - runTest: function(t){ -/** - * TODO - * Refer to ICU4J's NumberRegression.Test4052223() - */ - //TODO:only got NaN,need an illegal pattern exception? - tests.number.checkParse(t, {pattern:"#,#00.00"},"abc3"); - - //TODO: got NaN instead of 1.222, is it ok? - //tests.number.checkParse(t, {pattern:"#,##0.###",locale:"en-us"},"1.222,111",1.222); - //tests.number.checkParse(t, {pattern:"#,##0.###",locale:"en-us"},"1.222x111",1.222); - - //got NaN for illeal input,ok - tests.number.checkParse(t, null,"hello: ,.#$@^&**10x"); - } - }, - { - name: "number_regression_10", - runTest: function(t){ -/** - * Refer to ICU4J's NumberRegression.Test4125885() - */ - tests.number.checkFormatParseCycle(t, {pattern:"000.00"},12.34,"012.34",false); - tests.number.checkFormatParseCycle(t, {pattern:"+000.00%;-000.00%"},0.1234,"+012.34%",false); - tests.number.checkFormatParseCycle(t, {pattern:"##,###,###.00"},9.02,"9.02",false); - - var patterns =(["#.00", "0.00", "00.00", "#0.0#", "#0.00"]); - var expect = (["1.20", "1.20", "01.20", "1.2", "1.20" ]); - for(var i =0 ; i < patterns.length; i ++){ - tests.number.checkFormatParseCycle(t, {pattern:patterns[i]},1.2,expect[i],false); - } - } - }, - { - name: "number_regression_11", - runTest: function(t){ -/** - * TODO:!!Failed case - * Make sure that all special characters, when quoted in a suffix or prefix, lose their special meaning. - * The detail error info : - * for input 123 - * pattern:'0'#0'0'; expect:"01230"; but got "'3'#0'0'" instead - * pattern:','#0','; expect:",123,"; but got "','123','" instead - * pattern:'.'#0'.'; expect:".123."; but got "'.'123'.'" instead - * pattern:'‰'#0'‰'; expect:"‰123‰"; but got "'‰'123000'‰'" instead - * pattern:'%'#0'%'; expect:"%123%"; but got "'%'12300'%'" instead - * pattern:'#'#0'#'; expect:"#123#"; but got "'123'#0'#'" instead - * pattern:';'#0';'; expect:";123;"; but got "[dojo-test] FATAL exception raised: - * unable to find a number expression in pattern: '" - * pattern:'E'#0'E'; expect:"E123E"; not implemeted yet - * pattern:'*'#0'*'; expect:"*123*"; but got "'*'123'*'" instead - * pattern:'+'#0'+'; expect:"+123+"; but got "'+'123'+'" instead - * pattern:'-'#0'-'; expect:"-123-"; but got "'-'123'-'" instead - * - * TODO: is it ok to remain "'" in the formatted result as above?? - * - * Refer to ICU4J's NumberRegression.Test4212072() - */ -/* - var specials = ([ '0', ',', '.', '\u2030', '%', '#',';', 'E', '*', '+', '-']); - var pattern; - var expect; - - for(var i=0; i < specials.length; i ++){ - pattern = "'" + specials[i] + "'#0'" + specials[i] + "'"; - expect = "" + specials[i] + "123" + specials[i]; - tests.number.checkFormatParseCycle(t, {pattern:pattern,locale:"en-us"},123,expect,false); - } -*/ - } - }, - { - name: "number_regression_12", - runTest: function(t){ -/** - * TODO: add more rounding test cases, refer to ICU4J's NumberRegression.Test4071005(),Test4071014() etc.. - */ - -/** - * TODO:Decimal format doesnt round a double properly when the number is less than 1 - * - * Refer to ICU4J's NumberRegression.test4241880() - */ -/* - var input = ([ .019, .009, .015, .016, .014, - .004, .005, .006, .007, .008, - .5, 1.5, .05, .15, .005, - .015, .0005, .0015]); - var patterns = (["##0%", "##0%", "##0%", "##0%", "##0%", - "##0%", "##0%", "##0%", "##0%", "##0%", - "#,##0", "#,##0", "#,##0.0", "#,##0.0", "#,##0.00", - "#,##0.00", "#,##0.000", "#,##0.000"]); - var expect =([ "2%", "1%", "2%", "2%", "1%", - "0%", "0%", "1%", "1%", "1%", - "0", "2", "0.0", "0.2", "0.00", - "0.02", "0.000", "0.002",]); - for(var i = 0; i - - Parser Unit Test - - - - - -

Parser Unit Test

- -
- - - - -
-
-
-
-
-
-
-
-
- - - - diff --git a/includes/js/dojo/tests/parser.js b/includes/js/dojo/tests/parser.js deleted file mode 100644 index 3f5028a..0000000 --- a/includes/js/dojo/tests/parser.js +++ /dev/null @@ -1,8 +0,0 @@ -if(!dojo._hasResource["tests.parser"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests.parser"] = true; -dojo.provide("tests.parser"); -if(dojo.isBrowser){ - doh.registerUrl("tests.parser", dojo.moduleUrl("tests", "parser.html")); -} - -} diff --git a/includes/js/dojo/tests/resources/ApplicationState.js b/includes/js/dojo/tests/resources/ApplicationState.js deleted file mode 100644 index a25e7ff..0000000 --- a/includes/js/dojo/tests/resources/ApplicationState.js +++ /dev/null @@ -1,28 +0,0 @@ -/* -ApplicationState is an object that represents the application state. -It will be given to dojo.undo.browser to represent the current application state. -*/ -ApplicationState = function(stateData, outputDivId, backForwardOutputDivId, bookmarkValue){ - this.stateData = stateData; - this.outputDivId = outputDivId; - this.backForwardOutputDivId = backForwardOutputDivId; - this.changeUrl = bookmarkValue; -} - -ApplicationState.prototype.back = function(){ - this.showBackForwardMessage("BACK for State Data: " + this.stateData); - this.showStateData(); -} - -ApplicationState.prototype.forward = function(){ - this.showBackForwardMessage("FORWARD for State Data: " + this.stateData); - this.showStateData(); -} - -ApplicationState.prototype.showStateData = function(){ - dojo.byId(this.outputDivId).innerHTML += this.stateData + '
'; -} - -ApplicationState.prototype.showBackForwardMessage = function(message){ - dojo.byId(this.backForwardOutputDivId).innerHTML += message + '
'; -} diff --git a/includes/js/dojo/tests/resources/JSON.php b/includes/js/dojo/tests/resources/JSON.php deleted file mode 100644 index e87e4d0..0000000 --- a/includes/js/dojo/tests/resources/JSON.php +++ /dev/null @@ -1,724 +0,0 @@ - - * @author Matt Knapp - * @author Brett Stimmerman - * @copyright 2005 Michal Migurski - * @license http://www.opensource.org/licenses/bsd-license.php - * @link http://pear.php.net/pepr/pepr-proposal-show.php?id=198 - */ - -/** - * Marker constant for Services_JSON::decode(), used to flag stack state - */ -define('SERVICES_JSON_SLICE', 1); - -/** - * Marker constant for Services_JSON::decode(), used to flag stack state - */ -define('SERVICES_JSON_IN_STR', 2); - -/** - * Marker constant for Services_JSON::decode(), used to flag stack state - */ -define('SERVICES_JSON_IN_ARR', 4); - -/** - * Marker constant for Services_JSON::decode(), used to flag stack state - */ -define('SERVICES_JSON_IN_OBJ', 8); - -/** - * Marker constant for Services_JSON::decode(), used to flag stack state - */ -define('SERVICES_JSON_IN_CMT', 16); - -/** - * Behavior switch for Services_JSON::decode() - */ -define('SERVICES_JSON_LOOSE_TYPE', 10); - -/** - * Behavior switch for Services_JSON::decode() - */ -define('SERVICES_JSON_STRICT_TYPE', 11); - -/** - * Converts to and from JSON format. - * - * Brief example of use: - * - * - * // create a new instance of Services_JSON - * $json = new Services_JSON(); - * - * // convert a complexe value to JSON notation, and send it to the browser - * $value = array('foo', 'bar', array(1, 2, 'baz'), array(3, array(4))); - * $output = $json->encode($value); - * - * print($output); - * // prints: ["foo","bar",[1,2,"baz"],[3,[4]]] - * - * // accept incoming POST data, assumed to be in JSON notation - * $input = file_get_contents('php://input', 1000000); - * $value = $json->decode($input); - * - */ -class Services_JSON -{ - /** - * constructs a new JSON instance - * - * @param int $use object behavior: when encoding or decoding, - * be loose or strict about object/array usage - * - * possible values: - * - SERVICES_JSON_STRICT_TYPE: strict typing, default. - * "{...}" syntax creates objects in decode(). - * - SERVICES_JSON_LOOSE_TYPE: loose typing. - * "{...}" syntax creates associative arrays in decode(). - */ - function Services_JSON($use = SERVICES_JSON_STRICT_TYPE) - { - $this->use = $use; - } - - /** - * convert a string from one UTF-16 char to one UTF-8 char - * - * Normally should be handled by mb_convert_encoding, but - * provides a slower PHP-only method for installations - * that lack the multibye string extension. - * - * @param string $utf16 UTF-16 character - * @return string UTF-8 character - * @access private - */ - function utf162utf8($utf16) - { - // oh please oh please oh please oh please oh please - if(function_exists('mb_convert_encoding')) - return mb_convert_encoding($utf16, 'UTF-8', 'UTF-16'); - - $bytes = (ord($utf16{0}) << 8) | ord($utf16{1}); - - switch(true) { - case ((0x7F & $bytes) == $bytes): - // this case should never be reached, because we are in ASCII range - // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - return chr(0x7F & $bytes); - - case (0x07FF & $bytes) == $bytes: - // return a 2-byte UTF-8 character - // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - return chr(0xC0 | (($bytes >> 6) & 0x1F)) - . chr(0x80 | ($bytes & 0x3F)); - - case (0xFFFF & $bytes) == $bytes: - // return a 3-byte UTF-8 character - // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - return chr(0xE0 | (($bytes >> 12) & 0x0F)) - . chr(0x80 | (($bytes >> 6) & 0x3F)) - . chr(0x80 | ($bytes & 0x3F)); - } - - // ignoring UTF-32 for now, sorry - return ''; - } - - /** - * convert a string from one UTF-8 char to one UTF-16 char - * - * Normally should be handled by mb_convert_encoding, but - * provides a slower PHP-only method for installations - * that lack the multibye string extension. - * - * @param string $utf8 UTF-8 character - * @return string UTF-16 character - * @access private - */ - function utf82utf16($utf8) - { - // oh please oh please oh please oh please oh please - if(function_exists('mb_convert_encoding')) - return mb_convert_encoding($utf8, 'UTF-16', 'UTF-8'); - - switch(strlen($utf8)) { - case 1: - // this case should never be reached, because we are in ASCII range - // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - return $utf8; - - case 2: - // return a UTF-16 character from a 2-byte UTF-8 char - // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - return chr(0x07 & (ord($utf8{0}) >> 2)) - . chr((0xC0 & (ord($utf8{0}) << 6)) - | (0x3F & ord($utf8{1}))); - - case 3: - // return a UTF-16 character from a 3-byte UTF-8 char - // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - return chr((0xF0 & (ord($utf8{0}) << 4)) - | (0x0F & (ord($utf8{1}) >> 2))) - . chr((0xC0 & (ord($utf8{1}) << 6)) - | (0x7F & ord($utf8{2}))); - } - - // ignoring UTF-32 for now, sorry - return ''; - } - - /** - * encodes an arbitrary variable into JSON format - * - * @param mixed $var any number, boolean, string, array, or object to be encoded. - * see argument 1 to Services_JSON() above for array-parsing behavior. - * if var is a strng, note that encode() always expects it - * to be in ASCII or UTF-8 format! - * - * @return string JSON string representation of input var - * @access public - */ - function encode($var) - { - switch (gettype($var)) { - case 'boolean': - return $var ? 'true' : 'false'; - - case 'NULL': - return 'null'; - - case 'integer': - return (int) $var; - - case 'double': - case 'float': - return (float) $var; - - case 'string': - // STRINGS ARE EXPECTED TO BE IN ASCII OR UTF-8 FORMAT - $ascii = ''; - $strlen_var = strlen($var); - - /* - * Iterate over every character in the string, - * escaping with a slash or encoding to UTF-8 where necessary - */ - for ($c = 0; $c < $strlen_var; ++$c) { - - $ord_var_c = ord($var{$c}); - - switch (true) { - case $ord_var_c == 0x08: - $ascii .= '\b'; - break; - case $ord_var_c == 0x09: - $ascii .= '\t'; - break; - case $ord_var_c == 0x0A: - $ascii .= '\n'; - break; - case $ord_var_c == 0x0C: - $ascii .= '\f'; - break; - case $ord_var_c == 0x0D: - $ascii .= '\r'; - break; - - case $ord_var_c == 0x22: - case $ord_var_c == 0x2F: - case $ord_var_c == 0x5C: - // double quote, slash, slosh - $ascii .= '\\'.$var{$c}; - break; - - case (($ord_var_c >= 0x20) && ($ord_var_c <= 0x7F)): - // characters U-00000000 - U-0000007F (same as ASCII) - $ascii .= $var{$c}; - break; - - case (($ord_var_c & 0xE0) == 0xC0): - // characters U-00000080 - U-000007FF, mask 110XXXXX - // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - $char = pack('C*', $ord_var_c, ord($var{$c + 1})); - $c += 1; - $utf16 = $this->utf82utf16($char); - $ascii .= sprintf('\u%04s', bin2hex($utf16)); - break; - - case (($ord_var_c & 0xF0) == 0xE0): - // characters U-00000800 - U-0000FFFF, mask 1110XXXX - // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - $char = pack('C*', $ord_var_c, - ord($var{$c + 1}), - ord($var{$c + 2})); - $c += 2; - $utf16 = $this->utf82utf16($char); - $ascii .= sprintf('\u%04s', bin2hex($utf16)); - break; - - case (($ord_var_c & 0xF8) == 0xF0): - // characters U-00010000 - U-001FFFFF, mask 11110XXX - // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - $char = pack('C*', $ord_var_c, - ord($var{$c + 1}), - ord($var{$c + 2}), - ord($var{$c + 3})); - $c += 3; - $utf16 = $this->utf82utf16($char); - $ascii .= sprintf('\u%04s', bin2hex($utf16)); - break; - - case (($ord_var_c & 0xFC) == 0xF8): - // characters U-00200000 - U-03FFFFFF, mask 111110XX - // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - $char = pack('C*', $ord_var_c, - ord($var{$c + 1}), - ord($var{$c + 2}), - ord($var{$c + 3}), - ord($var{$c + 4})); - $c += 4; - $utf16 = $this->utf82utf16($char); - $ascii .= sprintf('\u%04s', bin2hex($utf16)); - break; - - case (($ord_var_c & 0xFE) == 0xFC): - // characters U-04000000 - U-7FFFFFFF, mask 1111110X - // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - $char = pack('C*', $ord_var_c, - ord($var{$c + 1}), - ord($var{$c + 2}), - ord($var{$c + 3}), - ord($var{$c + 4}), - ord($var{$c + 5})); - $c += 5; - $utf16 = $this->utf82utf16($char); - $ascii .= sprintf('\u%04s', bin2hex($utf16)); - break; - } - } - - return '"'.$ascii.'"'; - - case 'array': - /* - * As per JSON spec if any array key is not an integer - * we must treat the the whole array as an object. We - * also try to catch a sparsely populated associative - * array with numeric keys here because some JS engines - * will create an array with empty indexes up to - * max_index which can cause memory issues and because - * the keys, which may be relevant, will be remapped - * otherwise. - * - * As per the ECMA and JSON specification an object may - * have any string as a property. Unfortunately due to - * a hole in the ECMA specification if the key is a - * ECMA reserved word or starts with a digit the - * parameter is only accessible using ECMAScript's - * bracket notation. - */ - - // treat as a JSON object - if (is_array($var) && count($var) && (array_keys($var) !== range(0, sizeof($var) - 1))) { - return '{' . - join(',', array_map(array($this, 'name_value'), - array_keys($var), - array_values($var))) - . '}'; - } - - // treat it like a regular array - return '[' . join(',', array_map(array($this, 'encode'), $var)) . ']'; - - case 'object': - $vars = get_object_vars($var); - return '{' . - join(',', array_map(array($this, 'name_value'), - array_keys($vars), - array_values($vars))) - . '}'; - - default: - return ''; - } - } - - /** - * array-walking function for use in generating JSON-formatted name-value pairs - * - * @param string $name name of key to use - * @param mixed $value reference to an array element to be encoded - * - * @return string JSON-formatted name-value pair, like '"name":value' - * @access private - */ - function name_value($name, $value) - { - return $this->encode(strval($name)) . ':' . $this->encode($value); - } - - /** - * reduce a string by removing leading and trailing comments and whitespace - * - * @param $str string string value to strip of comments and whitespace - * - * @return string string value stripped of comments and whitespace - * @access private - */ - function reduce_string($str) - { - $str = preg_replace(array( - - // eliminate single line comments in '// ...' form - '#^\s*//(.+)$#m', - - // eliminate multi-line comments in '/* ... */' form, at start of string - '#^\s*/\*(.+)\*/#Us', - - // eliminate multi-line comments in '/* ... */' form, at end of string - '#/\*(.+)\*/\s*$#Us' - - ), '', $str); - - // eliminate extraneous space - return trim($str); - } - - /** - * decodes a JSON string into appropriate variable - * - * @param string $str JSON-formatted string - * - * @return mixed number, boolean, string, array, or object - * corresponding to given JSON input string. - * See argument 1 to Services_JSON() above for object-output behavior. - * Note that decode() always returns strings - * in ASCII or UTF-8 format! - * @access public - */ - function decode($str) - { - $str = $this->reduce_string($str); - - switch (strtolower($str)) { - case 'true': - return true; - - case 'false': - return false; - - case 'null': - return null; - - default: - if (is_numeric($str)) { - // Lookie-loo, it's a number - - // This would work on its own, but I'm trying to be - // good about returning integers where appropriate: - // return (float)$str; - - // Return float or int, as appropriate - return ((float)$str == (integer)$str) - ? (integer)$str - : (float)$str; - - } elseif (preg_match('/^("|\').*(\1)$/s', $str, $m) && $m[1] == $m[2]) { - // STRINGS RETURNED IN UTF-8 FORMAT - $delim = substr($str, 0, 1); - $chrs = substr($str, 1, -1); - $utf8 = ''; - $strlen_chrs = strlen($chrs); - - for ($c = 0; $c < $strlen_chrs; ++$c) { - - $substr_chrs_c_2 = substr($chrs, $c, 2); - $ord_chrs_c = ord($chrs{$c}); - - switch (true) { - case $substr_chrs_c_2 == '\b': - $utf8 .= chr(0x08); - ++$c; - break; - case $substr_chrs_c_2 == '\t': - $utf8 .= chr(0x09); - ++$c; - break; - case $substr_chrs_c_2 == '\n': - $utf8 .= chr(0x0A); - ++$c; - break; - case $substr_chrs_c_2 == '\f': - $utf8 .= chr(0x0C); - ++$c; - break; - case $substr_chrs_c_2 == '\r': - $utf8 .= chr(0x0D); - ++$c; - break; - - case $substr_chrs_c_2 == '\\"': - case $substr_chrs_c_2 == '\\\'': - case $substr_chrs_c_2 == '\\\\': - case $substr_chrs_c_2 == '\\/': - if (($delim == '"' && $substr_chrs_c_2 != '\\\'') || - ($delim == "'" && $substr_chrs_c_2 != '\\"')) { - $utf8 .= $chrs{++$c}; - } - break; - - case preg_match('/\\\u[0-9A-F]{4}/i', substr($chrs, $c, 6)): - // single, escaped unicode character - $utf16 = chr(hexdec(substr($chrs, ($c + 2), 2))) - . chr(hexdec(substr($chrs, ($c + 4), 2))); - $utf8 .= $this->utf162utf8($utf16); - $c += 5; - break; - - case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F): - $utf8 .= $chrs{$c}; - break; - - case ($ord_chrs_c & 0xE0) == 0xC0: - // characters U-00000080 - U-000007FF, mask 110XXXXX - //see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - $utf8 .= substr($chrs, $c, 2); - ++$c; - break; - - case ($ord_chrs_c & 0xF0) == 0xE0: - // characters U-00000800 - U-0000FFFF, mask 1110XXXX - // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - $utf8 .= substr($chrs, $c, 3); - $c += 2; - break; - - case ($ord_chrs_c & 0xF8) == 0xF0: - // characters U-00010000 - U-001FFFFF, mask 11110XXX - // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - $utf8 .= substr($chrs, $c, 4); - $c += 3; - break; - - case ($ord_chrs_c & 0xFC) == 0xF8: - // characters U-00200000 - U-03FFFFFF, mask 111110XX - // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - $utf8 .= substr($chrs, $c, 5); - $c += 4; - break; - - case ($ord_chrs_c & 0xFE) == 0xFC: - // characters U-04000000 - U-7FFFFFFF, mask 1111110X - // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - $utf8 .= substr($chrs, $c, 6); - $c += 5; - break; - - } - - } - - return $utf8; - - } elseif (preg_match('/^\[.*\]$/s', $str) || preg_match('/^\{.*\}$/s', $str)) { - // array, or object notation - - if ($str{0} == '[') { - $stk = array(SERVICES_JSON_IN_ARR); - $arr = array(); - } else { - if ($this->use == SERVICES_JSON_LOOSE_TYPE) { - $stk = array(SERVICES_JSON_IN_OBJ); - $obj = array(); - } else { - $stk = array(SERVICES_JSON_IN_OBJ); - $obj = new stdClass(); - } - } - - array_push($stk, array('what' => SERVICES_JSON_SLICE, - 'where' => 0, - 'delim' => false)); - - $chrs = substr($str, 1, -1); - $chrs = $this->reduce_string($chrs); - - if ($chrs == '') { - if (reset($stk) == SERVICES_JSON_IN_ARR) { - return $arr; - - } else { - return $obj; - - } - } - - //print("\nparsing {$chrs}\n"); - - $strlen_chrs = strlen($chrs); - - for ($c = 0; $c <= $strlen_chrs; ++$c) { - - $top = end($stk); - $substr_chrs_c_2 = substr($chrs, $c, 2); - - if (($c == $strlen_chrs) || (($chrs{$c} == ',') && ($top['what'] == SERVICES_JSON_SLICE))) { - // found a comma that is not inside a string, array, etc., - // OR we've reached the end of the character list - $slice = substr($chrs, $top['where'], ($c - $top['where'])); - array_push($stk, array('what' => SERVICES_JSON_SLICE, 'where' => ($c + 1), 'delim' => false)); - //print("Found split at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n"); - - if (reset($stk) == SERVICES_JSON_IN_ARR) { - // we are in an array, so just push an element onto the stack - array_push($arr, $this->decode($slice)); - - } elseif (reset($stk) == SERVICES_JSON_IN_OBJ) { - // we are in an object, so figure - // out the property name and set an - // element in an associative array, - // for now - if (preg_match('/^\s*(["\'].*[^\\\]["\'])\s*:\s*(\S.*),?$/Uis', $slice, $parts)) { - // "name":value pair - $key = $this->decode($parts[1]); - $val = $this->decode($parts[2]); - - if ($this->use == SERVICES_JSON_LOOSE_TYPE) { - $obj[$key] = $val; - } else { - $obj->$key = $val; - } - } elseif (preg_match('/^\s*(\w+)\s*:\s*(\S.*),?$/Uis', $slice, $parts)) { - // name:value pair, where name is unquoted - $key = $parts[1]; - $val = $this->decode($parts[2]); - - if ($this->use == SERVICES_JSON_LOOSE_TYPE) { - $obj[$key] = $val; - } else { - $obj->$key = $val; - } - } - - } - - } elseif ((($chrs{$c} == '"') || ($chrs{$c} == "'")) && ($top['what'] != SERVICES_JSON_IN_STR)) { - // found a quote, and we are not inside a string - array_push($stk, array('what' => SERVICES_JSON_IN_STR, 'where' => $c, 'delim' => $chrs{$c})); - //print("Found start of string at {$c}\n"); - - } elseif (($chrs{$c} == $top['delim']) && - ($top['what'] == SERVICES_JSON_IN_STR) && - (($chrs{$c - 1} != '\\') || - ($chrs{$c - 1} == '\\' && $chrs{$c - 2} == '\\'))) { - // found a quote, we're in a string, and it's not escaped - array_pop($stk); - //print("Found end of string at {$c}: ".substr($chrs, $top['where'], (1 + 1 + $c - $top['where']))."\n"); - - } elseif (($chrs{$c} == '[') && - in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) { - // found a left-bracket, and we are in an array, object, or slice - array_push($stk, array('what' => SERVICES_JSON_IN_ARR, 'where' => $c, 'delim' => false)); - //print("Found start of array at {$c}\n"); - - } elseif (($chrs{$c} == ']') && ($top['what'] == SERVICES_JSON_IN_ARR)) { - // found a right-bracket, and we're in an array - array_pop($stk); - //print("Found end of array at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n"); - - } elseif (($chrs{$c} == '{') && - in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) { - // found a left-brace, and we are in an array, object, or slice - array_push($stk, array('what' => SERVICES_JSON_IN_OBJ, 'where' => $c, 'delim' => false)); - //print("Found start of object at {$c}\n"); - - } elseif (($chrs{$c} == '}') && ($top['what'] == SERVICES_JSON_IN_OBJ)) { - // found a right-brace, and we're in an object - array_pop($stk); - //print("Found end of object at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n"); - - } elseif (($substr_chrs_c_2 == '/*') && - in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) { - // found a comment start, and we are in an array, object, or slice - array_push($stk, array('what' => SERVICES_JSON_IN_CMT, 'where' => $c, 'delim' => false)); - $c++; - //print("Found start of comment at {$c}\n"); - - } elseif (($substr_chrs_c_2 == '*/') && ($top['what'] == SERVICES_JSON_IN_CMT)) { - // found a comment end, and we're in one now - array_pop($stk); - $c++; - - for ($i = $top['where']; $i <= $c; ++$i) - $chrs = substr_replace($chrs, ' ', $i, 1); - - //print("Found end of comment at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n"); - - } - - } - - if (reset($stk) == SERVICES_JSON_IN_ARR) { - return $arr; - - } elseif (reset($stk) == SERVICES_JSON_IN_OBJ) { - return $obj; - - } - - } - } - } - -} - -?> \ No newline at end of file diff --git a/includes/js/dojo/tests/resources/testClass.php b/includes/js/dojo/tests/resources/testClass.php deleted file mode 100644 index acf7f16..0000000 --- a/includes/js/dojo/tests/resources/testClass.php +++ /dev/null @@ -1,20 +0,0 @@ -" . $somestring . "

"; - } - - function contentB () { - return "

Content B

"; - } - - function contentC () { - return "

Content C

"; - } - - function add($x,$y) { - return $x + $y; - } -} -?> diff --git a/includes/js/dojo/tests/resources/testClass.smd b/includes/js/dojo/tests/resources/testClass.smd deleted file mode 100644 index 9be6988..0000000 --- a/includes/js/dojo/tests/resources/testClass.smd +++ /dev/null @@ -1,40 +0,0 @@ -{ - "SMDVersion":".1", - "objectName":"testClass", - "serviceType":"JSON-RPC", - "serviceURL":"../../dojo/tests/resources/test_JsonRPCMediator.php", - "methods":[ - { - "name":"myecho", - "parameters":[ - { - "name":"somestring", - "type":"STRING" - } - ] - }, - { - "name":"contentB" - }, - { - "name":"contentC" - }, - { - "name":"add", - "parameters":[ - { - "name":"x", - "type":"STRING" - }, - { - "name":"y", - "type":"STRING" - } - ] - }, - { - "name":"triggerRpcError" - }, - - ] -} diff --git a/includes/js/dojo/tests/resources/test_JsonRPCMediator.php b/includes/js/dojo/tests/resources/test_JsonRPCMediator.php deleted file mode 100644 index 42a9711..0000000 --- a/includes/js/dojo/tests/resources/test_JsonRPCMediator.php +++ /dev/null @@ -1,43 +0,0 @@ - sudo pear install File - // Your server will also need the Pear library directory included in PHP's - // include_path configuration directive - // require_once('File.php'); - - // ensure that we don't try to send "html" down to the client - header("Content-Type: text/plain"); - - $json = new Services_JSON; - //$fp = new File(); - - $results = array(); - $results['error'] = null; - - $jsonRequest = file_get_contents('php://input'); - //$jsonRequest = '{"params":["Blah"],"method":"myecho","id":86}'; - - $req = $json->decode($jsonRequest); - - include("./testClass.php"); - $testObject = new testClass(); - - $method = $req->method; - if ($method != "triggerRpcError") { - $ret = call_user_func_array(array($testObject,$method),$req->params); - $results['result'] = $ret; - } else { - $results['error'] = "Triggered RPC Error test"; - } - $results['id'] = $req->id; - - $encoded = $json->encode($results); - - print $encoded; -?> diff --git a/includes/js/dojo/tests/resources/test_css.html b/includes/js/dojo/tests/resources/test_css.html deleted file mode 100644 index b999f02..0000000 --- a/includes/js/dojo/tests/resources/test_css.html +++ /dev/null @@ -1,100 +0,0 @@ - - - Dojo CSS Stylesheet Test - - - -

Lorem ipsum dolor sit amet.

-

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. In porta. Etiam mattis libero nec ante. Nam porta lacus eu ligula. Cras mauris. Suspendisse vel augue. Vivamus aliquam orci ut eros. Nunc eleifend sagittis turpis. Nullam consequat iaculis augue. Aliquam pellentesque egestas massa. Curabitur pulvinar, enim vel porta dapibus, ligula lectus vulputate purus, eu tempus ante dolor id quam. Sed luctus fermentum nulla. Donec sollicitudin imperdiet risus. Cras cursus, sapien ac faucibus feugiat, ligula felis laoreet justo, eu sollicitudin purus purus in nibh. Phasellus in nunc.

- Donec eu nunc vitae lorem egestas convallis var test=null; Nullam at enim id mauris vestibulum ornare. Cras facilisis tellus at risus. Phasellus ut pede at erat posuere vehicula. Donec auctor sodales risus. Maecenas dictum erat at justo. Nullam fringilla dictum orci. Ut vitae erat. Fusce nunc. Duis quis orci. Morbi faucibus. Ut fermentum augue ac nulla. Duis cursus eleifend felis. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Mauris tincidunt, justo quis venenatis congue, nisi purus dignissim nisi, ullamcorper tempus dolor nulla at metus. -

Donec eu nunc vitae lorem.

-

Donec eu nunc vitae lorem egestas convallis. Nullam at enim id mauris vestibulum ornare. Cras facilisis tellus at risus. Phasellus ut pede at erat posuere vehicula. Donec auctor sodales risus. Maecenas dictum erat at justo. Nullam fringilla dictum orci. Ut vitae erat. Fusce nunc. Duis quis orci. Morbi faucibus. Ut fermentum augue ac nulla. Duis cursus eleifend felis. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Mauris tincidunt, justo quis venenatis congue, nisi purus dignissim nisi, ullamcorper tempus dolor nulla at metus.

-

Vestibulum ultricies bibendum tortor. Nam auctor dignissim neque. Cras vehicula. Nulla facilisi. Duis quis tellus in est aliquet condimentum. Sed elementum, felis vel pharetra bibendum, neque lorem pulvinar nulla, consequat tempor libero enim vel nulla. Nulla eleifend, lorem accumsan convallis lobortis, diam dui eleifend urna, eu imperdiet purus urna nec nibh. Nullam pede odio, molestie eu, interdum sagittis, imperdiet ac, lectus. Sed pede nisl, vulputate at, pellentesque id, consectetuer ac, elit. Duis laoreet, elit sed tempus vehicula, lacus orci pulvinar nibh, non malesuada ante mi in enim. Etiam pulvinar, sapien ut vulputate venenatis, risus lectus sollicitudin sapien, in dapibus felis ligula congue ante. Vivamus sit amet ligula. Morbi pharetra augue egestas massa. Sed a ligula. In ac mi id nibh semper accumsan. Nunc luctus nibh vel magna. Nunc viverra nonummy tortor. Curabitur interdum convallis dui. Integer mollis hendrerit elit. Nam a lorem.

-
    -
  1. A List item.
  2. -
  3. A List item.
  4. -
  5. A List item.
  6. -
  7. A List item.
  8. -
  9. A List item.
  10. -
  11. A List item.
  12. -
-

Cras pellentesque

-

Aliquam dapibus

-
-var test = someVariable;
-function foo(bar){
-	alert(baz);
-} 
-

Cras pellentesque tristique lorem. Aliquam dapibus, massa id posuere volutpat, sem sem nonummy turpis, ut ultricies nibh neque sed dolor. Duis commodo elit et massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed eu urna. Donec sit amet odio sit amet turpis facilisis molestie. In id mi. Nulla consequat ante ut elit. In risus urna, venenatis imperdiet, consequat vel, porttitor et, quam. In hac habitasse platea dictumst. Vestibulum id velit. Donec a eros. Donec quis quam at pede aliquet porta. Donec id ligula mollis turpis pulvinar dapibus. Praesent imperdiet, justo pulvinar accumsan scelerisque, lacus felis bibendum justo, id posuere augue libero eu velit.

-

An unstyled table.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FooBarBaz
bazfoobar
barbazfoo
foobarbaz
FooBarBaz
-

The same table, styled with dojoTabular.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FooBarBaz
bazfoobar
barbazfoo
foobarbaz
FooBarBaz
-
Donec eu nunc vitae lorem egestas convallis. Nullam at enim id mauris vestibulum ornare. Cras facilisis tellus at risus. Phasellus ut pede at erat posuere vehicula. Donec auctor sodales risus. Maecenas dictum erat at justo. Nullam fringilla dictum orci. Ut vitae erat. Fusce nunc. Duis quis orci. Morbi faucibus. Ut fermentum augue ac nulla. Duis cursus eleifend felis. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Mauris tincidunt, justo quis venenatis congue, nisi purus dignissim nisi, ullamcorper tempus dolor nulla at metus.
-

Phasellus quis velit. Curabitur porta dolor in arcu. Maecenas mollis purus. Donec nec erat et tellus laoreet elementum. Pellentesque vitae mi. Aenean pharetra libero ultricies augue. Vestibulum et nibh. Proin nibh quam, rutrum faucibus, auctor eget, mollis vel, orci. Duis tortor quam, tincidunt eu, lacinia id, fermentum at, turpis. Mauris at augue. Nulla facilisi. Pellentesque ut enim.

- - diff --git a/includes/js/dojo/tests/resources/yahoo_smd_v1.smd b/includes/js/dojo/tests/resources/yahoo_smd_v1.smd deleted file mode 100644 index 8f6a1f7..0000000 --- a/includes/js/dojo/tests/resources/yahoo_smd_v1.smd +++ /dev/null @@ -1,268 +0,0 @@ -{ - "SMDVersion":".1", - "objectName":"yahoo", - "serviceType":"JSON-P", - "required": { - "appid": "dojotoolkit", - "output": "json" - }, - "methods":[ - // - // MAPS - // - { - // http://developer.yahoo.com/maps/rest/V1/mapImage.html - "name":"mapImage", - "serviceURL": "http://api.local.yahoo.com/MapsService/V1/mapImage", - "parameters":[ - { "name":"street", "type":"STRING" }, - { "name":"city", "type":"STRING" }, - { "name":"zip", "type":"INTEGER" }, - { "name":"location", "type":"STRING" }, - { "name":"longitude", "type":"FLOAT" }, - { "name":"latitude", "type":"FLOAT" }, - { "name":"image_type", "type":"STRING" }, - { "name":"image_width", "type":"INTEGER" }, - { "name":"image_height", "type":"INTEGER" }, - { "name":"zoom", "type":"INTEGER" }, - { "name":"radius", "type":"INTEGER" } - ] - }, - { - // http://developer.yahoo.com/traffic/rest/V1/index.html - "name":"trafficData", - "serviceURL": "http://api.local.yahoo.com/MapsService/V1/trafficData", - "parameters":[ - { "name":"street", "type":"STRING" }, - { "name":"city", "type":"STRING" }, - { "name":"zip", "type":"INTEGER" }, - { "name":"location", "type":"STRING" }, - { "name":"longitude", "type":"FLOAT" }, - { "name":"latitude", "type":"FLOAT" }, - { "name":"severity", "type":"INTEGER" }, - { "name":"include_map", "type":"INTEGER" }, - { "name":"image_type", "type":"STRING" }, - { "name":"image_width", "type":"INTEGER" }, - { "name":"image_height", "type":"INTEGER" }, - { "name":"zoom", "type":"INTEGER" }, - { "name":"radius", "type":"INTEGER" } - ] - }, - // - // LOCAL SEARCH - // - { - // http://developer.yahoo.com/search/local/V3/localSearch.html - "name":"localSearch", - "serviceURL": "http://api.local.yahoo.com/LocalSearchService/V3/localSearch", - "parameters":[ - { "name":"street", "type":"STRING" }, - { "name":"city", "type":"STRING" }, - { "name":"zip", "type":"INTEGER" }, - { "name":"location", "type":"STRING" }, - { "name":"listing_id", "type":"STRING" }, - { "name":"sort", "type":"STRING" }, // "relevence", "title", "distance", or "rating" - { "name":"start", "type":"INTEGER" }, - { "name":"radius", "type":"FLOAT" }, - { "name":"results", "type":"INTEGER" }, // 1-50, defaults to 10 - { "name":"longitude", "type":"FLOAT" }, - { "name":"latitude", "type":"FLOAT" }, - { "name":"category", "type":"INTEGER" }, - { "name":"omit_category", "type":"INTEGER" }, - { "name":"minimum_rating", "type":"INTEGER" } - ] - }, - // - // WEB SEARCH - // - { - // http://developer.yahoo.com/search/web/V1/webSearch.html - "name":"webSearch", - "serviceURL": "http://api.search.yahoo.com/WebSearchService/V1/webSearch", - "parameters":[ - { "name":"query", "type":"STRING" }, - { "name":"type", "type":"STRING" }, // defaults to "all" - { "name":"region", "type":"STRING" }, // defaults to "us" - { "name":"results", "type":"INTEGER" }, // defaults to 10 - { "name":"start", "type":"INTEGER" }, // defaults to 1 - { "name":"format", "type":"STRING" }, // defaults to "any", can be "html", "msword", "pdf", "ppt", "rst", "txt", or "xls" - { "name":"adult_ok", "type":"INTEGER" }, // defaults to null - { "name":"similar_ok", "type":"INTEGER" }, // defaults to null - { "name":"language", "type":"STRING" }, // defaults to null - { "name":"country", "type":"STRING" }, // defaults to null - { "name":"site", "type":"STRING" }, // defaults to null - { "name":"subscription", "type":"STRING" }, // defaults to null - { "name":"license", "type":"STRING" } // defaults to "any" - ] - }, - { - // http://developer.yahoo.com/search/web/V1/spellingSuggestion.html - "name":"spellingSuggestion", - "serviceURL": "http://api.search.yahoo.com/WebSearchService/V1/spellingSuggestion", - "parameters":[ { "name":"query", "type":"STRING" } ] - }, - { - // http://developer.yahoo.com/search/web/V1/relatedSuggestion.html - "name":"spellingSuggestion", - "serviceURL": "http://api.search.yahoo.com/WebSearchService/V1/relatedSuggestion", - "parameters":[ - { "name":"query", "type":"STRING" }, - { "name":"results", "type":"INTEGER" } // 1-50, defaults to 10 - ] - }, - { - // http://developer.yahoo.com/search/content/V1/termExtraction.html - "name":"termExtraction", - "serviceURL": "http://search.yahooapis.com/ContentAnalysisService/V1/termExtraction", - "parameters":[ - { "name":"query", "type":"STRING" }, - { "name":"context", "type":"STRING" }, - { "name":"results", "type":"INTEGER" } // 1-50, defaults to 10 - ] - }, - { - // http://developer.yahoo.com/search/web/V1/contextSearch.html - "name":"contextSearch", - "serviceURL": "http://search.yahooapis.com/WebSearchService/V1/contextSearch", - "parameters":[ - { "name":"query", "type":"STRING" }, - { "name":"context", "type":"STRING" }, - { "name":"type", "type":"STRING" }, // defaults to "all" - { "name":"results", "type":"INTEGER" }, // defaults to 10 - { "name":"start", "type":"INTEGER" }, // defaults to 1 - { "name":"format", "type":"STRING" }, // defaults to "any", can be "html", "msword", "pdf", "ppt", "rst", "txt", or "xls" - { "name":"adult_ok", "type":"INTEGER" }, // defaults to null - { "name":"similar_ok", "type":"INTEGER" }, // defaults to null - { "name":"language", "type":"STRING" }, // defaults to null - { "name":"country", "type":"STRING" }, // defaults to null - { "name":"site", "type":"STRING" }, // defaults to null - { "name":"license", "type":"STRING" } // defaults to "any", could be "cc_any", "cc_commercial", "cc_modifiable" - ] - }, - // - // IMAGE SEARCH - // - { - // http://developer.yahoo.com/search/image/V1/imageSearch.html - "name":"imageSearch", - "serviceURL": "http://api.search.yahoo.com/ImageSearchService/V1/imageSearch", - "parameters":[ - { "name":"query", "type":"STRING" }, - { "name":"type", "type":"STRING" }, // defaults to "all", can by "any" or "phrase" - { "name":"results", "type":"INTEGER" }, // defaults to 10 - { "name":"start", "type":"INTEGER" }, // defaults to 1 - { "name":"format", "type":"STRING" }, // defaults to "any", can be "bmp", "gif", "jpeg", or "png" - { "name":"adult_ok", "type":"INTEGER" }, // defaults to null - { "name":"coloration", "type":"STRING" }, // "any", "color", or "bw" - { "name":"site", "type":"STRING" } // defaults to null - ] - }, - // - // SITE EXPLORER - // - { - // http://developer.yahoo.com/search/siteexplorer/V1/inlinkData.html - "name":"inlinkData", - "serviceURL": "http://api.search.yahoo.com/SiteExplorerService/V1/inlinkData", - "parameters":[ - { "name":"query", "type":"STRING" }, - { "name":"type", "type":"STRING" }, // defaults to "all", can by "any" or "phrase" - { "name":"entire_site", "type":"INTEGER" }, // defaults to null - { "name":"omit_inlinks", "type":"STRING" }, // "domain" or "subdomain", defaults to null - { "name":"results", "type":"INTEGER" }, // defaults to 50 - { "name":"start", "type":"INTEGER" }, // defaults to 1 - { "name":"site", "type":"STRING" } // defaults to null - ] - }, - { - // http://developer.yahoo.com/search/siteexplorer/V1/pageData.html - "name":"pageData", - "serviceURL": "http://api.search.yahoo.com/SiteExplorerService/V1/pageData", - "parameters":[ - { "name":"query", "type":"STRING" }, - { "name":"type", "type":"STRING" }, // defaults to "all", can by "any" or "phrase" - { "name":"domain_only", "type":"INTEGER" }, // defaults to null - { "name":"results", "type":"INTEGER" }, // defaults to 50 - { "name":"start", "type":"INTEGER" }, // defaults to 1 - { "name":"site", "type":"STRING" } // defaults to null - ] - }, - // - // MUSIC SEARCH - // - { - // http://developer.yahoo.com/search/audio/V1/artistSearch.html - "name":"artistSearch", - "serviceURL": "http://api.search.yahoo.com/AudioSearchService/V1/artistSearch", - "parameters":[ - { "name":"artist", "type":"STRING" }, - { "name":"artistid", "type":"STRING" }, - { "name":"type", "type":"STRING" }, // "all", "any", or "phrase" - { "name":"results", "type":"INTEGER" }, // 1-50, defaults to 10 - { "name":"start", "type":"INTEGER" } // defaults to 1 - ] - }, - { - // http://developer.yahoo.com/search/audio/V1/albumSearch.html - "name":"albumSearch", - "serviceURL": "http://api.search.yahoo.com/AudioSearchService/V1/albumSearch", - "parameters":[ - { "name":"artist", "type":"STRING" }, - { "name":"artistid", "type":"STRING" }, - { "name":"album", "type":"STRING" }, - { "name":"type", "type":"STRING" }, // "all", "any", or "phrase" - { "name":"results", "type":"INTEGER" }, // 1-50, defaults to 10 - { "name":"start", "type":"INTEGER" } // defaults to 1 - ] - }, - { - // http://developer.yahoo.com/search/audio/V1/songSearch.html - "name":"songSearch", - "serviceURL": "http://api.search.yahoo.com/AudioSearchService/V1/songSearch", - "parameters":[ - { "name":"artist", "type":"STRING" }, - { "name":"artistid", "type":"STRING" }, - { "name":"album", "type":"STRING" }, - { "name":"albumid", "type":"STRING" }, - { "name":"song", "type":"STRING" }, - { "name":"songid", "type":"STRING" }, - { "name":"type", "type":"STRING" }, // "all", "any", or "phrase" - { "name":"results", "type":"INTEGER" }, // 1-50, defaults to 10 - { "name":"start", "type":"INTEGER" } // defaults to 1 - ] - }, - { - // http://developer.yahoo.com/search/audio/V1/songDownloadLocation.html - "name":"songDownloadLocation", - "serviceURL": "http://api.search.yahoo.com/AudioSearchService/V1/songDownloadLocation", - "parameters":[ - { "name":"songid", "type":"STRING" }, - // "source" can contain: - // audiolunchbox artistdirect buymusic dmusic - // emusic epitonic garageband itunes yahoo - // livedownloads mp34u msn musicmatch mapster passalong - // rhapsody soundclick theweb - { "name":"source", "type":"STRING" }, - { "name":"results", "type":"INTEGER" }, // 1-50, defaults to 10 - { "name":"start", "type":"INTEGER" } // defaults to 1 - ] - }, - // - // NEWS SEARCH - // - { - // http://developer.yahoo.com/search/news/V1/newsSearch.html - "name":"newsSearch", - "serviceURL": "http://api.search.yahoo.com/NewsSearchService/V1/newsSearch", - "parameters":[ - { "name":"query", "type":"STRING" }, - { "name":"type", "type":"STRING" }, // defaults to "all" - { "name":"results", "type":"INTEGER" }, // defaults to 10 - { "name":"start", "type":"INTEGER" }, // defaults to 1 - { "name":"sort", "type":"STRING" }, // "rank" or "date" - { "name":"language", "type":"STRING" }, // defaults to null - { "name":"site", "type":"STRING" } // defaults to null - ] - } - ] -} diff --git a/includes/js/dojo/tests/rpc.js b/includes/js/dojo/tests/rpc.js deleted file mode 100644 index 09c8ef2..0000000 --- a/includes/js/dojo/tests/rpc.js +++ /dev/null @@ -1,151 +0,0 @@ -if(!dojo._hasResource["tests.rpc"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests.rpc"] = true; -dojo.provide("tests.rpc"); - -dojo.require("dojo.rpc.RpcService"); -dojo.require("dojo.rpc.JsonService"); -dojo.require("dojo.rpc.JsonpService"); - -doh.register("tests.rpc", - [ - - { - name: "JsonRPC-EchoTest", - timeout: 2000, - setUp: function(){ - - var testSmd = { - serviceURL:"../../dojo/tests/resources/test_JsonRPCMediator.php", - methods:[ - { - name:"myecho", - parameters:[ - { - name:"somestring", - type:"STRING" - } - ] - } - ] - } - - this.svc = new dojo.rpc.JsonService(testSmd); - }, - runTest: function(){ - var d = new doh.Deferred(); - var td = this.svc.myecho("RPC TEST"); - - if (window.location.protocol=="file:") { - var err= new Error("This Test requires a webserver and PHP and will fail intentionally if loaded from file://"); - d.errback(err); - return d; - } - - td.addCallbacks(function(result) { - if(result=="

RPC TEST

"){ - return true; - }else{ - return new Error("JsonRpc-EchoTest test failed, resultant content didn't match"); - } - }, function(result){ - return new Error(result); - }); - - td.addBoth(d, "callback"); - - return d; - } - - }, - - { - name: "JsonRPC-EmptyParamTest", - timeout: 2000, - setUp: function(){ - var testSmd={ - serviceURL:"../../dojo/tests/resources/test_JsonRPCMediator.php", - methods:[ { name:"contentB" } ] - } - - this.svc = new dojo.rpc.JsonService(testSmd); - }, - runTest: function(){ - var d = new doh.Deferred(); - var td = this.svc.contentB(); - - if (window.location.protocol=="file:") { - var err= new Error("This Test requires a webserver and PHP and will fail intentionally if loaded from file://"); - d.errback(err); - return d; - } - - td.addCallbacks(function(result){ - if(result=="

Content B

"){ - return true; - }else{ - return new Error("JsonRpc-EmpytParamTest test failed, resultant content didn't match"); - } - }, function(result){ - return new Error(result); - }); - - td.addBoth(d, "callback"); - - return d; - } - }, - - { - name: "JsonRPC_SMD_Loading_test", - setUp: function(){ - this.svc = new dojo.rpc.JsonService("../../dojo/tests/resources/testClass.smd"); - }, - runTest: function(){ - - if (this.svc.objectName=="testClass") { - return true; - } else { - return new Error("Error loading and/or parsing an smd file"); - } - } - }, - - { - name: "JsonP_test", - timeout: 10000, - setUp: function(){ - this.svc = new dojo.rpc.JsonpService(dojo.moduleUrl("dojo.tests.resources","yahoo_smd_v1.smd"), {appid: "foo"}); - }, - runTest: function(){ - var d = new doh.Deferred(); - - if (window.location.protocol=="file:") { - var err= new Error("This Test requires a webserver and will fail intentionally if loaded from file://"); - d.errback(err); - return d; - } - - var td = this.svc.webSearch({query:"dojotoolkit"}); - - td.addCallbacks(function(result){ - return true; - if (result["ResultSet"]["Result"][0]["DisplayUrl"]=="dojotoolkit.org/") { - return true; - }else{ - return new Error("JsonRpc_SMD_Loading_Test failed, resultant content didn't match"); - } - }, function(result){ - return new Error(result); - }); - - td.addBoth(d, "callback"); - - return d; - } - } - ] -); - - - -} diff --git a/includes/js/dojo/tests/runTests.html b/includes/js/dojo/tests/runTests.html deleted file mode 100644 index a83f534..0000000 --- a/includes/js/dojo/tests/runTests.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - Dojo CORE and BASE D.O.H. Unit Test Runner - - - Redirecting to D.O.H runner. - - diff --git a/includes/js/dojo/tests/string.js b/includes/js/dojo/tests/string.js deleted file mode 100644 index 2f9c2cb..0000000 --- a/includes/js/dojo/tests/string.js +++ /dev/null @@ -1,31 +0,0 @@ -if(!dojo._hasResource["tests.string"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests.string"] = true; -dojo.provide("tests.string"); - -dojo.require("dojo.string"); - -tests.register("tests.string", - [ - function test_string_pad(t){ - t.is("00001", dojo.string.pad("1", 5)); - t.is("000001", dojo.string.pad("000001", 5)); - t.is("10000", dojo.string.pad("1", 5, null, true)); - }, - - function test_string_substitute(t){ - t.is("File 'foo.html' is not found in directory '/temp'.", dojo.string.substitute("File '${0}' is not found in directory '${1}'.", ["foo.html","/temp"])); - t.is("File 'foo.html' is not found in directory '/temp'.", dojo.string.substitute("File '${name}' is not found in directory '${info.dir}'.", {name: "foo.html", info: {dir: "/temp"}})); - // Verify that an error is thrown! - t.assertError(Error, dojo.string, "substitute", ["${x}", {y:1}]); - }, - - function test_string_trim(t){ - t.is("astoria", dojo.string.trim(" \f\n\r\t astoria ")); - t.is("astoria", dojo.string.trim("astoria ")); - t.is("astoria", dojo.string.trim(" astoria")); - t.is("astoria", dojo.string.trim("astoria")); - } - ] -); - -} diff --git a/includes/js/dojo/tests/test_FirebugLite.html b/includes/js/dojo/tests/test_FirebugLite.html deleted file mode 100644 index f87f01b..0000000 --- a/includes/js/dojo/tests/test_FirebugLite.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - Firebug Lite Tests - - - - - - - - - -
- - diff --git a/includes/js/dojo/tests/test_FirebugLitePopup.html b/includes/js/dojo/tests/test_FirebugLitePopup.html deleted file mode 100644 index 926713e..0000000 --- a/includes/js/dojo/tests/test_FirebugLitePopup.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - Firebug Lite Tests - - - - - - -

test Firebug popup window

- - - -
- - diff --git a/includes/js/dojo/tests/test_fx.html b/includes/js/dojo/tests/test_fx.html deleted file mode 100644 index 8d9b0de..0000000 --- a/includes/js/dojo/tests/test_fx.html +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - - - - -
-

- Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean - semper sagittis velit. Cras in mi. Duis porta mauris ut ligula. - Proin porta rutrum lacus. Etiam consequat scelerisque quam. Nulla - facilisi. Maecenas luctus venenatis nulla. In sit amet dui non mi - semper iaculis. Sed molestie tortor at ipsum. Morbi dictum rutrum - magna. Sed vitae risus. -

-

- Aliquam vitae enim. Duis scelerisque metus auctor est venenatis - imperdiet. Fusce dignissim porta augue. Nulla vestibulum. Integer - lorem nunc, ullamcorper a, commodo ac, malesuada sed, dolor. Aenean - id mi in massa bibendum suscipit. Integer eros. Nullam suscipit - mauris. In pellentesque. Mauris ipsum est, pharetra semper, - pharetra in, viverra quis, tellus. Etiam purus. Quisque egestas, - tortor ac cursus lacinia, felis leo adipiscing nisi, et rhoncus - elit dolor eget eros. Fusce ut quam. Suspendisse eleifend leo vitae - ligula. Nulla facilisi. Nulla rutrum, erat vitae lacinia dictum, - pede purus imperdiet lacus, ut semper velit ante id metus. Praesent - massa dolor, porttitor sed, pulvinar in, consequat ut, leo. Nullam - nec est. Aenean id risus blandit tortor pharetra congue. - Suspendisse pulvinar. -

-
- - \ No newline at end of file -- cgit v1.2.3