Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Test case doesn't require parser. Also fixing tabbing and upgrading t…

…o HTML5 DOCTYPE.

Refs #2238.
  • Loading branch information...
commit ae80d29becb1a354736cdefdf2538d5522221346 1 parent 0906022
@wkeese wkeese authored
Showing with 348 additions and 349 deletions.
  1. +348 −349 tests/Dialog.html
View
697 tests/Dialog.html
@@ -1,5 +1,4 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
+<!DOCTYPE html>
<html>
<head>
<title>Dialog Widget Automated (non-robot) Tests</title>
@@ -14,7 +13,7 @@
<!-- required: dojo.js -->
<script type="text/javascript" src="../../dojo/dojo.js"
- djConfig="parseOnLoad: true, isDebug: true"></script>
+ djConfig="isDebug: true"></script>
<!-- functions to help test -->
<script type="text/javascript" src="helpers.js"></script>
@@ -28,386 +27,386 @@
dojo.require("dijit.Dialog");
dojo.addOnLoad(function(){
- // Non robot tests to see if nested dialogs work correctly
- // when obscured dialogs are destroyed/hidden, on race conditions of
- // multiple dialogs fading in/out at once, etc.
- doh.register("out-of-order dialog hide/destroy", [
- {
- name: "open first dialog",
- timeout: 10000,
- runTest: function(){
- var d = new doh.Deferred(),
- dlg1;
-
- // Start focus on a button on the page (although we aren't going
- // to click the button)
- dojo.byId("button").focus();
-
- // Create and show first dialog
- dlg1 = new dijit.Dialog({
- id: "dlg1",
- title: "dialog 1",
- content:
- "<input id='dlg1_inputA'><br>" +
- "<input id='dlg1_inputB'><br>" +
- "<input id='dlg1_inputC'><br>" +
- "<input id='dlg1_inputD'><br>" +
- "<input id='dlg1_inputE'><br>" +
- "<input id='dlg1_inputF'><br>" +
- "<input id='dlg1_inputG'><br>" +
- "<input id='dlg1_inputH'><br>"
- });
- dlg1.show().then(d.getTestCallback(function(){
- doh.t(isVisible(dlg1), "dialog 1 is visible");
-
- var dialog1Z = dojo.style(dlg1.domNode, "zIndex"),
- underlayZ = dojo.style(dojo.global.dijit._underlay.domNode, "zIndex");
-
- doh.t(dialog1Z > underlayZ, "dialog1 (zIndex=" + dialog1Z +
- ") above underlay (zIndex=" + underlayZ + ")");
-
- doh.is("dlg1_inputA", dojo.global.dijit._curFocus.id, "focus is on the first field");
- }));
-
- return d;
- }
- },
- {
- name: "open second dialog",
- timeout: 20000,
- runTest: function(){
- var d = new doh.Deferred(),
- dlg1 = dijit.byId("dlg1"),
- dlg2;
-
- // Create and show second dialog
- dlg2 = new dijit.Dialog({
- id: "dlg2",
- title: "dialog 2",
- content:
- "<input id='dlg2_inputA'><br>" +
- "<input id='dlg2_inputB'><br>" +
- "<input id='dlg2_inputC'><br>" +
- "<input id='dlg2_inputD'><br>" +
- "<input id='dlg2_inputE'><br>" +
- "<input id='dlg2_inputF'><br>"
- });
- dlg2.show().then(d.getTestCallback(function(){
- doh.t(isVisible(dlg2), "dialog 2 is visible");
-
- var dialog1Z = dojo.style(dlg1.domNode, "zIndex"),
- dialog2Z = dojo.style(dlg2.domNode, "zIndex"),
- underlayZ = dojo.style(dojo.global.dijit._underlay.domNode, "zIndex");
-
- doh.t(underlayZ > dialog1Z, "underlay (zIndex=" + underlayZ +
- ") above dialog1 (zIndex=" + dialog1Z + ")");
- doh.t(dialog2Z > underlayZ, "dialog2 (zIndex=" + dialog2Z +
- ") above underlay (zIndex=" + underlayZ + ")");
-
- doh.is("dlg2_inputA", dojo.global.dijit._curFocus.id, "focus is on the first field");
- }));
-
- return d;
- }
- },
- {
- name: "destroy first dialog",
- timeout: 20000,
- runTest: function(){
- var d = new doh.Deferred(),
- dlg1 = dijit.byId("dlg1"),
- dlg2 = dijit.byId("dlg2");
+ // Non robot tests to see if nested dialogs work correctly
+ // when obscured dialogs are destroyed/hidden, on race conditions of
+ // multiple dialogs fading in/out at once, etc.
+ doh.register("out-of-order dialog hide/destroy", [
+ {
+ name: "open first dialog",
+ timeout: 10000,
+ runTest: function(){
+ var d = new doh.Deferred(),
+ dlg1;
- dlg1.destroy();
+ // Start focus on a button on the page (although we aren't going
+ // to click the button)
+ dojo.byId("button").focus();
- setTimeout(d.getTestCallback(function(){
- doh.t(isVisible(dlg2), "dialog 2 is still visible");
- doh.t(isVisible(dojo.global.dijit._underlay), "underlay is still visible");
+ // Create and show first dialog
+ dlg1 = new dijit.Dialog({
+ id: "dlg1",
+ title: "dialog 1",
+ content:
+ "<input id='dlg1_inputA'><br>" +
+ "<input id='dlg1_inputB'><br>" +
+ "<input id='dlg1_inputC'><br>" +
+ "<input id='dlg1_inputD'><br>" +
+ "<input id='dlg1_inputE'><br>" +
+ "<input id='dlg1_inputF'><br>" +
+ "<input id='dlg1_inputG'><br>" +
+ "<input id='dlg1_inputH'><br>"
+ });
+ dlg1.show().then(d.getTestCallback(function(){
+ doh.t(isVisible(dlg1), "dialog 1 is visible");
- doh.is("dlg2_inputA", dojo.global.dijit._curFocus.id, "dialog 2 still has focus");
+ var dialog1Z = dojo.style(dlg1.domNode, "zIndex"),
+ underlayZ = dojo.style(dojo.global.dijit._underlay.domNode, "zIndex");
- var dialog2Z = dojo.style(dlg2.domNode, "zIndex"),
- underlayZ = dojo.style(dojo.global.dijit._underlay.domNode, "zIndex");
+ doh.t(dialog1Z > underlayZ, "dialog1 (zIndex=" + dialog1Z +
+ ") above underlay (zIndex=" + underlayZ + ")");
- doh.t(dialog2Z > underlayZ, "dialog2 (zIndex=" + dialog2Z +
- ") above underlay (zIndex=" + underlayZ + ")");
+ doh.is("dlg1_inputA", dojo.global.dijit._curFocus.id, "focus is on the first field");
+ }));
- }), 2000);
+ return d;
+ }
+ },
+ {
+ name: "open second dialog",
+ timeout: 20000,
+ runTest: function(){
+ var d = new doh.Deferred(),
+ dlg1 = dijit.byId("dlg1"),
+ dlg2;
- return d;
- }
- },
- {
- name: "open third dialog",
- timeout: 20000,
- runTest: function(){
- var d = new doh.Deferred(),
- dlg2 = dijit.byId("dlg2"),
- dlg3;
-
- // Create and show third dialog
- dlg3 = new dijit.Dialog({
- id: "dlg3",
- title: "dialog 3",
- content:
- "<input id='dlg3_inputA'><br>" +
- "<input id='dlg3_inputB'><br>" +
- "<input id='dlg3_inputC'><br>" +
- "<input id='dlg3_inputD'><br>"
-
- });
- dlg3.show().then(d.getTestCallback(function(){
- doh.t(isVisible(dlg3), "dialog 3 is visible");
-
- // Even though a dialog was deleted, the zIndex of the dialog 3
- // should be above dialog 2. This test is to make sure we don't
- // merely use _dialogStack.length to compute zIndex
- var dialog2Z = dojo.style(dlg2.domNode, "zIndex"),
- dialog3Z = dojo.style(dlg3.domNode, "zIndex"),
- underlayZ = dojo.style(dojo.global.dijit._underlay.domNode, "zIndex");
- doh.t(underlayZ > dialog2Z, "underlay (zIndex=" + underlayZ +
- ") above dialog2 (zIndex=" + dialog2Z + ")");
- doh.t(dialog3Z > underlayZ, "dialog3 (zIndex=" + dialog3Z +
- ") above underlay (zIndex=" + underlayZ + ")");
-
- doh.is("dlg3_inputA", dojo.global.dijit._curFocus.id, "focus is on the first field");
- }));
-
- return d;
- }
- },
- {
- name: "open fourth dialog",
- timeout: 30000,
- runTest: function(){
- var d = new doh.Deferred(),
- dlg3 = dijit.byId("dlg3"),
- dlg4;
-
- // Create and show fourth dialog
- dlg4 = new dijit.Dialog({
- id: "dlg4",
- title: "dialog 4",
- content:
- "<input id='dlg4_inputA'><br>" +
- "<input id='dlg4_inputB'>"
- });
- dlg4.show().then(d.getTestCallback(function(){
- doh.t(isVisible(dlg4), "dialog 4 is visible");
-
- var dialog3Z = dojo.style(dlg3.domNode, "zIndex"),
- dialog4Z = dojo.style(dlg4.domNode, "zIndex"),
- underlayZ = dojo.style(dojo.global.dijit._underlay.domNode, "zIndex");
- doh.t(underlayZ > dialog3Z, "underlay (zIndex=" + underlayZ +
- ") above dialog3 (zIndex=" + dialog3Z + ")");
- doh.t(dialog4Z > underlayZ, "dialog4 (zIndex=" + dialog4Z +
- ") above underlay (zIndex=" + underlayZ + ")");
-
- doh.is("dlg4_inputA", dojo.global.dijit._curFocus.id, "focus is on the first field");
- }));
-
- return d;
- }
- },
- {
- name: "hide third dialog",
- timeout: 40000,
- runTest: function(){
- var d = new doh.Deferred(),
- dlg3 = dijit.byId("dlg3"),
- dlg4 = dijit.byId("dlg4");
+ // Create and show second dialog
+ dlg2 = new dijit.Dialog({
+ id: "dlg2",
+ title: "dialog 2",
+ content:
+ "<input id='dlg2_inputA'><br>" +
+ "<input id='dlg2_inputB'><br>" +
+ "<input id='dlg2_inputC'><br>" +
+ "<input id='dlg2_inputD'><br>" +
+ "<input id='dlg2_inputE'><br>" +
+ "<input id='dlg2_inputF'><br>"
+ });
+ dlg2.show().then(d.getTestCallback(function(){
+ doh.t(isVisible(dlg2), "dialog 2 is visible");
- dlg3.hide().then(d.getTestCallback(function(){
- doh.t(isVisible(dlg4), "dialog 4 is still visible");
- doh.t(isVisible(dojo.global.dijit._underlay), "underlay is still visible");
+ var dialog1Z = dojo.style(dlg1.domNode, "zIndex"),
+ dialog2Z = dojo.style(dlg2.domNode, "zIndex"),
+ underlayZ = dojo.style(dojo.global.dijit._underlay.domNode, "zIndex");
- doh.is("dlg4_inputA", dojo.global.dijit._curFocus.id, "dialog 4 still has focus");
+ doh.t(underlayZ > dialog1Z, "underlay (zIndex=" + underlayZ +
+ ") above dialog1 (zIndex=" + dialog1Z + ")");
+ doh.t(dialog2Z > underlayZ, "dialog2 (zIndex=" + dialog2Z +
+ ") above underlay (zIndex=" + underlayZ + ")");
- var dialog4Z = dojo.style(dlg4.domNode, "zIndex"),
- underlayZ = dojo.style(dojo.global.dijit._underlay.domNode, "zIndex");
+ doh.is("dlg2_inputA", dojo.global.dijit._curFocus.id, "focus is on the first field");
+ }));
- doh.t(dialog4Z > underlayZ, "dialog4 (zIndex=" + dialog4Z +
- ") above underlay (zIndex=" + underlayZ + ")");
+ return d;
+ }
+ },
+ {
+ name: "destroy first dialog",
+ timeout: 20000,
+ runTest: function(){
+ var d = new doh.Deferred(),
+ dlg1 = dijit.byId("dlg1"),
+ dlg2 = dijit.byId("dlg2");
- }));
+ dlg1.destroy();
- return d;
- }
- },
- {
- name: "close fourth dialog",
- timeout: 30000,
- runTest: function(){
- var d = new doh.Deferred(),
- dlg2 = dijit.byId("dlg2"),
- dlg3 = dijit.byId("dlg3"),
- dlg4 = dijit.byId("dlg4");
-
- // Closing fourth dialog should move focus to second dialog,
- // since we already destroyed the third dialog
- dlg4.hide().then(d.getTestCallback(function(){
- doh.t(isHidden(dlg4), "dialog 4 is hidden");
- doh.t(isHidden(dlg3), "dialog 3 is hidden");
- doh.t(isVisible(dlg2), "dialog 2 is visible");
-
- var dialog2Z = dojo.style(dlg2.domNode, "zIndex"),
- underlayZ = dojo.style(dojo.global.dijit._underlay.domNode, "zIndex");
- doh.t(dialog2Z > underlayZ, "dialog2 (zIndex=" + dialog2Z +
- ") above underlay (zIndex=" + underlayZ + ")");
-
- doh.is("dlg2_inputA", dojo.global.dijit._curFocus.id, "focus is on the first field");
- }));
-
- return d;
- }
- },
- {
- name: "close second dialog",
- timeout: 30000,
- runTest: function(){
- var d = new doh.Deferred(),
- dlg2 = dijit.byId("dlg2");
-
- // Since we already destroyed first dialog, closing second dialog should hide underlay and
- // revert focus to the main page
- dlg2.hide().then(d.getTestCallback(function(){
- doh.t(isHidden(dlg2), "dialog 4 is hidden");
- doh.t(isHidden(dojo.global.dijit._underlay), "underlay hidden");
-
- doh.is("button", dojo.global.dijit._curFocus.id, "focus is on the main page");
- }));
-
- return d;
- }
- }
- ]);
+ setTimeout(d.getTestCallback(function(){
+ doh.t(isVisible(dlg2), "dialog 2 is still visible");
+ doh.t(isVisible(dojo.global.dijit._underlay), "underlay is still visible");
+
+ doh.is("dlg2_inputA", dojo.global.dijit._curFocus.id, "dialog 2 still has focus");
- var dlgA, dlgB;
- doh.register("concurrent hide show", {
- name: "concurrent hide show",
+ var dialog2Z = dojo.style(dlg2.domNode, "zIndex"),
+ underlayZ = dojo.style(dojo.global.dijit._underlay.domNode, "zIndex");
+
+ doh.t(dialog2Z > underlayZ, "dialog2 (zIndex=" + dialog2Z +
+ ") above underlay (zIndex=" + underlayZ + ")");
+
+ }), 2000);
+
+ return d;
+ }
+ },
+ {
+ name: "open third dialog",
timeout: 20000,
- setUp: function(){
- // Create and show first dialog
- dlgA = new dijit.Dialog({
- id: "dlgA",
- title: "Dialog A",
+ runTest: function(){
+ var d = new doh.Deferred(),
+ dlg2 = dijit.byId("dlg2"),
+ dlg3;
+
+ // Create and show third dialog
+ dlg3 = new dijit.Dialog({
+ id: "dlg3",
+ title: "dialog 3",
content:
- "<button type='button'>OK</button>"
+ "<input id='dlg3_inputA'><br>" +
+ "<input id='dlg3_inputB'><br>" +
+ "<input id='dlg3_inputC'><br>" +
+ "<input id='dlg3_inputD'><br>"
+
});
- dlgB = new dijit.Dialog({
- id: "dlgB",
- title: "dialog B",
+ dlg3.show().then(d.getTestCallback(function(){
+ doh.t(isVisible(dlg3), "dialog 3 is visible");
+
+ // Even though a dialog was deleted, the zIndex of the dialog 3
+ // should be above dialog 2. This test is to make sure we don't
+ // merely use _dialogStack.length to compute zIndex
+ var dialog2Z = dojo.style(dlg2.domNode, "zIndex"),
+ dialog3Z = dojo.style(dlg3.domNode, "zIndex"),
+ underlayZ = dojo.style(dojo.global.dijit._underlay.domNode, "zIndex");
+ doh.t(underlayZ > dialog2Z, "underlay (zIndex=" + underlayZ +
+ ") above dialog2 (zIndex=" + dialog2Z + ")");
+ doh.t(dialog3Z > underlayZ, "dialog3 (zIndex=" + dialog3Z +
+ ") above underlay (zIndex=" + underlayZ + ")");
+
+ doh.is("dlg3_inputA", dojo.global.dijit._curFocus.id, "focus is on the first field");
+ }));
+
+ return d;
+ }
+ },
+ {
+ name: "open fourth dialog",
+ timeout: 30000,
+ runTest: function(){
+ var d = new doh.Deferred(),
+ dlg3 = dijit.byId("dlg3"),
+ dlg4;
+
+ // Create and show fourth dialog
+ dlg4 = new dijit.Dialog({
+ id: "dlg4",
+ title: "dialog 4",
content:
- "<button type='button'>OK</button>"
+ "<input id='dlg4_inputA'><br>" +
+ "<input id='dlg4_inputB'>"
});
- dlgA.show();
-
- },
+ dlg4.show().then(d.getTestCallback(function(){
+ doh.t(isVisible(dlg4), "dialog 4 is visible");
+
+ var dialog3Z = dojo.style(dlg3.domNode, "zIndex"),
+ dialog4Z = dojo.style(dlg4.domNode, "zIndex"),
+ underlayZ = dojo.style(dojo.global.dijit._underlay.domNode, "zIndex");
+ doh.t(underlayZ > dialog3Z, "underlay (zIndex=" + underlayZ +
+ ") above dialog3 (zIndex=" + dialog3Z + ")");
+ doh.t(dialog4Z > underlayZ, "dialog4 (zIndex=" + dialog4Z +
+ ") above underlay (zIndex=" + underlayZ + ")");
+
+ doh.is("dlg4_inputA", dojo.global.dijit._curFocus.id, "focus is on the first field");
+ }));
+
+ return d;
+ }
+ },
+ {
+ name: "hide third dialog",
+ timeout: 40000,
runTest: function(){
var d = new doh.Deferred(),
- cnt=0;
-
- handle = setInterval(d.getTestErrback(function(){
- var hidden = cnt%2 ? dlgA : dlgB,
- shown = cnt%2 ? dlgB : dlgA;
-
- if(cnt > 10){
- clearInterval(handle);
- handle = null;
- d.callback(true);
- return;
- }
-
- doh.t(isVisible(shown), shown.title + " visible");
- doh.t(isHidden(hidden), hidden.title + " hidden");
- doh.t(isVisible(dojo.global.dijit._underlay), "underlay visible");
-
- var shownZ = dojo.style(shown.domNode, "zIndex"),
+ dlg3 = dijit.byId("dlg3"),
+ dlg4 = dijit.byId("dlg4");
+
+ dlg3.hide().then(d.getTestCallback(function(){
+ doh.t(isVisible(dlg4), "dialog 4 is still visible");
+ doh.t(isVisible(dojo.global.dijit._underlay), "underlay is still visible");
+
+ doh.is("dlg4_inputA", dojo.global.dijit._curFocus.id, "dialog 4 still has focus");
+
+ var dialog4Z = dojo.style(dlg4.domNode, "zIndex"),
underlayZ = dojo.style(dojo.global.dijit._underlay.domNode, "zIndex");
- doh.t(shownZ > underlayZ, "visible dialog (zIndex=" + shownZ +
+
+ doh.t(dialog4Z > underlayZ, "dialog4 (zIndex=" + dialog4Z +
") above underlay (zIndex=" + underlayZ + ")");
- hidden.show();
- shown.hide();
+ }));
+
+ return d;
+ }
+ },
+ {
+ name: "close fourth dialog",
+ timeout: 30000,
+ runTest: function(){
+ var d = new doh.Deferred(),
+ dlg2 = dijit.byId("dlg2"),
+ dlg3 = dijit.byId("dlg3"),
+ dlg4 = dijit.byId("dlg4");
+
+ // Closing fourth dialog should move focus to second dialog,
+ // since we already destroyed the third dialog
+ dlg4.hide().then(d.getTestCallback(function(){
+ doh.t(isHidden(dlg4), "dialog 4 is hidden");
+ doh.t(isHidden(dlg3), "dialog 3 is hidden");
+ doh.t(isVisible(dlg2), "dialog 2 is visible");
+
+ var dialog2Z = dojo.style(dlg2.domNode, "zIndex"),
+ underlayZ = dojo.style(dojo.global.dijit._underlay.domNode, "zIndex");
+ doh.t(dialog2Z > underlayZ, "dialog2 (zIndex=" + dialog2Z +
+ ") above underlay (zIndex=" + underlayZ + ")");
+
+ doh.is("dlg2_inputA", dojo.global.dijit._curFocus.id, "focus is on the first field");
+ }));
+
+ return d;
+ }
+ },
+ {
+ name: "close second dialog",
+ timeout: 30000,
+ runTest: function(){
+ var d = new doh.Deferred(),
+ dlg2 = dijit.byId("dlg2");
+
+ // Since we already destroyed first dialog, closing second dialog should hide underlay and
+ // revert focus to the main page
+ dlg2.hide().then(d.getTestCallback(function(){
+ doh.t(isHidden(dlg2), "dialog 4 is hidden");
+ doh.t(isHidden(dojo.global.dijit._underlay), "underlay hidden");
+
+ doh.is("button", dojo.global.dijit._curFocus.id, "focus is on the main page");
+ }));
- cnt++;
- }), 1000);
-
return d;
- },
- tearDown: function(){
- dlgA.hide();
- dlgB.hide();
- if(handle){
+ }
+ }
+ ]);
+
+ var dlgA, dlgB;
+ doh.register("concurrent hide show", {
+ name: "concurrent hide show",
+ timeout: 20000,
+ setUp: function(){
+ // Create and show first dialog
+ dlgA = new dijit.Dialog({
+ id: "dlgA",
+ title: "Dialog A",
+ content:
+ "<button type='button'>OK</button>"
+ });
+ dlgB = new dijit.Dialog({
+ id: "dlgB",
+ title: "dialog B",
+ content:
+ "<button type='button'>OK</button>"
+ });
+ dlgA.show();
+
+ },
+ runTest: function(){
+ var d = new doh.Deferred(),
+ cnt=0;
+
+ handle = setInterval(d.getTestErrback(function(){
+ var hidden = cnt%2 ? dlgA : dlgB,
+ shown = cnt%2 ? dlgB : dlgA;
+
+ if(cnt > 10){
clearInterval(handle);
+ handle = null;
+ d.callback(true);
+ return;
}
+
+ doh.t(isVisible(shown), shown.title + " visible");
+ doh.t(isHidden(hidden), hidden.title + " hidden");
+ doh.t(isVisible(dojo.global.dijit._underlay), "underlay visible");
+
+ var shownZ = dojo.style(shown.domNode, "zIndex"),
+ underlayZ = dojo.style(dojo.global.dijit._underlay.domNode, "zIndex");
+ doh.t(shownZ > underlayZ, "visible dialog (zIndex=" + shownZ +
+ ") above underlay (zIndex=" + underlayZ + ")");
+
+ hidden.show();
+ shown.hide();
+
+ cnt++;
+ }), 1000);
+
+ return d;
+ },
+ tearDown: function(){
+ dlgA.hide();
+ dlgB.hide();
+ if(handle){
+ clearInterval(handle);
}
- });
+ }
+ });
- var slow, fast;
- doh.register("fast double show", [
- function create(){
- console.log("creating slow, fast");
+ var slow, fast;
+ doh.register("fast double show", [
+ function create(){
+ console.log("creating slow, fast");
+ var d = new doh.Deferred();
+ slow = new dijit.Dialog({
+ id: "slow",
+ title: "Dialog C",
+ content:
+ "Hello world " +
+ "<button type='button' id='slowOK' onfocus='dojo.global.slowFocused=true;'>OK</button>" +
+ "<button type='button' id='slowCancel'>Cancel</button>",
+ duration: 500
+ });
+ fast = new dijit.Dialog({
+ id: "fast",
+ title: "dialog D",
+ content:
+ "<button type='button'>OK</button>",
+ duration: 100
+ });
+
+ },
+ {
+ name: "show Dialog C then show Dialog D before Dialog C fade-in completes",
+ timeout: 20000,
+ runTest: function(){
var d = new doh.Deferred();
- slow = new dijit.Dialog({
- id: "slow",
- title: "Dialog C",
- content:
- "Hello world " +
- "<button type='button' id='slowOK' onfocus='dojo.global.slowFocused=true;'>OK</button>" +
- "<button type='button' id='slowCancel'>Cancel</button>",
- duration: 500
- });
- fast = new dijit.Dialog({
- id: "fast",
- title: "dialog D",
- content:
- "<button type='button'>OK</button>",
- duration: 100
- });
+
+ slow.show();
- },
- {
- name: "show Dialog C then show Dialog D before Dialog C fade-in completes",
- timeout: 20000,
- runTest: function(){
- var d = new doh.Deferred();
-
- slow.show();
-
- setTimeout(d.getTestErrback(function(){
- fast.show();
- }), slow.duration / 2)
-
- setTimeout(d.getTestCallback(function(){
- doh.t(isVisible(slow), "dialog C visible");
- doh.t(isVisible(fast), "dialog D visible");
- doh.f(dojo.global.slowFocused, "dialog C never got focus")
- }), slow.duration * 2)
- return d;
- }
- },
-
- {
- name: "close dialogD",
- timeout: 20000,
- runTest: function(){
- var d = new doh.Deferred();
-
- fast.hide();
-
- setTimeout(d.getTestCallback(function(){
- doh.is("slowOK", dojo.global.dijit._curFocus.id, "focused to dialog C");
- doh.t(dojo.global.slowFocused, "onfocus handler working");
- }), fast.duration * 2)
-
- return d;
- }
+ setTimeout(d.getTestErrback(function(){
+ fast.show();
+ }), slow.duration / 2)
+
+ setTimeout(d.getTestCallback(function(){
+ doh.t(isVisible(slow), "dialog C visible");
+ doh.t(isVisible(fast), "dialog D visible");
+ doh.f(dojo.global.slowFocused, "dialog C never got focus")
+ }), slow.duration * 2)
+ return d;
}
- ]);
+ },
- doh.run();
- });
+ {
+ name: "close dialogD",
+ timeout: 20000,
+ runTest: function(){
+ var d = new doh.Deferred();
+
+ fast.hide();
+
+ setTimeout(d.getTestCallback(function(){
+ doh.is("slowOK", dojo.global.dijit._curFocus.id, "focused to dialog C");
+ doh.t(dojo.global.slowFocused, "onfocus handler working");
+ }), fast.duration * 2)
+
+ return d;
+ }
+ }
+ ]);
+
+ doh.run();
+ });
</script>
</head>
<body class="claro">
Please sign in to comment.
Something went wrong with that request. Please try again.