mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1154802 - Fix racey test_error_in_video_document.html. r=jww
This test assumes that the decoding machinery will have completed its work one event-loop-round-trip after the document loads (see the executeSoon call), which is a totally bogus assumption.
This commit is contained in:
parent
239f4a1e54
commit
3747fb0d73
@ -21,9 +21,13 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=604067
|
||||
|
||||
/** Test for Bug 604067 **/
|
||||
|
||||
function documentVideo() {
|
||||
return document.body.getElementsByTagName("iframe")[0]
|
||||
.contentDocument.body.getElementsByTagName("video")[0];
|
||||
}
|
||||
|
||||
function check() {
|
||||
var v = document.body.getElementsByTagName("iframe")[0]
|
||||
.contentDocument.body.getElementsByTagName("video")[0];
|
||||
var v = documentVideo();
|
||||
|
||||
// Debug info for Bug 608634
|
||||
ok(true, "iframe src=" + document.body.getElementsByTagName("iframe")[0].src);
|
||||
@ -47,7 +51,15 @@ if (!t) {
|
||||
|
||||
var f = document.createElement("iframe");
|
||||
f.src = t.name;
|
||||
f.addEventListener("load", function() { SimpleTest.executeSoon(check); }, false);
|
||||
f.addEventListener("load", function() {
|
||||
if (documentVideo().error) {
|
||||
info("Error occured by the time we got |load| - checking directly.");
|
||||
check();
|
||||
} else {
|
||||
todo(false, "Error hasn't occurred yet - adding |error| event listener. This shouldn't happen, see bug 608634.");
|
||||
documentVideo().addEventListener("error", check);
|
||||
}
|
||||
}, false);
|
||||
document.body.appendChild(f);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user