gecko/dom/base/test/test_bug769117.html

52 lines
1.8 KiB
HTML

<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=769117
-->
<head>
<meta charset="utf-8">
<title>Test for Bug 769117</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript">
SimpleTest.waitForExplicitFinish();
/** Test for Bug 769117 **/
"use strict";
function onLoad () {
let youtube_url = "https://mochitest.youtube.com/v/Xm5i5kbIXzc";
let youtube_changed_url = "https://mochitest.youtube.com/embed/Xm5i5kbIXzc";
function testEmbed(embed) {
ok (embed, "Embed node exists");
embed = SpecialPowers.wrap(embed);
is (embed.srcURI.spec, youtube_changed_url, "Should have src uri of " + youtube_changed_url);
}
info("Running static embed youtube rewrite test");
testEmbed(document.getElementById("testembed"));
testEmbed(document.getElementById("testobject"));
info("Running dynamic embed youtube rewrite test");
let embed_dynamic = document.createElement("embed");
embed_dynamic.src = "https://mochitest.youtube.com/v/Xm5i5kbIXzc";
embed_dynamic.type = "application/x-shockwave-flash";
document.body.appendChild(embed_dynamic);
SimpleTest.executeSoon(() =>
{
testEmbed(embed_dynamic);
SimpleTest.finish();
});
}
</script>
</head>
<body onload="onLoad()">
<embed id="testembed"
src="https://mochitest.youtube.com/v/Xm5i5kbIXzc"
type="application/x-shockwave-flash"
allowscriptaccess="always"></embed>
<object id="testobject"
data="https://mochitest.youtube.com/v/Xm5i5kbIXzc"></embed>
</body>
</html>