Bug 650585 - Remove flaky timeouts from the accessibility tests, patch=ehsan, surkov, r=surkov, ehsan

This commit is contained in:
Alexander Surkov 2011-05-27 12:26:48 +09:00
parent 9d312cc7bf
commit 35e3d80d70
3 changed files with 21 additions and 17 deletions

View File

@ -30,11 +30,11 @@
var menu1 = document.getElementById("menu_item1");
menu1.open = true;
window.setTimeout(function() {
menu1.addEventListener("popupshown", function() {
var menu2 = document.getElementById("menu_item2");
menu2.open = true;
window.setTimeout(function() {
menu2.addEventListener("popupshown", function() {
testGroupAttrs("menu_item1.1", 1, 1);
testGroupAttrs("menu_item1.2", 1, 3);
testGroupAttrs("menu_item1.4", 2, 3);
@ -42,9 +42,12 @@
testGroupAttrs("menu_item2.1", 1, 2, 1);
testGroupAttrs("menu_item2.2", 2, 2, 1);
menu1.open = false;
menu2.open = false;
SimpleTest.finish();
}, 200);
}, 200);
}, false);
}, false);
//////////////////////////////////////////////////////////////////////////
// xul:tab

View File

@ -93,7 +93,7 @@ function addA11yLoadEvent(aFunc)
if (state.value & STATE_BUSY)
return waitForDocLoad();
window.setTimeout(aFunc, 150);
window.setTimeout(aFunc, 0);
},
0
);

View File

@ -15,6 +15,8 @@
src="../common.js" />
<script type="application/javascript"
src="../role.js" />
<script type="application/javascript"
src="../events.js" />
<script type="application/javascript">
<![CDATA[
@ -108,6 +110,11 @@
]
};
function test_txc7() {
testAccessibleTree("txc7", accTree);
SimpleTest.finish();
}
// XPFE and Toolkit autocomplete widgets differ.
var txc7 = document.getElementById("txc7");
if ("clearResults" in txc7) {
@ -139,11 +146,14 @@
}
]
}
);
);
test_txc7();
} else {
SimpleTest.ok(true, "Testing (New) Toolkit autocomplete widget.");
// Dumb access to trigger popup lazy creation. (See code below.)
// Dumb access to trigger popup lazy creation.
waitForEvent(EVENT_REORDER, txc7, test_txc7);
txc7.popup;
accTree.children.push(
@ -161,17 +171,8 @@
}
]
}
);
);
}
// Delay txc7 test a bit, to let Toolkit popup lazy creation complete.
function test_txc7() {
testAccessibleTree("txc7", accTree);
SimpleTest.finish();
}
// SimpleTest.executeSoon() doesn't help here: use setTimeout() with a little delay.
setTimeout(test_txc7, 25);
}
SimpleTest.waitForExplicitFinish();