Permalink
Browse files

For DOH test files, call parser from DOH so that parse errors appear …

…as test failures. Also making tests AMD compatible by moving dojo.declare() etc. code inside of the dojo.addOnLoad(). Refs #12100.
  • Loading branch information...
1 parent 79bf189 commit 05b2b273fe5d16626843a6f0104f0839e7e808b7 @wkeese wkeese committed Dec 29, 2010
@@ -13,7 +13,7 @@
<!-- required: dojo.js -->
<script type="text/javascript" src="../../dojo/dojo.js"
- djConfig="parseOnLoad: true, isDebug: true"></script>
+ djConfig="isDebug: true"></script>
<!-- not needed, for testing alternate themes -->
<script type="text/javascript" src="_testCommon.js"></script>
View
@@ -25,7 +25,7 @@
<!-- required: dojo.js -->
<script type="text/javascript" src="../../dojo/dojo.js"
- data-dojo-config="parseOnLoad: true, isDebug: true"></script>
+ data-dojo-config="isDebug: true"></script>
<!-- not needed, for testing alternate themes -->
<script type="text/javascript" src="_testCommon.js"></script>
@@ -38,26 +38,35 @@
dojo.require("doh.runner");
dojo.addOnLoad(function go(){
- // note that programmatic instantiation doesn't pull any parameters from the srcNodeRef, not even id
- var theBar = new dijit.ProgressBar({id: "testBar", width: 400, maximum: 256, duration: 2000,
- report:function(percent){
- return dojo.string.substitute("${0} out of ${1} max chars", [this.get('value'), this.maximum]);
- }
- }, dojo.byId("testBar"));
-
- dojo.byId("test").value="";
- dojo.byId("progressValue").value = dijit.byId("setTestBar").value;
- dojo.byId("maximum").value = dijit.byId("setTestBar").maximum;
- dojo.connect(dojo.byId("test"), "onkeyup", null, keyUpHandler);
- dojo.connect(dojo.byId("set"), "onclick", null, setParameters);
- dojo.connect(dojo.byId("startTimer"), "onclick", null,
- function(){ remoteProgress(dijit.byId("timerBar")); } );
-
- // test 7
- new dijit.ProgressBar({
- style:"width:400px",
- indeterminate:true
- }, "pi");
+ doh.register("parse", function(){
+ dojo.parser.parse();
+ });
+
+ doh.register("other setup", function(){
+ // Stuff from the original test file. Not sure if this is needed now that
+ // the test is automated.
+
+ // note that programmatic instantiation doesn't pull any parameters from the srcNodeRef, not even id
+ var theBar = new dijit.ProgressBar({id: "testBar", width: 400, maximum: 256, duration: 2000,
+ report:function(percent){
+ return dojo.string.substitute("${0} out of ${1} max chars", [this.get('value'), this.maximum]);
+ }
+ }, dojo.byId("testBar"));
+
+ dojo.byId("test").value="";
+ dojo.byId("progressValue").value = dijit.byId("setTestBar").value;
+ dojo.byId("maximum").value = dijit.byId("setTestBar").maximum;
+ dojo.connect(dojo.byId("test"), "onkeyup", null, keyUpHandler);
+ dojo.connect(dojo.byId("set"), "onclick", null, setParameters);
+ dojo.connect(dojo.byId("startTimer"), "onclick", null,
+ function(){ remoteProgress(dijit.byId("timerBar")); } );
+
+ // test 7
+ new dijit.ProgressBar({
+ style:"width:400px",
+ indeterminate:true
+ }, "pi");
+ });
doh.register("ProgressBar",[
{
@@ -16,88 +16,95 @@
<!-- required: dojo.js -->
<script type="text/javascript" src="../../dojo/dojo.js"
- data-dojo-config="parseOnLoad: true, isDebug: true"></script>
+ data-dojo-config="isDebug: true"></script>
<!-- not needed, for testing alternate themes -->
<script type="text/javascript" src="_testCommon.js"></script>
<script type="text/javascript">
dojo.require("doh.runner");
+ dojo.require("dojo.parser");
dojo.require("dijit.dijit"); // optimize: load dijit layer
dojo.require("dijit.form.ValidationTextBox");
dojo.addOnLoad(function(){
- dijit._MasterTooltip.prototype.duration = 0.05; // speed up tooltip fading
- var view = dojo.window.getBox();
- var width = view.w;
- var height = view.h;
-
- if(width < 600){
- //Make the larger tooltips smaller so they fit on the page and pass all tests
- dijit.byId("test2").promptMessage="really really really really really really really really really really really really really really really really really really really really";
- dijit.byId("test5").promptMessage="really really really really really really really really really really really really really really really really really really really really";
- dijit.byId("test12").promptMessage="really really really really really really really really really really really really really really really really really really really really";
- dijit.byId("test17").promptMessage="really really really really really really really really really really really really really really really really really really really really";
- dijit.byId("test19").promptMessage="really really really really really really really really really really really really really really really really really really really really";
- }else if(width > 1200){
- //Make a shorter tooltip longer in order to span the whole width
- dijit.byId("test1").promptMessage="really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really<br><br><br><br><br><br><br><br><br><br><br><br><br><br>a"
- dijit.byId("test4").promptMessage="really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really<br><br><br><br><br><br><br><br><br>a"
- dijit.byId("test10").promptMessage="really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really<br><br><br><br><br><br><br><br><br>a"
- dijit.byId("test20").promptMessage="really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really<br><br><br><br><br><br><br><br><br>a"
- }
-
- if(height < 600){
- //Make the taller tooltips shorter
- for(var i=1;i<22;i++) {
- if(i==7){
- //skip
- }else{
- dijit.byId("test"+i+"_tall_skinny").promptMessage="<br><br><br><br>a";
+ doh.register("parse", function(){
+ dojo.parser.parse();
+ });
+
+ doh.register("other setup", function(){
+ dijit._MasterTooltip.prototype.duration = 0.05; // speed up tooltip fading
+ var view = dojo.window.getBox();
+ var width = view.w;
+ var height = view.h;
+
+ if(width < 600){
+ //Make the larger tooltips smaller so they fit on the page and pass all tests
+ dijit.byId("test2").promptMessage="really really really really really really really really really really really really really really really really really really really really";
+ dijit.byId("test5").promptMessage="really really really really really really really really really really really really really really really really really really really really";
+ dijit.byId("test12").promptMessage="really really really really really really really really really really really really really really really really really really really really";
+ dijit.byId("test17").promptMessage="really really really really really really really really really really really really really really really really really really really really";
+ dijit.byId("test19").promptMessage="really really really really really really really really really really really really really really really really really really really really";
+ }else if(width > 1200){
+ //Make a shorter tooltip longer in order to span the whole width
+ dijit.byId("test1").promptMessage="really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really<br><br><br><br><br><br><br><br><br><br><br><br><br><br>a"
+ dijit.byId("test4").promptMessage="really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really<br><br><br><br><br><br><br><br><br>a"
+ dijit.byId("test10").promptMessage="really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really<br><br><br><br><br><br><br><br><br>a"
+ dijit.byId("test20").promptMessage="really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really<br><br><br><br><br><br><br><br><br>a"
+ }
+
+ if(height < 600){
+ //Make the taller tooltips shorter
+ for(var i=1;i<22;i++) {
+ if(i==7){
+ //skip
+ }else{
+ dijit.byId("test"+i+"_tall_skinny").promptMessage="<br><br><br><br>a";
+ }
}
}
- }
-
- dijit.byId("test1").set("style", "width:"+width*(0.3)+"px");
- dijit.byId("test1_tall_skinny").set("style", "width:"+width*(0.3)+"px");
- dijit.byId("test2").set("style", "width:"+width*(0.6)+"px");
- dijit.byId("test2_tall_skinny").set("style", "width:"+width*(0.6)+"px");
- dijit.byId("test3").set("style", "width:"+width*(0.9)+"px");
- dijit.byId("test3_tall_skinny").set("style", "width:"+width*(0.9)+"px");
- dijit.byId("test4").set("style", "width:"+width*(0.3)+"px");
- dijit.byId("test4_tall_skinny").set("style", "width:"+width*(0.3)+"px");
- dijit.byId("test5").set("style", "width:"+width*(0.6)+"px");
- dijit.byId("test5_tall_skinny").set("style", "width:"+width*(0.6)+"px");
- dijit.byId("test6").set("style", "width:"+width*(0.9)+"px");
- dijit.byId("test6_tall_skinny").set("style", "width:"+width*(0.9)+"px");
- dijit.byId("test7").set("style", "width:"+width*(1.1)+"px");
- dijit.byId("test8").set("style", "width:"+width*(0.2)+"px");
- dijit.byId("test8_tall_skinny").set("style", "width:"+width*(0.2)+"px");
- dijit.byId("test9").set("style", "width:"+width*(0.3)+"px");
- dijit.byId("test9_tall_skinny").set("style", "width:"+width*(0.3)+"px");
- dijit.byId("test10").set("style", "width:"+width*(0.6)+"px");
- dijit.byId("test10_tall_skinny").set("style", "width:"+width*(0.6)+"px");
- dijit.byId("test11").set("style", "width:"+width*(0.9)+"px");
- dijit.byId("test11_tall_skinny").set("style", "width:"+width*(0.9)+"px");
- dijit.byId("test12").set("style", "width:"+width*(0.3)+"px");
- dijit.byId("test12_tall_skinny").set("style", "width:"+width*(0.3)+"px");
- dijit.byId("test13").set("style", "width:"+width*(0.6)+"px");
- dijit.byId("test13_tall_skinny").set("style", "width:"+width*(0.6)+"px");
- dijit.byId("test14").set("style", "width:"+width*(0.9)+"px");
- dijit.byId("test14_tall_skinny").set("style", "width:"+width*(0.9)+"px");
- dijit.byId("test15").set("style", "width:"+width*(0.9)+"px");
- dijit.byId("test15_tall_skinny").set("style", "width:"+width*(0.9)+"px");
- dijit.byId("test16").set("style", "width:"+width*(0.3)+"px");
- dijit.byId("test16_tall_skinny").set("style", "width:"+width*(0.3)+"px");
- dijit.byId("test17").set("style", "width:"+width*(0.6)+"px");
- dijit.byId("test17_tall_skinny").set("style", "width:"+width*(0.6)+"px");
- dijit.byId("test18").set("style", "width:"+width*(0.9)+"px");
- dijit.byId("test18_tall_skinny").set("style", "width:"+width*(0.9)+"px");
- dijit.byId("test19").set("style", "width:"+width*(0.3)+"px");
- dijit.byId("test19_tall_skinny").set("style", "width:"+width*(0.3)+"px");
- dijit.byId("test20").set("style", "width:"+width*(0.6)+"px");
- dijit.byId("test20_tall_skinny").set("style", "width:"+width*(0.6)+"px");
- dijit.byId("test21").set("style", "width:"+width*(0.9)+"px");
- dijit.byId("test21_tall_skinny").set("style", "width:"+width*(0.9)+"px");
+
+ dijit.byId("test1").set("style", "width:"+width*(0.3)+"px");
+ dijit.byId("test1_tall_skinny").set("style", "width:"+width*(0.3)+"px");
+ dijit.byId("test2").set("style", "width:"+width*(0.6)+"px");
+ dijit.byId("test2_tall_skinny").set("style", "width:"+width*(0.6)+"px");
+ dijit.byId("test3").set("style", "width:"+width*(0.9)+"px");
+ dijit.byId("test3_tall_skinny").set("style", "width:"+width*(0.9)+"px");
+ dijit.byId("test4").set("style", "width:"+width*(0.3)+"px");
+ dijit.byId("test4_tall_skinny").set("style", "width:"+width*(0.3)+"px");
+ dijit.byId("test5").set("style", "width:"+width*(0.6)+"px");
+ dijit.byId("test5_tall_skinny").set("style", "width:"+width*(0.6)+"px");
+ dijit.byId("test6").set("style", "width:"+width*(0.9)+"px");
+ dijit.byId("test6_tall_skinny").set("style", "width:"+width*(0.9)+"px");
+ dijit.byId("test7").set("style", "width:"+width*(1.1)+"px");
+ dijit.byId("test8").set("style", "width:"+width*(0.2)+"px");
+ dijit.byId("test8_tall_skinny").set("style", "width:"+width*(0.2)+"px");
+ dijit.byId("test9").set("style", "width:"+width*(0.3)+"px");
+ dijit.byId("test9_tall_skinny").set("style", "width:"+width*(0.3)+"px");
+ dijit.byId("test10").set("style", "width:"+width*(0.6)+"px");
+ dijit.byId("test10_tall_skinny").set("style", "width:"+width*(0.6)+"px");
+ dijit.byId("test11").set("style", "width:"+width*(0.9)+"px");
+ dijit.byId("test11_tall_skinny").set("style", "width:"+width*(0.9)+"px");
+ dijit.byId("test12").set("style", "width:"+width*(0.3)+"px");
+ dijit.byId("test12_tall_skinny").set("style", "width:"+width*(0.3)+"px");
+ dijit.byId("test13").set("style", "width:"+width*(0.6)+"px");
+ dijit.byId("test13_tall_skinny").set("style", "width:"+width*(0.6)+"px");
+ dijit.byId("test14").set("style", "width:"+width*(0.9)+"px");
+ dijit.byId("test14_tall_skinny").set("style", "width:"+width*(0.9)+"px");
+ dijit.byId("test15").set("style", "width:"+width*(0.9)+"px");
+ dijit.byId("test15_tall_skinny").set("style", "width:"+width*(0.9)+"px");
+ dijit.byId("test16").set("style", "width:"+width*(0.3)+"px");
+ dijit.byId("test16_tall_skinny").set("style", "width:"+width*(0.3)+"px");
+ dijit.byId("test17").set("style", "width:"+width*(0.6)+"px");
+ dijit.byId("test17_tall_skinny").set("style", "width:"+width*(0.6)+"px");
+ dijit.byId("test18").set("style", "width:"+width*(0.9)+"px");
+ dijit.byId("test18_tall_skinny").set("style", "width:"+width*(0.9)+"px");
+ dijit.byId("test19").set("style", "width:"+width*(0.3)+"px");
+ dijit.byId("test19_tall_skinny").set("style", "width:"+width*(0.3)+"px");
+ dijit.byId("test20").set("style", "width:"+width*(0.6)+"px");
+ dijit.byId("test20_tall_skinny").set("style", "width:"+width*(0.6)+"px");
+ dijit.byId("test21").set("style", "width:"+width*(0.9)+"px");
+ dijit.byId("test21_tall_skinny").set("style", "width:"+width*(0.9)+"px");
+ });
//Verify the following is true:
// 1. The tooltip is displayed to the right or the left of the textbox
View
@@ -6,24 +6,28 @@
<title>Container</title>
- <script type="text/javascript" src="../../dojo/dojo.js" data-dojo-config="isDebug: true, parseOnLoad: true"></script>
+ <script type="text/javascript" src="../../dojo/dojo.js" data-dojo-config="isDebug: true"></script>
<script type="text/javascript">
dojo.require("doh.runner");
dojo.require("dijit._Widget");
dojo.require("dijit._Container");
dojo.require("dijit._Contained");
- dojo.declare("dijit.TestContainer",
- [dijit._Widget, dijit._Container], { }
- );
-
- dojo.declare("dijit.TestContained",
- [dijit._Widget, dijit._Contained], {}
- );
-
dojo.require("dojo.parser");
dojo.addOnLoad(function(){
+ dojo.declare("dijit.TestContainer",
+ [dijit._Widget, dijit._Container], { }
+ );
+
+ dojo.declare("dijit.TestContained",
+ [dijit._Widget, dijit._Contained], {}
+ );
+
+ doh.register("parse", function(){
+ dojo.parser.parse();
+ });
+
doh.register("dijit._Container",
[
{
@@ -91,6 +95,7 @@
}
]
);
+
doh.run();
});
@@ -4,9 +4,10 @@
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
<title>testing widgetsInTemplate support</title>
<script type="text/javascript" src="../../dojo/dojo.js"
- data-dojo-config="parseOnLoad: true, isDebug: true"></script>
+ data-dojo-config="isDebug: true"></script>
<script type="text/javascript">
dojo.require("doh.runner");
+
dojo.require("dojo.parser");
dojo.require("dijit.form.Button");
@@ -19,7 +20,11 @@
dojo.require("dijit.layout._LayoutWidget");
dojo.addOnLoad(function(){
- doh.register("t",
+ doh.register("parse", function(){
+ dojo.parser.parse();
+ });
+
+ doh.register("_Templated-widgetsInTemplate",
[
{
name: "data-dojo-attach-point",
@@ -94,7 +99,7 @@
}
},
{
- // Check that programmatic widget with layout widgets in template is correctly created and rendered
+ // Check that programatic widget with layout widgets in template is correctly created and rendered
name: "programmatic widget with layout widgets",
runTest: function(t){
validateTest4Widget(t, test4WidgetProgrammatic);
@@ -2,10 +2,12 @@
<head>
<title>testing widgetsInTemplate support</title>
<script type="text/javascript" src="../../dojo/dojo.js"
- djConfig="parseOnLoad: true, isDebug: true"></script>
+ djConfig="isDebug: true"></script>
<script type="text/javascript">
dojo.require("doh.runner");
+ dojo.require("dojo.parser");
+
dojo.require("dijit.form.Button");
dojo.require("dijit.form.CheckBox");
dojo.require("dijit.ProgressBar");
@@ -17,7 +19,12 @@
dojo.addOnLoad(function(){
var testW;
- doh.register("t",
+
+ doh.register("parse", function(){
+ dojo.parser.parse();
+ });
+
+ doh.register("_Templated-widgetsInTemplate1.x",
[
{
name: "dojoAttachPoint",
View
@@ -4,10 +4,12 @@
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>_Templated tests</title>
<script type="text/javascript" src="../../dojo/dojo.js"
- data-dojo-config="parseOnLoad: true, isDebug: true"></script>
+ data-dojo-config="isDebug: true"></script>
<script type="text/javascript">
dojo.require("doh.runner");
+ dojo.require("dojo.parser");
+
dojo.require("dijit._Widget");
dojo.require("dijit._Templated");
@@ -54,7 +56,7 @@
templateString: "<tr><td>${text}</td></tr>"
});
- // Illegal subsitition variable name
+ // Illegal substitution variable name
dojo.declare("IllegalSubstitution", [dijit._Widget, dijit._Templated], {
templateString: "<tr><td>${fake}</td></tr>"
});
@@ -81,6 +83,11 @@
});
var testW;
+
+ doh.register("parse", function(){
+ dojo.parser.parse();
+ });
+
doh.register("dijit.tests._Templated.html",
[
function simple(t){
Oops, something went wrong.

0 comments on commit 05b2b27

Please sign in to comment.