зеркало из https://github.com/mozilla/gecko-dev.git
Bug 665677 test_bug330705-2.xul should ensure that the first box gets focus before doing test r=smaug
This commit is contained in:
Родитель
4a573899c2
Коммит
853ced0ced
|
@ -18,15 +18,25 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=330705
|
|||
<![CDATA[
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
function onLoad() {
|
||||
var isFocused = false;
|
||||
|
||||
function doTest() {
|
||||
document.getElementsByTagName('box')[1].blur();
|
||||
setTimeout(function () {
|
||||
ok(isFocused,
|
||||
"The first box element is still focused after blur() has been called on the second box element");
|
||||
SimpleTest.finish();
|
||||
}, 100);
|
||||
}
|
||||
|
||||
function onLoad() {
|
||||
var box = document.getElementsByTagName('box')[0];
|
||||
box.addEventListener('focus', function() { isFocused = true; }, true);
|
||||
box.addEventListener('focus', function() {
|
||||
isFocused = true;
|
||||
setTimeout(doTest, 0);
|
||||
}, true);
|
||||
box.addEventListener('blur', function() { isFocused = false;}, true);
|
||||
box.focus();
|
||||
document.getElementsByTagName('box')[1].blur();
|
||||
ok(isFocused == true, "The first box element is still focused after blur() has been called on the second box element");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
addLoadEvent(onLoad);
|
||||
|
|
Загрузка…
Ссылка в новой задаче