blob: 76489ac1aed7d5d1a9b084a342e68ba22a632dc2 [file] [log] [blame]
<html>
<head>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
var object1Result = "";
var object2Result = "";
var embed3Result = "";
var embed4Result = "";
var object5Result = "";
var notified = false;
document.addEventListener("beforeload", function(event) {
if (event.url == "")
return;
if (event.target.id == "object1") {
object1Result = (event.url == "object-attr" ? "does" : "does not");
} else if (event.target.id == "object2") {
object2Result = (event.url == "object-param" ? "does" : "does not");
} else if (event.target.id == "embed3") {
embed3Result = (event.url == "embed-attr" ? "does" : "does not");
} else if (event.target.id == "embed4") {
embed4Result = (event.url == "embed-attr" ? "does" : "does not");
} else if (event.target.id == "object5") {
object5Result = (event.url == "object-param" ? "does" : "does not");
}
if (!notified && object1Result != "" && object2Result != "" && embed3Result != "" && embed4Result != "" && object5Result != "") {
debug("An &lt;object&gt; with a 'data' @attr and a 'src' &lt;param&gt; should load the URL from the 'data' @attr and " + object1Result + ".");
debug("An &lt;object&gt; with a 'src' &lt;param&gt; should load the URL from the 'src' &lt;param&gt; and " + object2Result + ".");
debug("An &lt;object&gt; with no URL specified and a nested &lt;embed&gt; should load the URL from the 'src' @attr of the &lt;embed&gt; and " + embed3Result + ".");
debug("An &lt;object&gt; with a URL specified in a 'src' &lt;param&gt; and a nested &lt;embed&gt; should load the URL from the 'src' @attr of the &lt;embed&gt; and " + embed3Result + ".");
debug("An &lt;object&gt; with a URL specified in a 'src' &lt;param&gt; and a MIME type specified in a 'type' &lt;param&gt; should load the URL from the 'src' &lt;param&gt; and " + object5Result + ".");
notified = true;
if (window.testRunner)
testRunner.notifyDone();
}
}, true);
function debug(str) {
document.getElementById('console').innerHTML += str + "<br>";
}
</script>
</head>
<body>
<p>This test verifies that the right URL is loaded when there is an &lt;object&gt; with a 'src' &lt;param&gt; and a fallback &lt;embed&gt;.</p>
<div id="console"></div>
<object id="object1" type="application/x-webkit-test-netscape" data="object-attr">
<param name="src" value="object-param"></param>
<embed id="embed1" type="application/x-webkit-test-netscape" src="embed-attr">
</object>
<object id="object2" type="application/x-webkit-test-netscape">
<param name="movie" value="object-param"></param>
<embed id="embed2" type="application/x-webkit-test-netscape" src="embed-attr">
</object>
<object id="object3">
<embed id="embed3" type="application/x-webkit-test-netscape" src="embed-attr">
</object>
<object id="object4">
<param name="code" value="object-param"></param>
<embed id="embed4" type="application/x-webkit-test-netscape" src="embed-attr">
</object>
<object id="object5">
<param name="url" value="object-param"></param>
<param name="type" value="application/x-webkit-test-netscape"></param>
</object>
</body>
</html>