1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2 "http://www.w3.org/TR/html4/strict.dtd">
5 <title>Dijit raw programatic test suite | The Dojo Toolkit</title>
7 <style type="text/css">
8 @import "../../dojo/resources/dojo.css";
9 @import "css/dijitTests.css";
10 body, html { width:100%; height:100%; margin:0; padding:0; background:#fff !important; }
13 <script type="text/javascript" src="../../dojo/dojo.js"
14 djConfig="parseOnLoad: true, isDebug: true"></script>
15 <script type="text/javascript" src="_testCommon.js"></script>
17 <script language="JavaScript" type="text/javascript">
18 dojo.require("dojo.data.ItemFileReadStore");
19 dojo.require("dijit.dijit-all");
21 var randomParams = function(){
22 // need better params to test passing
23 return { "length" : 20 };
26 var inspectClass = function(fullClassName){
27 var newDijit, newDijitDom, newDijitParam = null;
28 var createdWidgets = [];
29 className = eval(fullClassName); //
31 // just try to make the class:
33 newDijit = new className({});
34 createdWidgets.push(newDijit);
36 console.warn('new only: ',fullClassName,e);
39 // try starting this widget
41 if (newDijit && newDijit.startup){ newDijit.startup(); }
43 console.warn('call startup: ',fullClassName,e);
46 // try with a div in the dom
48 var tmpDiv = dojo.body().appendChild(document.createElement('div'));
49 newDijitDom = new className({},tmpDiv);
50 createdWidgets.push(newDijitDom);
52 console.warn('attached to div: ',fullClassName,e);
55 // lets pass random parameters
57 var tmpDiv = dojo.body().appendChild(document.createElement('div'));
58 newDijitParam = new className(randomParams(),tmpDiv);
59 createdWidgets.push(newDijitParam);
61 console.warn('random param test: ',fullClassName,e);
65 // cleanup after ourselves
66 dojo.forEach(createdWidgets,function(byeWidget){
68 if(byeWidget.destroy){ byeWidget.destroy(); }
70 console.warn('destroying: ',byeWidget.declaredClass,e,byeWidget);
76 var storeError = function(e,request){
77 console.warn(e,request);
80 var storeReady = function(items,request){
81 dojo.forEach(items,function(item){
82 var testClass = theStore.getValue(item,"className");
84 inspectClass(testClass);
91 var init = function(){
94 onComplete: storeReady,
97 theStore.fetch(request);
105 <div dojoType="dojo.data.ItemFileReadStore" jsId="theStore"
106 url="../tests/_data/dijits.json"></div>