Source code
Revision control
Copy as Markdown
Other Tools
<!DOCTYPE HTML>
<html>
<!--
-->
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript">
let SimpleTest = {
finish() {
parent.postMessage(JSON.stringify({fn: "finish"}), "*");
}
};
["ok", "is", "info"].forEach(fn => {
self[fn] = function (...args) {
parent.postMessage(JSON.stringify({fn, args}), "*");
}
});
"use strict";
function onLoad() {
function testEmbed(embed, expected_url, expected_fullscreen) {
ok (!!embed, "Embed node exists");
// getSVGDocument will return HTMLDocument if the content is HTML
let doc = embed.getSVGDocument();
// doc must be unprivileged because privileged doc will always be
// allowed to use fullscreen.
is (doc.fullscreenEnabled, expected_fullscreen,
"fullscreen should be " + (expected_fullscreen ? "enabled" : "disabled"));
embed = SpecialPowers.wrap(embed);
is (embed.srcURI.spec, expected_url, "Should have src uri of " + expected_url);
}
info("Running youtube rewrite query test");
testEmbed(document.getElementById("testembed-correct"), youtube_changed_url_query, false);
testEmbed(document.getElementById("testembed-correct-fs"), youtube_changed_url_query, true);
testEmbed(document.getElementById("testembed-wrong"), youtube_changed_url_query, false);
testEmbed(document.getElementById("testembed-whywouldyouevendothat"), youtube_changed_url_query, true);
SimpleTest.finish();
}
</script>
</head>
<body onload="onLoad()">
<embed id="testembed-correct"
type="application/x-shockwave-flash"
allowscriptaccess="always"></embed>
<embed id="testembed-correct-fs"
type="application/x-shockwave-flash"
allowfullscreen
allowscriptaccess="always"></embed>
<embed id="testembed-wrong"
type="application/x-shockwave-flash"
allowscriptaccess="always"></embed>
<embed id="testembed-whywouldyouevendothat"
type="application/x-shockwave-flash"
allowfullscreen
allowscriptaccess="always"></embed>
</body>
</html>