зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1208197: Use addEventListener() in test_bug533845.xul to prevent raciness. r=smaug
This commit is contained in:
Родитель
322546b85a
Коммит
5358af1fa7
|
@ -10,7 +10,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=533845
|
|||
onload="doTest()">
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<panel id="panel" width="50" height="50" onpopupshown="continueTest()">
|
||||
<panel id="panel" width="50" height="50">
|
||||
<iframe type="content" id="contentFrame" src="data:text/html,<html><body onclick='document.body.textContent=1'>This is a panel!</body></html>" width="500" height="500"/>
|
||||
</panel>
|
||||
<body xmlns="http://www.w3.org/1999/xhtml">
|
||||
|
@ -23,7 +23,17 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=533845
|
|||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
function doTest() {
|
||||
document.getElementById('panel').showPopup();
|
||||
let panel = document.getElementById("panel");
|
||||
panel.addEventListener("popupshown", function onpopupshown() {
|
||||
panel.removeEventListener("popupshown", onpopupshown);
|
||||
continueTest();
|
||||
panel.addEventListener("popuphidden", function onpopuphidden() {
|
||||
panel.removeEventListener("popuphidden", onpopuphidden);
|
||||
SimpleTest.finish();
|
||||
});
|
||||
panel.hidePopup();
|
||||
});
|
||||
panel.openPopup();
|
||||
}
|
||||
|
||||
function continueTest() {
|
||||
|
@ -37,7 +47,6 @@ function continueTest() {
|
|||
utils.sendMouseEvent("mousedown", x, y, 0, 1, 0);
|
||||
utils.sendMouseEvent("mouseup", x, y, 0, 1, 0);
|
||||
is(ifrwindow.document.body.textContent, "1", "Should have got a click event!");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
]]></script>
|
||||
|
|
Загрузка…
Ссылка в новой задаче