blob: f8d5644e3dbdeca786ab5f08d0d477d1a8ed1832 [file] [log] [blame]
<html>
<head>
<script>
function print(message, color)
{
var paragraph = document.createElement("div");
paragraph.appendChild(document.createTextNode(message));
paragraph.style.fontFamily = "monospace";
if (color)
paragraph.style.color = color;
document.getElementById("console").appendChild(paragraph);
}
function write(s)
{
document.getElementById('pre').appendChild(document.createTextNode(s));
}
function shouldBe(a, b)
{
var evalA = eval(a);
if (evalA == b)
print("PASS: " + a + " should be " + b + " and is.", "green");
else
print("FAIL: " + a + " should be " + b + " but instead is " + evalA + ".", "red");
}
var embed;
function test()
{
if (window.layoutTestController)
layoutTestController.dumpAsText();
embed = document.getElementById('embed');
print("[Embed is element specified in markup]");
embed.align = 1;
embed.height = 1;
embed.name = 1;
embed.width = 1;
embed.type = 1; // setting the type attribute should not effect the plugin once loaded
embed.src = 1; // setting the source attribute should not effect the plugin once loaded
shouldBe("embed.getAttribute('align')", 1);
shouldBe("embed.getAttribute('height')", 1);
shouldBe("embed.getAttribute('name')", 1);
shouldBe("embed.getAttribute('width')", 1);
shouldBe("embed.getAttribute('type')", 1);
shouldBe("embed.getAttribute('src')", 1);
shouldBe("typeof embed.Play", "function");
print("----------");
embed = document.createElement('embed');
print("[Embed is dynamically created element with only type specified]");
embed.style.visibility = "hidden";
embed.type = "video/quicktime";
document.body.appendChild(embed);
shouldBe("typeof embed.Play", "function");
print("----------");
embed = document.createElement('embed');
print("[Embed is dynamically created element with only src specified]");
embed.style.visibility = "hidden";
embed.src = "resources/articles.m4a";
document.body.appendChild(embed);
shouldBe("typeof embed.Play", "function");
}
</script>
</head>
<body onload="test();">
<hr>
<div id='console'></div>
<embed style="visibility: hidden" type="video/quicktime" id='embed'></embed>
</body>
</html>